Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 53fb75353f |
+25
-10
@@ -91,29 +91,44 @@ jobs:
|
|||||||
echo "El SDK ready"
|
echo "El SDK ready"
|
||||||
/opt/el/dist/platform/elc --version || true
|
/opt/el/dist/platform/elc --version || true
|
||||||
|
|
||||||
|
- name: Generate ELP master declarations header
|
||||||
|
run: |
|
||||||
|
{
|
||||||
|
printf '/* Auto-generated C forward declarations for ELP cross-module calls */\n'
|
||||||
|
printf '#pragma once\n'
|
||||||
|
printf '#include "el_runtime.h"\n'
|
||||||
|
printf '\n'
|
||||||
|
grep -h -E '^(el_val_t|void|int|char\*|const char\*)[[:space:]]+[a-zA-Z_][a-zA-Z0-9_]*[[:space:]]*\(' dist/*.c 2>/dev/null \
|
||||||
|
| grep ';$' | sort -u
|
||||||
|
} > dist/elp-c-decls.h
|
||||||
|
echo "Generated elp-c-decls.h with $(grep -c ';' dist/elp-c-decls.h 2>/dev/null || echo 0) declarations"
|
||||||
|
|
||||||
- name: Build neuron soul binary
|
- name: Build neuron soul binary
|
||||||
run: |
|
run: |
|
||||||
ELB=/opt/el/dist/bin/elb
|
ELB=/opt/el/dist/bin/elb
|
||||||
ELC=/opt/el/dist/platform/elc
|
ELC=/opt/el/dist/platform/elc
|
||||||
RUNTIME=/opt/el/runtime
|
RUNTIME=/opt/el/runtime
|
||||||
|
|
||||||
# Compile all El modules to C via elb.
|
# Compile all El modules to C.
|
||||||
# elb fails at link on Linux (GNU ld rejects duplicate strong symbols that
|
# This step will fail at link on Linux: the El compiler inlines imported
|
||||||
# macOS ld accepts silently) — that's expected and captured with || true.
|
# modules into each module's .c file, producing duplicate strong symbol
|
||||||
# The important output is dist/soul.c: the El compiler inlines all imported
|
# definitions. GNU ld rejects these; macOS ld accepts them silently.
|
||||||
# modules into the entry-point file, so soul.c is a self-contained
|
# We capture the link failure and re-link manually below.
|
||||||
# translation unit. We never link the other dist/*.c files — they contain
|
|
||||||
# the same symbols inlined again, plus capability-violation #error guards
|
|
||||||
# that fire when compiled outside the cgi entrypoint.
|
|
||||||
$ELB --elc=$ELC --runtime=$RUNTIME/el_runtime.c || true
|
$ELB --elc=$ELC --runtime=$RUNTIME/el_runtime.c || true
|
||||||
|
|
||||||
# Link only soul.c + the runtime. No --allow-multiple-definition needed.
|
# Re-link with soul.c listed first so its real main() (from the cgi block)
|
||||||
|
# wins over the stub main()s generated in every other module.
|
||||||
|
# --allow-multiple-definition tells GNU ld to pick the first definition
|
||||||
|
# for each duplicate symbol — safe here because all duplicates are identical
|
||||||
|
# (same El source compiled independently into multiple .c files).
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
|
OTHER_C=$(ls dist/*.c | grep -v '/soul\.c$' | sort | tr '\n' ' ')
|
||||||
cc -O2 -DHAVE_CURL \
|
cc -O2 -DHAVE_CURL \
|
||||||
-I$RUNTIME \
|
-I$RUNTIME \
|
||||||
dist/soul.c \
|
dist/soul.c $OTHER_C \
|
||||||
$RUNTIME/el_runtime.c \
|
$RUNTIME/el_runtime.c \
|
||||||
-lssl -lcrypto -lcurl -lpthread -lm \
|
-lssl -lcrypto -lcurl -lpthread -lm \
|
||||||
|
-Wl,--allow-multiple-definition \
|
||||||
-o dist/neuron
|
-o dist/neuron
|
||||||
|
|
||||||
ls -lh dist/neuron
|
ls -lh dist/neuron
|
||||||
|
|||||||
@@ -317,10 +317,13 @@ fn connector_tools_json() -> String {
|
|||||||
return arr
|
return arr
|
||||||
}
|
}
|
||||||
|
|
||||||
// Built-in tools + native web_search + every connector tool, as one tools array.
|
// Built-in tools + every connector tool, as one tools array.
|
||||||
// Splices connector tools in before the closing bracket of the base array.
|
// Uses agentic_tools_literal (not agentic_tools_with_web) to avoid a duplicate
|
||||||
|
// "web_search" name — the literal already includes a custom web_search handler,
|
||||||
|
// and adding the Anthropic server-side web_search_20250305 (same name) causes
|
||||||
|
// Anthropic to reject with "Tool names must be unique."
|
||||||
fn agentic_tools_all() -> String {
|
fn agentic_tools_all() -> String {
|
||||||
let base: String = agentic_tools_with_web()
|
let base: String = agentic_tools_literal()
|
||||||
let conn: String = connector_tools_json()
|
let conn: String = connector_tools_json()
|
||||||
let conn_inner: String = str_slice(conn, 1, str_len(conn) - 1)
|
let conn_inner: String = str_slice(conn, 1, str_len(conn) - 1)
|
||||||
if str_eq(conn_inner, "") {
|
if str_eq(conn_inner, "") {
|
||||||
|
|||||||
Reference in New Issue
Block a user