@moldea.ai/adapter-claude-agent-sdk 2.0.1 → 3.0.1

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
@@ -8,10 +8,10 @@ The package implements the official `claude-agent-sdk` runtime adapter for `@mol
8
8
 
9
9
  ## Supported target
10
10
 
11
- Version `2.0.1` supports:
11
+ Version `3.0.1` supports:
12
12
 
13
13
  - Repository Format version `1`
14
- - `@moldea.ai/core ^3.0.0`
14
+ - `@moldea.ai/core ^4.0.0`
15
15
  - TypeScript ESM source
16
16
  - npm `@anthropic-ai/claude-agent-sdk >=0.3.234`
17
17
  - directly exported functions containing direct `query({ ... })` calls
@@ -88,3 +88,12 @@ pnpm --filter @moldea.ai/adapter-claude-agent-sdk build
88
88
  ```
89
89
 
90
90
  Unit and integration tests are colocated with their implementation modules. Adapter-specific conformance fixtures live under `/fixtures/adapter-claude-agent-sdk`.
91
+
92
+ ## Documentation
93
+
94
+ These guides are included in the installed package. Open only the page relevant to your task.
95
+
96
+ - [Package overview](docs/index.md)
97
+ - [Verified target](docs/verified-target.md)
98
+ - [Evidence and diagnostics](docs/evidence-and-diagnostics.md)
99
+ - [Limitations](docs/limitations.md)
@@ -0,0 +1,27 @@
1
+ ---
2
+ title: Evidence and diagnostics
3
+ description: Emitted evidence, stable diagnostics, availability, and all-or-nothing Core integration.
4
+ order: 20
5
+ ---
6
+
7
+ # Evidence and diagnostics
8
+
9
+ ## Evidence
10
+
11
+ The target may emit `runtime-package`, `language`, `runtime-pattern`, `agent-definition`, `instruction-loader`, `schema`, `tool-registration`, and `handoff-registration` evidence.
12
+
13
+ `runtime-pattern` identifies a direct query wrapper. `agent-definition` identifies a supported immutable programmatic definition. `handoff-registration` requires an active query context whose built-in `Agent` tool is available. `tool-registration` requires a canonical server key, an exact fully qualified runtime name, and available query or subagent tool state.
14
+
15
+ Evidence contains no repository content, prompts, descriptions, credentials, API keys, tool arguments, provider payloads, MCP results, session transcripts, or model responses. Missing local evidence is not itself a diagnostic.
16
+
17
+ ## Diagnostic catalog
18
+
19
+ The package owns the stable codes documented in its package README. They cover invalid package or source state, missing bound symbols, unwired instruction/schema/tool relationships, unsupported MCP server keys, tool-name mismatches, ambiguous subagent targets, and missing or mismatched routing descriptions.
20
+
21
+ Diagnostics use Core's shared adapter shape, preserve logical source locations, and remain deterministically ordered. Dynamic or indirect patterns yield partial or no evidence rather than guessed failures. Core validates adapter output and applies all-or-nothing inspection semantics.
22
+
23
+ `CLAUDE_AGENT_SDK_TOOL_NAME_MISMATCH` and `CLAUDE_AGENT_SDK_TOOL_REGISTRATION_NOT_WIRED` are mutually exclusive for one closed registration analysis: an exact tool mounted only under the wrong runtime name produces the mismatch, while complete absence produces not wired.
24
+
25
+ ## Package detection
26
+
27
+ Detection stops at the nearest existing `package.json` owning each runtime-agent source. Supported dependency fields are considered collectively. A collectively disjoint range produces the unsupported-version diagnostic without package evidence; an ambiguous range remains evidence rather than being promoted to verified support. Invalid UTF-8 or NUL in the owning manifest produces only `CLAUDE_AGENT_SDK_PACKAGE_MANIFEST_INVALID`; source text failures remain source diagnostics.
package/docs/index.md ADDED
@@ -0,0 +1,29 @@
1
+ ---
2
+ title: Claude Agent SDK runtime adapter
3
+ navigationTitle: Overview
4
+ description: Deterministic evidence and diagnostics for the verified Claude Agent SDK TypeScript target.
5
+ order: 0
6
+ ---
7
+
8
+ # Claude Agent SDK runtime adapter
9
+
10
+ `@moldea.ai/adapter-claude-agent-sdk` implements the official `claude-agent-sdk` runtime adapter for Core. It statically inspects explicitly bound TypeScript source through Core's source-neutral repository reader and produces deterministic evidence and diagnostics for query wrappers, programmatic subagents, structured output, SDK MCP tools, and routing descriptions.
11
+
12
+ ```typescript
13
+ import { claudeAgentSdkAdapter } from '@moldea.ai/adapter-claude-agent-sdk';
14
+ import { createCore } from '@moldea.ai/core';
15
+
16
+ const core = createCore({ adapters: [claudeAgentSdkAdapter] });
17
+ ```
18
+
19
+ The local CLI registers the adapter automatically. Applications composing Core directly register the immutable singleton explicitly.
20
+
21
+ ## Current state
22
+
23
+ The package is available. Its technical target covers TypeScript ESM using npm `@anthropic-ai/claude-agent-sdk >=0.3.234`, Repository Format version `1`, and compatible Core `^4.0.0`.
24
+
25
+ The adapter never imports or calls the SDK, requires no API key, executes no repository code, and makes no network request. It proves supported static relationships; it does not verify credentials, settings, provider behavior, model availability, permission decisions, actual delegation, tool execution, or schema semantics.
26
+
27
+ ## Public surface
28
+
29
+ The package exports only `claudeAgentSdkAdapter`. It has no default export, configuration factory, SDK facade, parser export, public diagnostic registry, or mutable runtime state. The generated [API reference](https://packages.moldea.ai/adapters/claude-agent-sdk/api/) derives that surface from the package export.
@@ -0,0 +1,27 @@
1
+ ---
2
+ title: Boundaries and limitations
3
+ description: Unsupported SDK surfaces, source forms, dynamic behavior, and the adapter security boundary.
4
+ order: 30
5
+ ---
6
+
7
+ # Boundaries and limitations
8
+
9
+ The current verified target does not claim support for:
10
+
11
+ - JavaScript, Python, CommonJS, or source outside the verified TypeScript ESM boundary
12
+ - indirect query wrappers, query input variables, nested callback calls, or unstable session APIs
13
+ - filesystem-defined agents, built-in agents, observer agents, or dynamically assembled definitions
14
+ - query main-thread `agent` selection or `toolAliases` interpretation
15
+ - string-array system prompts, CLAUDE.md, settings, hooks, plugins, skills, or prompt transformations
16
+ - programmatic-subagent output schemas or manifest tool output schemas
17
+ - per-agent MCP server configuration
18
+ - external stdio, SSE, HTTP, remote, proxy, plugin, provider-hosted, or built-in tools
19
+ - SDK server instructions as canonical moldea instruction-loader content
20
+ - arbitrary compiler resolution, `tsconfig` path aliases, directory indexes, package exports, or re-export graphs
21
+ - runtime-generated strings, SDK key normalization, schema-content validation, permission evaluation, or provider behavior
22
+
23
+ Package detection uses nearest manifests, not lockfiles or installed `node_modules`. Static dependency ranges are observations; the adapter does not prove which package build executes at runtime.
24
+
25
+ Each invocation sees one declared agent, exact same-runtime binding resolution, and only the bounded operations Core supplies through `IRuntimeAdapterRepository`. It receives no complete agent collection, project body index, host path, Anthropic credential, environment variable, network client, or runtime process. It does not execute TypeScript, dynamically import source, load the inspected SDK, or follow source symlinks.
26
+
27
+ The [Runtime Compatibility Matrix](https://packages.moldea.ai/compatibility/) remains authoritative. A focused specification or future design does not broaden this page until the canonical matrix and released implementation do.
@@ -0,0 +1,42 @@
1
+ ---
2
+ title: Verified target
3
+ description: Exact query, subagent, instruction, schema, MCP tool, availability, and routing support.
4
+ order: 10
5
+ ---
6
+
7
+ # Verified target
8
+
9
+ The canonical Runtime Compatibility Matrix defines the technical target `typescript-query-subagents-0-3`.
10
+
11
+ ## Supported boundary
12
+
13
+ - TypeScript ESM `.ts`, `.tsx`, and `.mts` files
14
+ - a nearest owning package manifest declaring npm `@anthropic-ai/claude-agent-sdk >=0.3.234`
15
+ - named value imports from the package root, including aliases
16
+ - directly exported function declarations, arrow functions, or function expressions containing direct `query(...)` calls in their own lexical body
17
+ - directly exported immutable object-literal programmatic `AgentDefinition` values
18
+ - direct or awaited instruction-loader calls through query `systemPrompt`, `claude_code` preset `append`, and subagent `prompt`
19
+ - query JSON Schema output through the exact `outputFormat` shape
20
+ - directly exported positional `tool(...)` declarations with direct implementation and input-schema bindings
21
+ - module-local `createSdkMcpServer(...)` declarations with closed tool arrays
22
+ - closed query `agents` and `mcpServers` maps
23
+ - query and subagent tool availability using closed `tools` and `disallowedTools` arrays
24
+ - active subagent delegation only when query-configured `Agent` availability is proved available
25
+ - exact target mapping by source path and exported symbol
26
+ - exact `AgentDefinition.description` comparison with the target's effective handoff description
27
+
28
+ Bindings must remain lexically visible at each matched use. Supported relative named imports resolve an exact TypeScript path, `.js` to `.ts` or `.tsx`, and `.mjs` to `.mts`. Re-exports, directory indexes, path aliases, CommonJS, and package-export resolution are outside the target.
29
+
30
+ ## Relationship closure
31
+
32
+ Query inputs, query options, programmatic definitions, SDK MCP servers, and tool definitions are analyzed independently by relationship. Computed or duplicate relationship properties, object spreads, unsupported values, and observable mutation leave only affected relationships unresolved.
33
+
34
+ Positive evidence is existential across supported query calls. Negative wiring diagnostics require every relevant candidate to be closed and contradictory, with no dynamic or availability-unresolved context that could establish the relationship.
35
+
36
+ ## Availability
37
+
38
+ The built-in `Agent` tool and SDK MCP tools use `available`, `unavailable`, and `unresolved` states. `allowedTools` does not establish or restore availability. Supported `disallowedTools` entries use exact complete-name matching with `*` as the only wildcard. Query `agent` and `toolAliases` fields make otherwise available delegation and tool relationships unresolved; they cannot restore an already unavailable tool.
39
+
40
+ ## Static strings
41
+
42
+ Routing descriptions, map keys, tool names, server names and versions, and tool-list entries support literals, no-substitution templates, immutable module-local constants, and directly imported immutable string constants. Values are compiler-parsed and are never trimmed, case-folded, or Unicode-normalized.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moldea.ai/adapter-claude-agent-sdk",
3
- "version": "2.0.1",
3
+ "version": "3.0.1",
4
4
  "description": "Deterministic runtime evidence and diagnostics for Claude Agent SDK query and subagent integrations.",
5
5
  "homepage": "https://github.com/moldea-ai/packages/tree/main/projects/adapter-claude-agent-sdk#readme",
6
6
  "bugs": {
@@ -18,6 +18,7 @@
18
18
  "files": [
19
19
  "cover.png",
20
20
  "dist",
21
+ "docs",
21
22
  "LICENSE",
22
23
  "README.md"
23
24
  ],
@@ -33,7 +34,7 @@
33
34
  "node": ">=22.11.0"
34
35
  },
35
36
  "dependencies": {
36
- "@moldea.ai/core": "^3.0.0",
37
+ "@moldea.ai/core": "^4.0.0",
37
38
  "@moldea.ai/repository": "^2.0.0",
38
39
  "semver": "7.8.5",
39
40
  "typescript": "6.0.3"