@coalex-ai/sdk 2.3.0-beta.686 → 2.4.0-beta.689

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -61,6 +61,7 @@ register({
61
61
  apiKey: "your-api-key",
62
62
  serviceName: "my-agent",
63
63
  declare: {
64
+ agentId: "my-agent", // the id your coalexContext() uses
64
65
  endpoint: "https://my-agent.example.com/turn", // where the Console POSTs a turn
65
66
  tools: ["wire_funds"], // tool names only
66
67
  resumeUrl: "https://my-agent.example.com/resume", // if the agent supports being paused
@@ -71,7 +72,10 @@ register({
71
72
  });
72
73
  ```
73
74
 
74
- An agent that declares no `displayName`, `description` or `suggestedPrompts` is shown by its name
75
+ `declare` also takes a list, one per agent of a multi-agent system: each worker names the umbrella
76
+ as its `parent` and declares no `endpoint`. Omitted, `agentId` is the active `coalexContext()`'s;
77
+ the default service name is never used as an id. `declare()` sends a declaration after
78
+ `register()`. An agent that declares no `displayName`, `description` or `suggestedPrompts` is shown by its name
75
79
  alone. Whether a tool is governed and who may approve it are set in the dashboard, not here.
76
80
 
77
81
  ### `autoInstrumentAsync(options?)`
@@ -42,6 +42,18 @@ export interface EvaluateOptions {
42
42
  * `output`, `input` or `metadata`.
43
43
  */
44
44
  toolName?: string;
45
+ /**
46
+ * The run (one execution of the agent system, across pauses and resumes) this call belongs to,
47
+ * stored on the escalation. Defaults to the active coalexContext()'s runId.
48
+ */
49
+ runId?: string;
50
+ /**
51
+ * The agent the asking agent claims as its parent, stored on the escalation as a claim; it
52
+ * governs nothing. Defaults to the active coalexContext()'s parent, and only when the call is for
53
+ * that context's own agent: an explicit `agentId` naming another agent takes no parent from the
54
+ * context.
55
+ */
56
+ parentAgentId?: string;
45
57
  }
46
58
  export declare function evaluate(options: EvaluateOptions): Promise<EvaluationDecision>;
47
59
  //# sourceMappingURL=evaluate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"evaluate.d.ts","sourceRoot":"","s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BAAkB;IACjC;;sFAEkF;IAClF,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,WAAW,CAAC;IAC/C;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA2BD,wBAAsB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAsFpF"}
package/dist/evaluate.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { getConfig, getApiKey } from "./index.js";
2
2
  import { flushUngoverned } from "./ungoverned.js";
3
- import { currentAgentId } from "./context.js";
3
+ import { currentAgentId, currentParentAgentId, currentRunId } from "./context.js";
4
4
  import { serializeResumeHook } from "./decision-request.js";
5
5
  import { coalexFetch, httpError, sdkHeaders } from "./http.js";
6
6
  import { log } from "./logger.js";
@@ -56,7 +56,11 @@ export async function evaluate(options) {
56
56
  if (options.traceId) {
57
57
  log.warn("traceId is deprecated, use requestId instead");
58
58
  }
59
- const agentId = options.agentId ?? currentAgentId();
59
+ const contextAgentId = currentAgentId();
60
+ const agentId = options.agentId ?? contextAgentId;
61
+ const runId = options.runId ?? currentRunId();
62
+ // The context's parent is the parent of the context's agent, so it is claimed for that agent only.
63
+ const parentAgentId = options.parentAgentId ?? (agentId !== undefined && agentId === contextAgentId ? currentParentAgentId() : undefined);
60
64
  const payload = {
61
65
  request_id: requestId,
62
66
  input: options.input,
@@ -65,6 +69,12 @@ export async function evaluate(options) {
65
69
  if (agentId) {
66
70
  payload.agent_id = agentId;
67
71
  }
72
+ if (parentAgentId) {
73
+ payload.parent_agent_id = parentAgentId;
74
+ }
75
+ if (runId) {
76
+ payload.run_id = runId;
77
+ }
68
78
  if (options.metrics) {
69
79
  payload.metrics = options.metrics;
70
80
  }
@@ -1 +1 @@
1
- {"version":3,"file":"evaluate.js","sourceRoot":"","sources":["../src/evaluate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAmB,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC;;0DAE0D;AAC1D,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IACnC,IAAI;IACJ,cAAc;IACd,MAAM;IACN,SAAS;IACT,aAAa;IACb,aAAa;IACb,UAAU;CACX,CAAC,CAAC;AA4CH;;;;;;;GAOG;AACH,MAAM,eAAe,GAA2B;IAC9C,QAAQ,EAAE,gCAA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C,QAAQ,CAAC;IACvC,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,YAAY,EAAE,GAAG,MAAM,CAAC,QAAQ,kBAAkB,EAAE;QACjF,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,UAAU,CAAC,MAAM,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC;QACnE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;KAC9B,CAAC,CAAC;IAEH,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;QACb,MAAM,MAAM,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAC5C,CAAC;IAED,iGAAiG;IACjG,kGAAkG;IAClG,kGAAkG;IAClG,+DAA+D;IAC/D,KAAK,eAAe,EAAE,CAAC;IAEvB,kEAAkE;IAClE,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,CAAC;IACzD,IAAI,WAAW,EAAE,CAAC;QAChB,GAAG,CAAC,IAAI,CAAC,oBAAoB,WAAW,EAAE,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;IAC/B,OAAO;QACL,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,SAAS,EAAE,IAAI,CAAC,UAAU;QAC1B,SAAS,EAAE,IAAI,CAAC,UAAU;QAC1B,YAAY,EAAE,IAAI,CAAC,aAAa,IAAI,SAAS;KAC9C,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -15,7 +15,7 @@ export type { DecisionRequest, TaskState, ElicitationAction, ElicitationResult,
15
15
  export { getPrompt } from "./prompts.js";
16
16
  export type { GetPromptOptions, PromptVersion } from "./prompts.js";
17
17
  export { declareAgent } from "./agents.js";
18
- export { declareInventory } from "./inventory.js";
18
+ export { declareInventory, agentIdProblem, MAX_AGENT_ID } from "./inventory.js";
19
19
  export type { AgentInventory } from "./inventory.js";
20
20
  export type { AgentDeclaration, DeclareAgentOptions } from "./agents.js";
21
21
  export { autoInstrument, autoInstrumentAsync, instrumentOpenAI, instrumentLangChain, instrumentAnthropic } from "./auto-instrument.js";
@@ -26,6 +26,11 @@ export declare function getApiKey(): string;
26
26
  export interface RegisterOptions {
27
27
  endpoint?: string;
28
28
  apiKey?: string;
29
+ /**
30
+ * Service name for the OTLP resource (default `coalex-sdk-typescript`). It is not an agent id: a
31
+ * declaration without `agentId` outside any `coalexContext()` falls back to it only when passed
32
+ * explicitly, a fallback deprecated and removed in @coalex-ai/sdk 3.0.
33
+ */
29
34
  serviceName?: string;
30
35
  filterNonAiSpans?: boolean;
31
36
  suppressExportErrors?: boolean;
@@ -41,10 +46,23 @@ export interface RegisterOptions {
41
46
  * Optionally tell the platform where this agent lives and what tools it has (COA-1969), so it
42
47
  * appears in the Console without anyone registering it by hand. Best-effort: a failure is
43
48
  * logged and startup continues. Omit it and `register()` makes no network call at all.
49
+ *
50
+ * One inventory or a list of them, one per agent of a multi-agent system; each is sent on its
51
+ * own, so one refusal does not stop the others. `declare()` does the same after `register()`.
44
52
  */
45
- declare?: AgentInventory;
53
+ declare?: AgentInventory | AgentInventory[];
46
54
  }
47
55
  export declare function register(options?: RegisterOptions): void;
56
+ /**
57
+ * Declare one agent, or several, with the endpoint and key `register()` configured.
58
+ *
59
+ * For an agent that declares itself after startup, or declares its children once it knows them.
60
+ * Each declaration is checked locally and sent on its own, so one refusal does not stop the
61
+ * others; each refusal is logged with its reason. Resolves to whether the declaration landed, or a
62
+ * list of that, in order, when given a list. Throws only when `register()` has not been called.
63
+ */
64
+ export declare function declare(inventory: AgentInventory): Promise<boolean>;
65
+ export declare function declare(inventories: AgentInventory[]): Promise<boolean[]>;
48
66
  /** Reset SDK state — for testing only. */
49
67
  export declare function _resetForTesting(): void;
50
68
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../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} from "./safe-exporter.js";
8
8
  import { FilteringSpanExporter } from "./filtering-exporter.js";
9
9
  import { CoalexAttributePropagator } from "./span-processor.js";
10
- import { declareInventory } from "./inventory.js";
10
+ import { declareMany } from "./inventory.js";
11
11
  import { setLogger } from "./logger.js";
12
12
  export { agentNode, coalexContext, coalexContextSync, currentAgentId, currentAgentVersion, currentParentAgentId, currentRequestId, currentRunId, } from "./context.js";
13
13
  export { evaluate, KNOWN_METRICS } from "./evaluate.js";
@@ -22,10 +22,15 @@ export { fromEscalation, serializeDecisionRequest, parseResolver, resolverToSpec
22
22
  isForbiddenFieldKey, scrubForbidden, } from "./decision-request.js";
23
23
  export { getPrompt } from "./prompts.js";
24
24
  export { declareAgent } from "./agents.js";
25
- export { declareInventory } from "./inventory.js";
25
+ export { declareInventory, agentIdProblem, MAX_AGENT_ID } from "./inventory.js";
26
26
  export { autoInstrument, autoInstrumentAsync, instrumentOpenAI, instrumentLangChain, instrumentAnthropic } from "./auto-instrument.js";
27
27
  let _config = null;
28
28
  let _apiKey = null;
29
+ /**
30
+ * The service name the caller passed to `register()`, or undefined when it took the default. Only
31
+ * an explicit one may stand in for a declaration's agentId, and that fallback is deprecated.
32
+ */
33
+ let _explicitServiceName;
29
34
  export function getConfig() {
30
35
  if (!_config) {
31
36
  throw new Error("register() must be called before using the Coalex SDK");
@@ -48,6 +53,7 @@ export function register(options) {
48
53
  setLogger(options?.logger);
49
54
  _config = { endpoint, serviceName };
50
55
  _apiKey = apiKey;
56
+ _explicitServiceName = options?.serviceName;
51
57
  const resource = resourceFromAttributes({ [ATTR_SERVICE_NAME]: serviceName });
52
58
  const baseExporter = new OTLPTraceExporter({
53
59
  url: `${endpoint}/v1/traces`,
@@ -68,13 +74,20 @@ export function register(options) {
68
74
  if (options?.declare) {
69
75
  // Deliberately last, and deliberately not awaited: tracing is configured before we talk to
70
76
  // anyone, and register() stays synchronous so an unreachable control plane cannot delay or
71
- // block an agent's startup. declareInventory never rejects.
72
- void declareInventory(options.declare, { config: _config, apiKey, defaultName: serviceName });
77
+ // block an agent's startup. declareMany never rejects.
78
+ void declareMany(options.declare, { config: _config, apiKey, serviceName: _explicitServiceName });
73
79
  }
74
80
  }
81
+ export async function declare(inventory) {
82
+ const config = getConfig();
83
+ const apiKey = getApiKey();
84
+ const landed = await declareMany(inventory, { config, apiKey, serviceName: _explicitServiceName });
85
+ return Array.isArray(inventory) ? landed : landed[0];
86
+ }
75
87
  /** Reset SDK state — for testing only. */
76
88
  export function _resetForTesting() {
77
89
  _config = null;
78
90
  _apiKey = null;
91
+ _explicitServiceName = undefined;
79
92
  }
80
93
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAGxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAqB,MAAM,aAAa,CAAC;AAG3D,OAAO,EACL,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,GACb,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,QAAQ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AAG,SAAS,EAAE,CAAC;IAC3B,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC,CAAC;IACnG,OAAO,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACvD,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,gBAAgB;IAC9B,OAAO,GAAG,IAAI,CAAC;IACf,OAAO,GAAG,IAAI,CAAC;IACf,oBAAoB,GAAG,SAAS,CAAC;AACnC,CAAC"}
@@ -1,15 +1,55 @@
1
1
  import type { CoalexConfig } from "./config.js";
2
- /** What an agent declares about itself. Note the absence of `governed` and `resolver`. */
2
+ /**
3
+ * The longest agent id the platform accepts on a declaration. The rule is the server's own: empty,
4
+ * surrounded by whitespace or longer than this is refused, and any character, `.` included, is
5
+ * allowed.
6
+ */
7
+ export declare const MAX_AGENT_ID = 128;
8
+ /**
9
+ * `register()`'s default service names, in both SDKs. They name the SDK, not an agent: every agent
10
+ * that left `serviceName` unset would declare itself as the same agent, so neither is ever an id.
11
+ */
12
+ export declare const DEFAULT_SERVICE_NAMES: ReadonlySet<string>;
13
+ /** Forget which deprecations were said. For tests; the registry is process-global. */
14
+ export declare function resetDeprecationWarnings(): void;
15
+ /** Why the platform would refuse `value` as an agent id, or undefined when it accepts it. */
16
+ export declare function agentIdProblem(value: string): string | undefined;
17
+ /**
18
+ * What an agent declares about itself. Note the absence of `governed` and `resolver`.
19
+ *
20
+ * An agent of a multi-agent system declares itself once per agent: the umbrella with the endpoint
21
+ * the Console talks to and its resume hook, and each child with `parent` and no endpoint, because a
22
+ * child is resumed through its nearest ancestor that has one.
23
+ *
24
+ * An id is checked before anything is sent, by the rule the platform applies: it must not be empty,
25
+ * start or end with whitespace, or be longer than 128 characters. Any character, `.` included, is
26
+ * allowed, and its shape means nothing: a parent is only ever `parent`.
27
+ */
3
28
  export interface AgentInventory {
4
- /** Where a turn is POSTed — the URL the Console will talk to. */
5
- endpoint: string;
29
+ /**
30
+ * The agent's id, the one key the platform files its traces, policy and health under. Omitted,
31
+ * it is the `agentId` of the active `coalexContext()`; outside one, `register()`'s `serviceName`
32
+ * when the caller passed one (deprecated, removed in @coalex-ai/sdk 3.0). The default service
33
+ * name is never an id: such a declaration is refused and logged.
34
+ */
35
+ agentId?: string;
36
+ /**
37
+ * The agent this one proposes as its parent. It governs nothing until the org confirms it in the
38
+ * dashboard; a re-declaration without it keeps the confirmed parent.
39
+ */
40
+ parent?: string;
41
+ /**
42
+ * Where a turn is POSTed — the URL the Console will talk to. Optional: a child agent that is only
43
+ * ever reached through its parent declares none, and the Console does not offer it for a session.
44
+ */
45
+ endpoint?: string;
6
46
  /** The names of the tools this agent exposes. Names only; governance is the org's call. */
7
47
  tools?: string[];
8
48
  /** Where a paused run is resumed, if the agent supports being paused. */
9
49
  resumeUrl?: string;
10
50
  /**
11
- * The agent's name on the platform. Defaults to `register()`'s `serviceName`, which is what its
12
- * traces are already attributed to — so the declared agent and the observed one are one row.
51
+ * @deprecated Use `agentId`; removed in @coalex-ai/sdk 3.0. It warns once and is sent as the
52
+ * agent id.
13
53
  */
14
54
  name?: string;
15
55
  /** The agent's title, shown on a new chat in the Console. */
@@ -22,13 +62,26 @@ export interface AgentInventory {
22
62
  */
23
63
  suggestedPrompts?: string[];
24
64
  }
65
+ interface DeclareTarget {
66
+ config: CoalexConfig;
67
+ apiKey: string;
68
+ /** The service name the caller passed to `register()`, or undefined when it took the default. */
69
+ serviceName?: string;
70
+ }
71
+ /** POST each declaration on its own, in order, so one refusal does not stop the others. */
72
+ export declare function declareMany(inventories: AgentInventory | AgentInventory[], target: DeclareTarget): Promise<boolean[]>;
25
73
  interface DeclareArgs {
26
74
  config: CoalexConfig;
27
75
  apiKey: string;
28
76
  defaultName: string;
29
77
  }
30
78
  /**
31
- * POST the declaration. Resolves to whether it landed; never rejects.
79
+ * POST one declaration with an explicit config and key. Resolves to whether it landed; never
80
+ * rejects.
81
+ *
82
+ * `declare()` does the same with what `register()` configured. `defaultName` is treated as an
83
+ * explicitly passed `serviceName`: the id when neither the declaration nor the active context names
84
+ * one (deprecated), and never a default service name.
32
85
  *
33
86
  * `register()` runs at application startup, so this must not be able to stop an agent from
34
87
  * starting. A governance registration failing is a reason to log loudly, not a reason for a
@@ -1 +1 @@
1
- {"version":3,"file":"inventory.d.ts","sourceRoot":"","sources":["../src/inventory.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAQhD,0FAA0F;AAC1F,MAAM,WAAW,cAAc;IAC7B,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,2FAA2F;IAC3F,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,UAAU,WAAW;IACnB,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,SAAS,EAAE,cAAc,EACzB,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,WAAW,GAC3C,OAAO,CAAC,OAAO,CAAC,CAoClB"}
1
+ {"version":3,"file":"inventory.d.ts","sourceRoot":"","sources":["../src/inventory.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAShD;;;;GAIG;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,EAAE,cAAc,EACzB,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,WAAW,GAC3C,OAAO,CAAC,OAAO,CAAC,CAElB"}
package/dist/inventory.js CHANGED
@@ -4,46 +4,128 @@
4
4
  // PUT it. That drifts the moment an agent moves or a new one is deployed. Here the agent declares
5
5
  // itself at startup instead.
6
6
  //
7
- // What it may declare is deliberately narrow: **where it lives, what tools it has, and how it
8
- // introduces itself**. It cannot
7
+ // What it may declare is deliberately narrow: **who it is, who it proposes as its parent, where it
8
+ // lives, what tools it has, and how it introduces itself**. It cannot
9
9
  // declare whether those tools are governed or who may approve them — that is the org's decision,
10
10
  // made in the dashboard, because an agent that governs itself is not governed at all. The
11
11
  // transformer enforces the same boundary and answers 422 to a policy field rather than dropping it.
12
+ import { currentAgentId } from "./context.js";
12
13
  import { VERSION } from "./version.js";
13
14
  import { sdkHeaders } from "./http.js";
14
15
  import { log } from "./logger.js";
15
16
  /** Long enough for a cold control plane, short enough not to hold up an agent's startup. */
16
17
  const TIMEOUT_MS = 5000;
17
18
  /**
18
- * POST the declaration. Resolves to whether it landed; never rejects.
19
- *
20
- * `register()` runs at application startup, so this must not be able to stop an agent from
21
- * starting. A governance registration failing is a reason to log loudly, not a reason for a
22
- * customer's agent to be down — the agent still traces, and the declaration retries on next boot.
19
+ * The longest agent id the platform accepts on a declaration. The rule is the server's own: empty,
20
+ * surrounded by whitespace or longer than this is refused, and any character, `.` included, is
21
+ * allowed.
23
22
  */
24
- export async function declareInventory(inventory, { config, apiKey, defaultName }) {
23
+ export const MAX_AGENT_ID = 128;
24
+ /**
25
+ * `register()`'s default service names, in both SDKs. They name the SDK, not an agent: every agent
26
+ * that left `serviceName` unset would declare itself as the same agent, so neither is ever an id.
27
+ */
28
+ export const DEFAULT_SERVICE_NAMES = new Set(["coalex-sdk-python", "coalex-sdk-typescript"]);
29
+ const NAME_DEPRECATION = "AgentInventory `name` is deprecated: pass `agentId` instead. " +
30
+ "`name` will be removed in @coalex-ai/sdk 3.0.";
31
+ const SERVICE_NAME_DEPRECATION = "the agent declaration took its agentId from register()'s serviceName. Pass `agentId` or " +
32
+ "declare inside coalexContext({ agentId }) instead: the serviceName fallback will be removed in " +
33
+ "@coalex-ai/sdk 3.0.";
34
+ /**
35
+ * Each deprecation is said once per process: a declaration runs at every boot, and an agent that
36
+ * declares several children would otherwise repeat the same line for each.
37
+ */
38
+ const warned = new Set();
39
+ function warnOnce(message) {
40
+ if (warned.has(message))
41
+ return;
42
+ warned.add(message);
43
+ log.warn(message);
44
+ }
45
+ /** Forget which deprecations were said. For tests; the registry is process-global. */
46
+ export function resetDeprecationWarnings() {
47
+ warned.clear();
48
+ }
49
+ /** Why the platform would refuse `value` as an agent id, or undefined when it accepts it. */
50
+ export function agentIdProblem(value) {
51
+ if (!value)
52
+ return "an agent id must not be empty";
53
+ if (value !== value.trim())
54
+ return `the agent id ${JSON.stringify(value)} must not start or end with whitespace`;
55
+ if (value.length > MAX_AGENT_ID)
56
+ return `an agent id must be at most ${MAX_AGENT_ID} characters`;
57
+ return undefined;
58
+ }
59
+ /** The id to declare, or why the declaration is refused before it is sent. */
60
+ function resolveAgentId(inventory, serviceName) {
61
+ let agentId = inventory.agentId;
62
+ if (inventory.name !== undefined) {
63
+ if (agentId !== undefined && agentId !== inventory.name) {
64
+ return { problem: "pass agentId or its deprecated alias name, not both" };
65
+ }
66
+ warnOnce(NAME_DEPRECATION);
67
+ agentId = inventory.name;
68
+ }
69
+ agentId ??= currentAgentId();
70
+ if (agentId === undefined) {
71
+ if (serviceName === undefined) {
72
+ return {
73
+ problem: "it names no agentId, no coalexContext() is active, and register() was given no " +
74
+ "serviceName: the default 'coalex-sdk-typescript' names the SDK, not an agent",
75
+ };
76
+ }
77
+ if (DEFAULT_SERVICE_NAMES.has(serviceName)) {
78
+ return {
79
+ problem: `it names no agentId, and the default service name '${serviceName}' names the SDK, not an agent`,
80
+ };
81
+ }
82
+ warnOnce(SERVICE_NAME_DEPRECATION);
83
+ agentId = serviceName;
84
+ }
85
+ const problem = agentIdProblem(agentId) ??
86
+ (inventory.parent === undefined
87
+ ? undefined
88
+ : (agentIdProblem(inventory.parent) ??
89
+ (inventory.parent === agentId ? "an agent cannot be its own parent" : undefined)));
90
+ return problem ? { problem } : { agentId };
91
+ }
92
+ function bodyOf(inventory, agentId) {
25
93
  const body = {
26
- name: inventory.name ?? defaultName,
27
- endpoint: inventory.endpoint,
94
+ agent_id: agentId,
28
95
  tools: inventory.tools ?? [],
29
96
  sdk: `coalex-typescript/${VERSION}`,
30
97
  };
98
+ // Only what was declared: the platform answers 422 to a key it does not know, and an absent
99
+ // `parent` keeps the parent the org confirmed.
100
+ if (inventory.endpoint !== undefined)
101
+ body.endpoint = inventory.endpoint;
102
+ if (inventory.parent !== undefined)
103
+ body.parent = inventory.parent;
31
104
  if (inventory.resumeUrl) {
32
105
  body.resume_hook = { kind: "checkpoint", url: inventory.resumeUrl };
33
106
  }
34
- // Only what was declared: a control plane that predates these fields answers 422 to an unknown
35
- // key, and that would refuse the whole declaration, endpoint and tools included.
36
107
  if (inventory.displayName !== undefined)
37
108
  body.display_name = inventory.displayName;
38
109
  if (inventory.description !== undefined)
39
110
  body.description = inventory.description;
40
111
  if (inventory.suggestedPrompts !== undefined)
41
112
  body.suggested_prompts = [...inventory.suggestedPrompts];
113
+ return body;
114
+ }
115
+ /** Check one declaration locally, then POST it. Resolves to whether it landed; never rejects. */
116
+ async function post(inventory, { config, apiKey, serviceName }) {
117
+ const { agentId, problem } = resolveAgentId(inventory, serviceName);
118
+ if (agentId === undefined) {
119
+ // Refused before any network call: the platform would refuse it too, or file it under the
120
+ // wrong agent. Logged with the reason, so the agent is not left believing it registered.
121
+ log.warn(`agent self-declaration refused: ${problem}; nothing was sent`);
122
+ return false;
123
+ }
42
124
  try {
43
125
  const res = await fetch(`${config.endpoint}/api/v1/agent-inventory`, {
44
126
  method: "POST",
45
127
  headers: sdkHeaders(apiKey, { "Content-Type": "application/json" }),
46
- body: JSON.stringify(body),
128
+ body: JSON.stringify(bodyOf(inventory, agentId)),
47
129
  signal: AbortSignal.timeout(TIMEOUT_MS),
48
130
  });
49
131
  if (!res.ok) {
@@ -51,7 +133,7 @@ export async function declareInventory(inventory, { config, apiKey, defaultName
51
133
  // with the server's reason — silence would leave the agent believing it registered, which
52
134
  // is the failure mode this whole change exists to remove.
53
135
  const detail = await res.text().catch(() => "");
54
- log.warn(`agent self-declaration rejected (HTTP ${res.status}): ${detail.slice(0, 500)}`);
136
+ log.warn(`agent self-declaration of ${JSON.stringify(agentId)} rejected (HTTP ${res.status}): ${detail.slice(0, 500)}`);
55
137
  return false;
56
138
  }
57
139
  }
@@ -61,4 +143,27 @@ export async function declareInventory(inventory, { config, apiKey, defaultName
61
143
  }
62
144
  return true;
63
145
  }
146
+ /** POST each declaration on its own, in order, so one refusal does not stop the others. */
147
+ export async function declareMany(inventories, target) {
148
+ const items = Array.isArray(inventories) ? inventories : [inventories];
149
+ const landed = [];
150
+ for (const item of items)
151
+ landed.push(await post(item, target));
152
+ return landed;
153
+ }
154
+ /**
155
+ * POST one declaration with an explicit config and key. Resolves to whether it landed; never
156
+ * rejects.
157
+ *
158
+ * `declare()` does the same with what `register()` configured. `defaultName` is treated as an
159
+ * explicitly passed `serviceName`: the id when neither the declaration nor the active context names
160
+ * one (deprecated), and never a default service name.
161
+ *
162
+ * `register()` runs at application startup, so this must not be able to stop an agent from
163
+ * starting. A governance registration failing is a reason to log loudly, not a reason for a
164
+ * customer's agent to be down — the agent still traces, and the declaration retries on next boot.
165
+ */
166
+ export async function declareInventory(inventory, { config, apiKey, defaultName }) {
167
+ return post(inventory, { config, apiKey, serviceName: defaultName });
168
+ }
64
169
  //# sourceMappingURL=inventory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"inventory.js","sourceRoot":"","sources":["../src/inventory.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,gGAAgG;AAChG,kGAAkG;AAClG,6BAA6B;AAC7B,EAA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ACpC,SAAyB,EACzB,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAe;IAE5C,OAAO,IAAI,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC;AACvE,CAAC"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.3.0";
1
+ export declare const VERSION = "2.4.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // SDK version, sent in the X-SDK-Version header so the platform can see which
2
2
  // SDK releases customers run before removing a deprecated field (COA-261).
3
3
  // Keep in sync with package.json "version".
4
- export const VERSION = "2.3.0";
4
+ export const VERSION = "2.4.0";
5
5
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coalex-ai/sdk",
3
- "version": "2.3.0-beta.686",
3
+ "version": "2.4.0-beta.689",
4
4
  "description": "Coalex TypeScript SDK for AI governance observability",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {