omk-adaptorch-wpl 1.2.0 → 1.2.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## [Unreleased]
4
+
5
+ ## [1.2.3] - 2026-09-23
6
+
7
+ ### Changed
8
+
9
+ - Lockstep version alignment with the OMK packages. This cycle's changes live in `open-multi-agent-kit`.
10
+
11
+ ## [1.2.2] - 2026-09-23
12
+
13
+ ### Changed
14
+
15
+ - Lockstep version alignment with the OMK packages. This cycle's changes live in `open-multi-agent-kit`.
16
+
17
+ ## [1.2.1] - 2026-09-23
18
+
19
+ ### Fixed
20
+
21
+ - `routeTopology` reads the DAG from the tool's top-level `subtasks`/`dependencies` arguments, so an MCP caller that passes them at the top level is honored instead of failing to see a DAG.
22
+
3
23
  ## [1.2.0] - 2026-09-20
4
24
 
5
25
  ## [1.0.0] - 2026-09-18
package/README.md CHANGED
@@ -20,7 +20,7 @@ published package. Current source and tests override that record:
20
20
 
21
21
  - `src/types.ts` — Work Packet, Dispatch Record, state enums (as string literal unions), on-disk schema types
22
22
  - `src/state-machine.ts` — the packet lifecycle state machine and transition guards
23
- - `src/adaptorch-client.ts` — thin typed wrapper around AdaptOrch's 10 MCP tools
23
+ - `src/adaptorch-client.ts` — thin typed wrapper around AdaptOrch's 11 MCP tools
24
24
  - `src/adjudicator.ts` + `src/adjudicator-registry.ts` — the Outcome Adjudicator and its per-`kind` registry
25
25
  - `src/loop.ts` — adjudication timeout, verdict projection, and next-transition helpers; not an end-to-end dispatcher
26
26
  - `src/b2c-mapper.ts` — B2C (Bridge-to-Code) mapping for patch-apply safety
@@ -9,9 +9,9 @@
9
9
  * Tool surface, names, and read/write classification are derived from the
10
10
  * server's own inventory: `diagnostics.py::EXPECTED_CORE_TOOLS` and
11
11
  * `_FULL_ONLY_TOOLS`, cross-checked against `hardening.py::REMOTE_TOOL_NAMES`
12
- * and the `output_schema.py` projector table. The surface is tiered: nine core
13
- * tools every deployment exposes, plus two that exist only in a full or local
14
- * deployment. No "benchmark" or "verification" tools exist in it.
12
+ * and the `output_schema.py` projector table. The engine declares eleven
13
+ * tools. A hardened remote profile exposes nine; trace and topology reads
14
+ * stay full or local. No "benchmark" or "verification" tools exist in it.
15
15
  */
16
16
  import { type TopologyClassification } from "./types.ts";
17
17
  /**
@@ -39,9 +39,9 @@ export interface AdaptOrchUsage {
39
39
  /**
40
40
  * Abstract transport for invoking AdaptOrch MCP tools by name.
41
41
  *
42
- * See doc section "The real, current 10-tool MCP surface (grouped)". No
43
- * concrete implementation ships with this package yet; a caller must
44
- * provide one (e.g. wrapping an MCP SDK client's `callTool`).
42
+ * The engine declares eleven tools. No concrete transport ships with this
43
+ * package yet; a caller must provide one (e.g. wrapping an MCP SDK client's
44
+ * `callTool`).
45
45
  */
46
46
  export interface AdaptOrchTransport {
47
47
  callTool(name: string, args: Record<string, unknown>): Promise<unknown>;
@@ -140,13 +140,11 @@ export interface AdaptOrchRouteTopologyResult {
140
140
  raw: unknown;
141
141
  }
142
142
  /**
143
- * Typed wrapper around the 10 real AdaptOrch MCP tools.
143
+ * Typed wrapper around the eleven AdaptOrch MCP tools the engine declares.
144
144
  *
145
- * See doc section "The real, current 10-tool MCP surface (grouped)" for
146
- * the full tool list, purposes, and read/write classification. This
147
- * class only translates method calls into `transport.callTool` calls
148
- * with the exact tool names the doc lists; it does not implement a
149
- * transport itself.
145
+ * This class only translates method calls into `transport.callTool` calls
146
+ * with those tool names. It does not implement a transport, and it does not
147
+ * decide whether a remote profile hides the two full-only tools.
150
148
  */
151
149
  export declare class AdaptOrchClient {
152
150
  private readonly transport;
@@ -180,8 +178,12 @@ export declare class AdaptOrchClient {
180
178
  * `run_id`.
181
179
  */
182
180
  getTraces(runId: string): Promise<AdaptOrchTraceSpan[]>;
183
- /** Route a DAG locally and fail closed if the MCP response drifts from the current topology contract. */
184
- routeTopology(payloadShape: unknown): Promise<AdaptOrchRouteTopologyResult>;
181
+ /**
182
+ * Route a DAG locally and fail closed if the MCP response drifts from the
183
+ * current topology contract. The engine schema takes `subtasks` and optional
184
+ * `dependencies` at the top level; wrapping them rejects the call.
185
+ */
186
+ routeTopology(payload: Record<string, unknown>): Promise<AdaptOrchRouteTopologyResult>;
185
187
  /**
186
188
  * `adaptorch_server_metrics` (read/local). Read redacted MCP server
187
189
  * metrics (tool-call counters, latency percentiles).
@@ -1 +1 @@
1
- {"version":3,"file":"adaptorch-client.d.ts","sourceRoot":"","sources":["../src/adaptorch-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAA4B,KAAK,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAMnF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,8NAUzB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,yBAAyB,+DAAgE,CAAC;AAEvG,kDAAkD;AAClD,eAAO,MAAM,eAAe,kRAAqE,CAAC;AAElG,yFAAyF;AACzF,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACxE;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;I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AAC;CACb;AAED;;;;;;;;GAQG;AACH,qBAAa,eAAe;IAC3B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqB;IAE/C,YAAY,SAAS,EAAE,kBAAkB,EAExC;IAED;;;OAGG;IACG,GAAG,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAKnE;IAED;;OAEG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAExD;IAED;;OAEG;IACG,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAE5E;IAED;;;OAGG;IACG,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAE7D;IAED;;OAEG;IACG,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAE9D;IAED;;;OAGG;IACG,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAE5D;IAED,yGAAyG;IACnG,aAAa,CAAC,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAOhF;IAED;;;OAGG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAEtD;IAED;;;OAGG;IACG,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAErD;IAED;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,cAAc,CAAC,CAErC;IAED;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAEpD;CACD","sourcesContent":["/**\n * AdaptOrch MCP client wrapper.\n *\n * Design-stage / experimental: this module has no production\n * `AdaptOrchTransport` implementation wired in yet. Callers must supply\n * their own transport (e.g. an adapter around an MCP SDK client) until one\n * ships in this package.\n *\n * Tool surface, names, and read/write classification are derived from the\n * server's own inventory: `diagnostics.py::EXPECTED_CORE_TOOLS` and\n * `_FULL_ONLY_TOOLS`, cross-checked against `hardening.py::REMOTE_TOOL_NAMES`\n * and the `output_schema.py` projector table. The surface is tiered: nine core\n * tools every deployment exposes, plus two that exist only in a full or local\n * deployment. No \"benchmark\" or \"verification\" tools exist in it.\n */\n\nimport { isTopologyClassification, type TopologyClassification } from \"./types.ts\";\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/**\n * Tools every AdaptOrch deployment exposes, including a remote tenant.\n * Mirrors `diagnostics.py::EXPECTED_CORE_TOOLS` in server order.\n */\nexport const ADAPTORCH_REMOTE_TOOLS = [\n\t\"adaptorch_run\",\n\t\"adaptorch_get_run\",\n\t\"adaptorch_get_artifacts\",\n\t\"adaptorch_list_runs\",\n\t\"adaptorch_cancel_run\",\n\t\"adaptorch_server_metrics\",\n\t\"adaptorch_capabilities\",\n\t\"adaptorch_usage\",\n\t\"adaptorch_plan_catalog\",\n] as const;\n\n/**\n * Tools a remote tenant cannot reach. Trace and topology reads need a full or\n * local deployment, so a caller must not advertise them unconditionally.\n */\nexport const ADAPTORCH_FULL_ONLY_TOOLS = [\"adaptorch_get_traces\", \"adaptorch_route_topology\"] as const;\n\n/** The complete tool surface, core tier first. */\nexport const ADAPTORCH_TOOLS = [...ADAPTORCH_REMOTE_TOOLS, ...ADAPTORCH_FULL_ONLY_TOOLS] as const;\n\n/** One tenant's own usage window, as projected by `output_schema.py::_project_usage`. */\nexport interface AdaptOrchUsage {\n\treadonly used: number;\n\treadonly limit: number;\n\treadonly tenant_id?: string;\n\treadonly plan_level?: string;\n\treadonly period?: string;\n\treadonly remaining?: number;\n\treadonly usage_percentage?: number;\n}\n\n/**\n * Abstract transport for invoking AdaptOrch MCP tools by name.\n *\n * See doc section \"The real, current 10-tool MCP surface (grouped)\". No\n * concrete implementation ships with this package yet; a caller must\n * provide one (e.g. wrapping an MCP SDK client's `callTool`).\n */\nexport interface AdaptOrchTransport {\n\tcallTool(name: string, args: Record<string, unknown>): Promise<unknown>;\n}\n\n/**\n * Payload accepted by `adaptorch_run`.\n *\n * See doc section \"Run / lifecycle (submit, inspect, list, cancel)\":\n * `adaptorch_run` submits a task payload (prompt/context/raw payload,\n * connector, synthesis mode, budget policy) to the control-plane, and can\n * optionally block until the run reaches a terminal status.\n */\nexport interface AdaptOrchRunPayload {\n\ttaskPayload: unknown;\n\tconnector?: string;\n\tsynthesisMode?: string;\n\tbudgetPolicy?: unknown;\n\twaitForTerminal?: boolean;\n\ttimeoutSeconds?: number;\n\tpollIntervalSeconds?: number;\n}\n\n/**\n * Result of `adaptorch_run`.\n *\n * Shape is inferred from the doc's description of the tool's purpose, not\n * guaranteed by an official schema.\n */\nexport interface AdaptOrchRunResult {\n\trun_id: string;\n\tstatus?: string;\n}\n\n/**\n * Result of `adaptorch_get_run`.\n *\n * Shape is inferred from the doc's description (\"fetch a run summary by\n * run_id\"), not guaranteed by an official schema; extra fields are\n * expected to vary by connector/synthesis mode.\n */\nexport interface AdaptOrchRunSummary {\n\trun_id: string;\n\tstatus: string;\n\t[key: string]: unknown;\n}\n\n/**\n * Entry in the result of `adaptorch_list_runs`.\n *\n * Shape is inferred, not guaranteed by an official schema.\n */\nexport interface AdaptOrchRunListEntry {\n\trun_id: string;\n\tstatus: string;\n}\n\n/**\n * Result of `adaptorch_cancel_run`.\n *\n * Shape is inferred from the doc's description (\"request cancellation of\n * an in-flight run by run_id\"), not guaranteed by an official schema.\n */\nexport interface AdaptOrchCancelResult {\n\trun_id: string;\n\tcancelled: boolean;\n}\n\n/**\n * Entry in the result of `adaptorch_get_artifacts`.\n *\n * Shape is inferred from the doc's description (\"fetch artifact metadata\n * for a run\"), not guaranteed by an official schema.\n */\nexport interface AdaptOrchArtifact {\n\tpath: string;\n\tsize_bytes?: number;\n\tcreated_at?: string;\n\t[key: string]: unknown;\n}\n\n/**\n * Entry in the result of `adaptorch_get_traces`.\n *\n * Shape is inferred from the doc's description (\"fetch execution traces\n * for a run by run_id\"), not guaranteed by an official schema.\n */\nexport interface AdaptOrchTraceSpan {\n\tspan_id?: string;\n\tkind?: string;\n\tseverity?: string;\n\t[key: string]: unknown;\n}\n\n/**\n * Result of `adaptorch_route_topology`.\n *\n * `classification` is the validated value from the current response's\n * `topology` field; `raw` retains the transport response for callers that\n * need the accompanying reason, stages, or features.\n */\nexport interface AdaptOrchRouteTopologyResult {\n\tclassification: TopologyClassification;\n\traw: unknown;\n}\n\n/**\n * Typed wrapper around the 10 real AdaptOrch MCP tools.\n *\n * See doc section \"The real, current 10-tool MCP surface (grouped)\" for\n * the full tool list, purposes, and read/write classification. This\n * class only translates method calls into `transport.callTool` calls\n * with the exact tool names the doc lists; it does not implement a\n * transport itself.\n */\nexport class AdaptOrchClient {\n\tprivate readonly transport: AdaptOrchTransport;\n\n\tconstructor(transport: AdaptOrchTransport) {\n\t\tthis.transport = transport;\n\t}\n\n\t/**\n\t * `adaptorch_run` (write). Submit a task payload to the control-plane,\n\t * optionally blocking until the run reaches a terminal status.\n\t */\n\tasync run(payload: AdaptOrchRunPayload): Promise<AdaptOrchRunResult> {\n\t\t// The transport result shape is not schema-validated here; callers\n\t\t// relying on strict correctness should validate at the transport\n\t\t// boundary.\n\t\treturn (await this.transport.callTool(\"adaptorch_run\", { ...payload })) as AdaptOrchRunResult;\n\t}\n\n\t/**\n\t * `adaptorch_get_run` (read). Fetch a run summary by `run_id`.\n\t */\n\tasync getRun(runId: string): Promise<AdaptOrchRunSummary> {\n\t\treturn (await this.transport.callTool(\"adaptorch_get_run\", { run_id: runId })) as AdaptOrchRunSummary;\n\t}\n\n\t/**\n\t * `adaptorch_list_runs` (read). List recent control-plane runs.\n\t */\n\tasync listRuns(params?: { limit?: number }): Promise<AdaptOrchRunListEntry[]> {\n\t\treturn (await this.transport.callTool(\"adaptorch_list_runs\", { ...params })) as AdaptOrchRunListEntry[];\n\t}\n\n\t/**\n\t * `adaptorch_cancel_run` (write). Request cancellation of an in-flight\n\t * run by `run_id`.\n\t */\n\tasync cancelRun(runId: string): Promise<AdaptOrchCancelResult> {\n\t\treturn (await this.transport.callTool(\"adaptorch_cancel_run\", { run_id: runId })) as AdaptOrchCancelResult;\n\t}\n\n\t/**\n\t * `adaptorch_get_artifacts` (read). Fetch artifact metadata for a run.\n\t */\n\tasync getArtifacts(runId: string): Promise<AdaptOrchArtifact[]> {\n\t\treturn (await this.transport.callTool(\"adaptorch_get_artifacts\", { run_id: runId })) as AdaptOrchArtifact[];\n\t}\n\n\t/**\n\t * `adaptorch_get_traces` (read). Fetch execution traces for a run by\n\t * `run_id`.\n\t */\n\tasync getTraces(runId: string): Promise<AdaptOrchTraceSpan[]> {\n\t\treturn (await this.transport.callTool(\"adaptorch_get_traces\", { run_id: runId })) as AdaptOrchTraceSpan[];\n\t}\n\n\t/** Route a DAG locally and fail closed if the MCP response drifts from the current topology contract. */\n\tasync routeTopology(payloadShape: unknown): Promise<AdaptOrchRouteTopologyResult> {\n\t\tconst raw = await this.transport.callTool(\"adaptorch_route_topology\", { payload_shape: payloadShape });\n\t\tconst topology = isRecord(raw) ? raw.topology : undefined;\n\t\tif (!isTopologyClassification(topology)) {\n\t\t\tthrow new Error(\"AdaptOrch route response has invalid topology\");\n\t\t}\n\t\treturn { classification: topology, raw };\n\t}\n\n\t/**\n\t * `adaptorch_server_metrics` (read/local). Read redacted MCP server\n\t * metrics (tool-call counters, latency percentiles).\n\t */\n\tasync serverMetrics(): Promise<Record<string, unknown>> {\n\t\treturn (await this.transport.callTool(\"adaptorch_server_metrics\", {})) as Record<string, unknown>;\n\t}\n\n\t/**\n\t * `adaptorch_capabilities` (read/local). Read supported synthesis\n\t * modes, connectors, and server features.\n\t */\n\tasync capabilities(): Promise<Record<string, unknown>> {\n\t\treturn (await this.transport.callTool(\"adaptorch_capabilities\", {})) as Record<string, unknown>;\n\t}\n\n\t/**\n\t * `adaptorch_usage` (read). Read this tenant's own usage window. The\n\t * control plane scopes the response by key, so a caller never sees another\n\t * tenant's counters.\n\t */\n\tasync usage(): Promise<AdaptOrchUsage> {\n\t\treturn (await this.transport.callTool(\"adaptorch_usage\", {})) as AdaptOrchUsage;\n\t}\n\n\t/**\n\t * `adaptorch_plan_catalog` (read/local). Read the hosted plan catalog.\n\t * Tier names and prices come from the server, never from this client.\n\t */\n\tasync planCatalog(): Promise<Record<string, unknown>> {\n\t\treturn (await this.transport.callTool(\"adaptorch_plan_catalog\", {})) as Record<string, unknown>;\n\t}\n}\n"]}
1
+ {"version":3,"file":"adaptorch-client.d.ts","sourceRoot":"","sources":["../src/adaptorch-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAA4B,KAAK,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAMnF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,8NAUzB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,yBAAyB,+DAAgE,CAAC;AAEvG,kDAAkD;AAClD,eAAO,MAAM,eAAe,kRAAqE,CAAC;AAElG,yFAAyF;AACzF,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,C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AC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAEpD;CACD","sourcesContent":["/**\n * AdaptOrch MCP client wrapper.\n *\n * Design-stage / experimental: this module has no production\n * `AdaptOrchTransport` implementation wired in yet. Callers must supply\n * their own transport (e.g. an adapter around an MCP SDK client) until one\n * ships in this package.\n *\n * Tool surface, names, and read/write classification are derived from the\n * server's own inventory: `diagnostics.py::EXPECTED_CORE_TOOLS` and\n * `_FULL_ONLY_TOOLS`, cross-checked against `hardening.py::REMOTE_TOOL_NAMES`\n * and the `output_schema.py` projector table. The engine declares eleven\n * tools. A hardened remote profile exposes nine; trace and topology reads\n * stay full or local. No \"benchmark\" or \"verification\" tools exist in it.\n */\n\nimport { isTopologyClassification, type TopologyClassification } from \"./types.ts\";\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/**\n * Tools every AdaptOrch deployment exposes, including a remote tenant.\n * Mirrors `diagnostics.py::EXPECTED_CORE_TOOLS` in server order.\n */\nexport const ADAPTORCH_REMOTE_TOOLS = [\n\t\"adaptorch_run\",\n\t\"adaptorch_get_run\",\n\t\"adaptorch_get_artifacts\",\n\t\"adaptorch_list_runs\",\n\t\"adaptorch_cancel_run\",\n\t\"adaptorch_server_metrics\",\n\t\"adaptorch_capabilities\",\n\t\"adaptorch_usage\",\n\t\"adaptorch_plan_catalog\",\n] as const;\n\n/**\n * Tools a remote tenant cannot reach. Trace and topology reads need a full or\n * local deployment, so a caller must not advertise them unconditionally.\n */\nexport const ADAPTORCH_FULL_ONLY_TOOLS = [\"adaptorch_get_traces\", \"adaptorch_route_topology\"] as const;\n\n/** The complete tool surface, core tier first. */\nexport const ADAPTORCH_TOOLS = [...ADAPTORCH_REMOTE_TOOLS, ...ADAPTORCH_FULL_ONLY_TOOLS] as const;\n\n/** One tenant's own usage window, as projected by `output_schema.py::_project_usage`. */\nexport interface AdaptOrchUsage {\n\treadonly used: number;\n\treadonly limit: number;\n\treadonly tenant_id?: string;\n\treadonly plan_level?: string;\n\treadonly period?: string;\n\treadonly remaining?: number;\n\treadonly usage_percentage?: number;\n}\n\n/**\n * Abstract transport for invoking AdaptOrch MCP tools by name.\n *\n * The engine declares eleven tools. No concrete transport ships with this\n * package yet; a caller must provide one (e.g. wrapping an MCP SDK client's\n * `callTool`).\n */\nexport interface AdaptOrchTransport {\n\tcallTool(name: string, args: Record<string, unknown>): Promise<unknown>;\n}\n\n/**\n * Payload accepted by `adaptorch_run`.\n *\n * See doc section \"Run / lifecycle (submit, inspect, list, cancel)\":\n * `adaptorch_run` submits a task payload (prompt/context/raw payload,\n * connector, synthesis mode, budget policy) to the control-plane, and can\n * optionally block until the run reaches a terminal status.\n */\nexport interface AdaptOrchRunPayload {\n\ttaskPayload: unknown;\n\tconnector?: string;\n\tsynthesisMode?: string;\n\tbudgetPolicy?: unknown;\n\twaitForTerminal?: boolean;\n\ttimeoutSeconds?: number;\n\tpollIntervalSeconds?: number;\n}\n\n/**\n * Result of `adaptorch_run`.\n *\n * Shape is inferred from the doc's description of the tool's purpose, not\n * guaranteed by an official schema.\n */\nexport interface AdaptOrchRunResult {\n\trun_id: string;\n\tstatus?: string;\n}\n\n/**\n * Result of `adaptorch_get_run`.\n *\n * Shape is inferred from the doc's description (\"fetch a run summary by\n * run_id\"), not guaranteed by an official schema; extra fields are\n * expected to vary by connector/synthesis mode.\n */\nexport interface AdaptOrchRunSummary {\n\trun_id: string;\n\tstatus: string;\n\t[key: string]: unknown;\n}\n\n/**\n * Entry in the result of `adaptorch_list_runs`.\n *\n * Shape is inferred, not guaranteed by an official schema.\n */\nexport interface AdaptOrchRunListEntry {\n\trun_id: string;\n\tstatus: string;\n}\n\n/**\n * Result of `adaptorch_cancel_run`.\n *\n * Shape is inferred from the doc's description (\"request cancellation of\n * an in-flight run by run_id\"), not guaranteed by an official schema.\n */\nexport interface AdaptOrchCancelResult {\n\trun_id: string;\n\tcancelled: boolean;\n}\n\n/**\n * Entry in the result of `adaptorch_get_artifacts`.\n *\n * Shape is inferred from the doc's description (\"fetch artifact metadata\n * for a run\"), not guaranteed by an official schema.\n */\nexport interface AdaptOrchArtifact {\n\tpath: string;\n\tsize_bytes?: number;\n\tcreated_at?: string;\n\t[key: string]: unknown;\n}\n\n/**\n * Entry in the result of `adaptorch_get_traces`.\n *\n * Shape is inferred from the doc's description (\"fetch execution traces\n * for a run by run_id\"), not guaranteed by an official schema.\n */\nexport interface AdaptOrchTraceSpan {\n\tspan_id?: string;\n\tkind?: string;\n\tseverity?: string;\n\t[key: string]: unknown;\n}\n\n/**\n * Result of `adaptorch_route_topology`.\n *\n * `classification` is the validated value from the current response's\n * `topology` field; `raw` retains the transport response for callers that\n * need the accompanying reason, stages, or features.\n */\nexport interface AdaptOrchRouteTopologyResult {\n\tclassification: TopologyClassification;\n\traw: unknown;\n}\n\n/**\n * Typed wrapper around the eleven AdaptOrch MCP tools the engine declares.\n *\n * This class only translates method calls into `transport.callTool` calls\n * with those tool names. It does not implement a transport, and it does not\n * decide whether a remote profile hides the two full-only tools.\n */\nexport class AdaptOrchClient {\n\tprivate readonly transport: AdaptOrchTransport;\n\n\tconstructor(transport: AdaptOrchTransport) {\n\t\tthis.transport = transport;\n\t}\n\n\t/**\n\t * `adaptorch_run` (write). Submit a task payload to the control-plane,\n\t * optionally blocking until the run reaches a terminal status.\n\t */\n\tasync run(payload: AdaptOrchRunPayload): Promise<AdaptOrchRunResult> {\n\t\t// The transport result shape is not schema-validated here; callers\n\t\t// relying on strict correctness should validate at the transport\n\t\t// boundary.\n\t\treturn (await this.transport.callTool(\"adaptorch_run\", { ...payload })) as AdaptOrchRunResult;\n\t}\n\n\t/**\n\t * `adaptorch_get_run` (read). Fetch a run summary by `run_id`.\n\t */\n\tasync getRun(runId: string): Promise<AdaptOrchRunSummary> {\n\t\treturn (await this.transport.callTool(\"adaptorch_get_run\", { run_id: runId })) as AdaptOrchRunSummary;\n\t}\n\n\t/**\n\t * `adaptorch_list_runs` (read). List recent control-plane runs.\n\t */\n\tasync listRuns(params?: { limit?: number }): Promise<AdaptOrchRunListEntry[]> {\n\t\treturn (await this.transport.callTool(\"adaptorch_list_runs\", { ...params })) as AdaptOrchRunListEntry[];\n\t}\n\n\t/**\n\t * `adaptorch_cancel_run` (write). Request cancellation of an in-flight\n\t * run by `run_id`.\n\t */\n\tasync cancelRun(runId: string): Promise<AdaptOrchCancelResult> {\n\t\treturn (await this.transport.callTool(\"adaptorch_cancel_run\", { run_id: runId })) as AdaptOrchCancelResult;\n\t}\n\n\t/**\n\t * `adaptorch_get_artifacts` (read). Fetch artifact metadata for a run.\n\t */\n\tasync getArtifacts(runId: string): Promise<AdaptOrchArtifact[]> {\n\t\treturn (await this.transport.callTool(\"adaptorch_get_artifacts\", { run_id: runId })) as AdaptOrchArtifact[];\n\t}\n\n\t/**\n\t * `adaptorch_get_traces` (read). Fetch execution traces for a run by\n\t * `run_id`.\n\t */\n\tasync getTraces(runId: string): Promise<AdaptOrchTraceSpan[]> {\n\t\treturn (await this.transport.callTool(\"adaptorch_get_traces\", { run_id: runId })) as AdaptOrchTraceSpan[];\n\t}\n\n\t/**\n\t * Route a DAG locally and fail closed if the MCP response drifts from the\n\t * current topology contract. The engine schema takes `subtasks` and optional\n\t * `dependencies` at the top level; wrapping them rejects the call.\n\t */\n\tasync routeTopology(payload: Record<string, unknown>): Promise<AdaptOrchRouteTopologyResult> {\n\t\tconst raw = await this.transport.callTool(\"adaptorch_route_topology\", payload);\n\t\tconst topology = isRecord(raw) ? raw.topology : undefined;\n\t\tif (!isTopologyClassification(topology)) {\n\t\t\tthrow new Error(\"AdaptOrch route response has invalid topology\");\n\t\t}\n\t\treturn { classification: topology, raw };\n\t}\n\n\t/**\n\t * `adaptorch_server_metrics` (read/local). Read redacted MCP server\n\t * metrics (tool-call counters, latency percentiles).\n\t */\n\tasync serverMetrics(): Promise<Record<string, unknown>> {\n\t\treturn (await this.transport.callTool(\"adaptorch_server_metrics\", {})) as Record<string, unknown>;\n\t}\n\n\t/**\n\t * `adaptorch_capabilities` (read/local). Read supported synthesis\n\t * modes, connectors, and server features.\n\t */\n\tasync capabilities(): Promise<Record<string, unknown>> {\n\t\treturn (await this.transport.callTool(\"adaptorch_capabilities\", {})) as Record<string, unknown>;\n\t}\n\n\t/**\n\t * `adaptorch_usage` (read). Read this tenant's own usage window. The\n\t * control plane scopes the response by key, so a caller never sees another\n\t * tenant's counters.\n\t */\n\tasync usage(): Promise<AdaptOrchUsage> {\n\t\treturn (await this.transport.callTool(\"adaptorch_usage\", {})) as AdaptOrchUsage;\n\t}\n\n\t/**\n\t * `adaptorch_plan_catalog` (read/local). Read the hosted plan catalog.\n\t * Tier names and prices come from the server, never from this client.\n\t */\n\tasync planCatalog(): Promise<Record<string, unknown>> {\n\t\treturn (await this.transport.callTool(\"adaptorch_plan_catalog\", {})) as Record<string, unknown>;\n\t}\n}\n"]}
@@ -9,9 +9,9 @@
9
9
  * Tool surface, names, and read/write classification are derived from the
10
10
  * server's own inventory: `diagnostics.py::EXPECTED_CORE_TOOLS` and
11
11
  * `_FULL_ONLY_TOOLS`, cross-checked against `hardening.py::REMOTE_TOOL_NAMES`
12
- * and the `output_schema.py` projector table. The surface is tiered: nine core
13
- * tools every deployment exposes, plus two that exist only in a full or local
14
- * deployment. No "benchmark" or "verification" tools exist in it.
12
+ * and the `output_schema.py` projector table. The engine declares eleven
13
+ * tools. A hardened remote profile exposes nine; trace and topology reads
14
+ * stay full or local. No "benchmark" or "verification" tools exist in it.
15
15
  */
16
16
  import { isTopologyClassification } from "./types.js";
17
17
  function isRecord(value) {
@@ -40,13 +40,11 @@ export const ADAPTORCH_FULL_ONLY_TOOLS = ["adaptorch_get_traces", "adaptorch_rou
40
40
  /** The complete tool surface, core tier first. */
41
41
  export const ADAPTORCH_TOOLS = [...ADAPTORCH_REMOTE_TOOLS, ...ADAPTORCH_FULL_ONLY_TOOLS];
42
42
  /**
43
- * Typed wrapper around the 10 real AdaptOrch MCP tools.
43
+ * Typed wrapper around the eleven AdaptOrch MCP tools the engine declares.
44
44
  *
45
- * See doc section "The real, current 10-tool MCP surface (grouped)" for
46
- * the full tool list, purposes, and read/write classification. This
47
- * class only translates method calls into `transport.callTool` calls
48
- * with the exact tool names the doc lists; it does not implement a
49
- * transport itself.
45
+ * This class only translates method calls into `transport.callTool` calls
46
+ * with those tool names. It does not implement a transport, and it does not
47
+ * decide whether a remote profile hides the two full-only tools.
50
48
  */
51
49
  export class AdaptOrchClient {
52
50
  transport;
@@ -95,9 +93,13 @@ export class AdaptOrchClient {
95
93
  async getTraces(runId) {
96
94
  return (await this.transport.callTool("adaptorch_get_traces", { run_id: runId }));
97
95
  }
98
- /** Route a DAG locally and fail closed if the MCP response drifts from the current topology contract. */
99
- async routeTopology(payloadShape) {
100
- const raw = await this.transport.callTool("adaptorch_route_topology", { payload_shape: payloadShape });
96
+ /**
97
+ * Route a DAG locally and fail closed if the MCP response drifts from the
98
+ * current topology contract. The engine schema takes `subtasks` and optional
99
+ * `dependencies` at the top level; wrapping them rejects the call.
100
+ */
101
+ async routeTopology(payload) {
102
+ const raw = await this.transport.callTool("adaptorch_route_topology", payload);
101
103
  const topology = isRecord(raw) ? raw.topology : undefined;
102
104
  if (!isTopologyClassification(topology)) {
103
105
  throw new Error("AdaptOrch route response has invalid topology");
@@ -1 +1 @@
1
- {"version":3,"file":"adaptorch-client.js","sourceRoot":"","sources":["../src/adaptorch-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,wBAAwB,EAA+B,MAAM,YAAY,CAAC;AAEnF,SAAS,QAAQ,CAAC,KAAc,EAAoC;IACnE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAAA,CAC5E;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC,eAAe;IACf,mBAAmB;IACnB,yB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,KAAK,CAAC,KAAK,GAA4B;QACtC,OAAO,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAmB,CAAC;IAAA,CAChF;IAED;;;OAGG;IACH,KAAK,CAAC,WAAW,GAAqC;QACrD,OAAO,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAA4B,CAAC;IAAA,CAChG;CACD","sourcesContent":["/**\n * AdaptOrch MCP client wrapper.\n *\n * Design-stage / experimental: this module has no production\n * `AdaptOrchTransport` implementation wired in yet. Callers must supply\n * their own transport (e.g. an adapter around an MCP SDK client) until one\n * ships in this package.\n *\n * Tool surface, names, and read/write classification are derived from the\n * server's own inventory: `diagnostics.py::EXPECTED_CORE_TOOLS` and\n * `_FULL_ONLY_TOOLS`, cross-checked against `hardening.py::REMOTE_TOOL_NAMES`\n * and the `output_schema.py` projector table. The surface is tiered: nine core\n * tools every deployment exposes, plus two that exist only in a full or local\n * deployment. No \"benchmark\" or \"verification\" tools exist in it.\n */\n\nimport { isTopologyClassification, type TopologyClassification } from \"./types.ts\";\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/**\n * Tools every AdaptOrch deployment exposes, including a remote tenant.\n * Mirrors `diagnostics.py::EXPECTED_CORE_TOOLS` in server order.\n */\nexport const ADAPTORCH_REMOTE_TOOLS = [\n\t\"adaptorch_run\",\n\t\"adaptorch_get_run\",\n\t\"adaptorch_get_artifacts\",\n\t\"adaptorch_list_runs\",\n\t\"adaptorch_cancel_run\",\n\t\"adaptorch_server_metrics\",\n\t\"adaptorch_capabilities\",\n\t\"adaptorch_usage\",\n\t\"adaptorch_plan_catalog\",\n] as const;\n\n/**\n * Tools a remote tenant cannot reach. Trace and topology reads need a full or\n * local deployment, so a caller must not advertise them unconditionally.\n */\nexport const ADAPTORCH_FULL_ONLY_TOOLS = [\"adaptorch_get_traces\", \"adaptorch_route_topology\"] as const;\n\n/** The complete tool surface, core tier first. */\nexport const ADAPTORCH_TOOLS = [...ADAPTORCH_REMOTE_TOOLS, ...ADAPTORCH_FULL_ONLY_TOOLS] as const;\n\n/** One tenant's own usage window, as projected by `output_schema.py::_project_usage`. */\nexport interface AdaptOrchUsage {\n\treadonly used: number;\n\treadonly limit: number;\n\treadonly tenant_id?: string;\n\treadonly plan_level?: string;\n\treadonly period?: string;\n\treadonly remaining?: number;\n\treadonly usage_percentage?: number;\n}\n\n/**\n * Abstract transport for invoking AdaptOrch MCP tools by name.\n *\n * See doc section \"The real, current 10-tool MCP surface (grouped)\". No\n * concrete implementation ships with this package yet; a caller must\n * provide one (e.g. wrapping an MCP SDK client's `callTool`).\n */\nexport interface AdaptOrchTransport {\n\tcallTool(name: string, args: Record<string, unknown>): Promise<unknown>;\n}\n\n/**\n * Payload accepted by `adaptorch_run`.\n *\n * See doc section \"Run / lifecycle (submit, inspect, list, cancel)\":\n * `adaptorch_run` submits a task payload (prompt/context/raw payload,\n * connector, synthesis mode, budget policy) to the control-plane, and can\n * optionally block until the run reaches a terminal status.\n */\nexport interface AdaptOrchRunPayload {\n\ttaskPayload: unknown;\n\tconnector?: string;\n\tsynthesisMode?: string;\n\tbudgetPolicy?: unknown;\n\twaitForTerminal?: boolean;\n\ttimeoutSeconds?: number;\n\tpollIntervalSeconds?: number;\n}\n\n/**\n * Result of `adaptorch_run`.\n *\n * Shape is inferred from the doc's description of the tool's purpose, not\n * guaranteed by an official schema.\n */\nexport interface AdaptOrchRunResult {\n\trun_id: string;\n\tstatus?: string;\n}\n\n/**\n * Result of `adaptorch_get_run`.\n *\n * Shape is inferred from the doc's description (\"fetch a run summary by\n * run_id\"), not guaranteed by an official schema; extra fields are\n * expected to vary by connector/synthesis mode.\n */\nexport interface AdaptOrchRunSummary {\n\trun_id: string;\n\tstatus: string;\n\t[key: string]: unknown;\n}\n\n/**\n * Entry in the result of `adaptorch_list_runs`.\n *\n * Shape is inferred, not guaranteed by an official schema.\n */\nexport interface AdaptOrchRunListEntry {\n\trun_id: string;\n\tstatus: string;\n}\n\n/**\n * Result of `adaptorch_cancel_run`.\n *\n * Shape is inferred from the doc's description (\"request cancellation of\n * an in-flight run by run_id\"), not guaranteed by an official schema.\n */\nexport interface AdaptOrchCancelResult {\n\trun_id: string;\n\tcancelled: boolean;\n}\n\n/**\n * Entry in the result of `adaptorch_get_artifacts`.\n *\n * Shape is inferred from the doc's description (\"fetch artifact metadata\n * for a run\"), not guaranteed by an official schema.\n */\nexport interface AdaptOrchArtifact {\n\tpath: string;\n\tsize_bytes?: number;\n\tcreated_at?: string;\n\t[key: string]: unknown;\n}\n\n/**\n * Entry in the result of `adaptorch_get_traces`.\n *\n * Shape is inferred from the doc's description (\"fetch execution traces\n * for a run by run_id\"), not guaranteed by an official schema.\n */\nexport interface AdaptOrchTraceSpan {\n\tspan_id?: string;\n\tkind?: string;\n\tseverity?: string;\n\t[key: string]: unknown;\n}\n\n/**\n * Result of `adaptorch_route_topology`.\n *\n * `classification` is the validated value from the current response's\n * `topology` field; `raw` retains the transport response for callers that\n * need the accompanying reason, stages, or features.\n */\nexport interface AdaptOrchRouteTopologyResult {\n\tclassification: TopologyClassification;\n\traw: unknown;\n}\n\n/**\n * Typed wrapper around the 10 real AdaptOrch MCP tools.\n *\n * See doc section \"The real, current 10-tool MCP surface (grouped)\" for\n * the full tool list, purposes, and read/write classification. This\n * class only translates method calls into `transport.callTool` calls\n * with the exact tool names the doc lists; it does not implement a\n * transport itself.\n */\nexport class AdaptOrchClient {\n\tprivate readonly transport: AdaptOrchTransport;\n\n\tconstructor(transport: AdaptOrchTransport) {\n\t\tthis.transport = transport;\n\t}\n\n\t/**\n\t * `adaptorch_run` (write). Submit a task payload to the control-plane,\n\t * optionally blocking until the run reaches a terminal status.\n\t */\n\tasync run(payload: AdaptOrchRunPayload): Promise<AdaptOrchRunResult> {\n\t\t// The transport result shape is not schema-validated here; callers\n\t\t// relying on strict correctness should validate at the transport\n\t\t// boundary.\n\t\treturn (await this.transport.callTool(\"adaptorch_run\", { ...payload })) as AdaptOrchRunResult;\n\t}\n\n\t/**\n\t * `adaptorch_get_run` (read). Fetch a run summary by `run_id`.\n\t */\n\tasync getRun(runId: string): Promise<AdaptOrchRunSummary> {\n\t\treturn (await this.transport.callTool(\"adaptorch_get_run\", { run_id: runId })) as AdaptOrchRunSummary;\n\t}\n\n\t/**\n\t * `adaptorch_list_runs` (read). List recent control-plane runs.\n\t */\n\tasync listRuns(params?: { limit?: number }): Promise<AdaptOrchRunListEntry[]> {\n\t\treturn (await this.transport.callTool(\"adaptorch_list_runs\", { ...params })) as AdaptOrchRunListEntry[];\n\t}\n\n\t/**\n\t * `adaptorch_cancel_run` (write). Request cancellation of an in-flight\n\t * run by `run_id`.\n\t */\n\tasync cancelRun(runId: string): Promise<AdaptOrchCancelResult> {\n\t\treturn (await this.transport.callTool(\"adaptorch_cancel_run\", { run_id: runId })) as AdaptOrchCancelResult;\n\t}\n\n\t/**\n\t * `adaptorch_get_artifacts` (read). Fetch artifact metadata for a run.\n\t */\n\tasync getArtifacts(runId: string): Promise<AdaptOrchArtifact[]> {\n\t\treturn (await this.transport.callTool(\"adaptorch_get_artifacts\", { run_id: runId })) as AdaptOrchArtifact[];\n\t}\n\n\t/**\n\t * `adaptorch_get_traces` (read). Fetch execution traces for a run by\n\t * `run_id`.\n\t */\n\tasync getTraces(runId: string): Promise<AdaptOrchTraceSpan[]> {\n\t\treturn (await this.transport.callTool(\"adaptorch_get_traces\", { run_id: runId })) as AdaptOrchTraceSpan[];\n\t}\n\n\t/** Route a DAG locally and fail closed if the MCP response drifts from the current topology contract. */\n\tasync routeTopology(payloadShape: unknown): Promise<AdaptOrchRouteTopologyResult> {\n\t\tconst raw = await this.transport.callTool(\"adaptorch_route_topology\", { payload_shape: payloadShape });\n\t\tconst topology = isRecord(raw) ? raw.topology : undefined;\n\t\tif (!isTopologyClassification(topology)) {\n\t\t\tthrow new Error(\"AdaptOrch route response has invalid topology\");\n\t\t}\n\t\treturn { classification: topology, raw };\n\t}\n\n\t/**\n\t * `adaptorch_server_metrics` (read/local). Read redacted MCP server\n\t * metrics (tool-call counters, latency percentiles).\n\t */\n\tasync serverMetrics(): Promise<Record<string, unknown>> {\n\t\treturn (await this.transport.callTool(\"adaptorch_server_metrics\", {})) as Record<string, unknown>;\n\t}\n\n\t/**\n\t * `adaptorch_capabilities` (read/local). Read supported synthesis\n\t * modes, connectors, and server features.\n\t */\n\tasync capabilities(): Promise<Record<string, unknown>> {\n\t\treturn (await this.transport.callTool(\"adaptorch_capabilities\", {})) as Record<string, unknown>;\n\t}\n\n\t/**\n\t * `adaptorch_usage` (read). Read this tenant's own usage window. The\n\t * control plane scopes the response by key, so a caller never sees another\n\t * tenant's counters.\n\t */\n\tasync usage(): Promise<AdaptOrchUsage> {\n\t\treturn (await this.transport.callTool(\"adaptorch_usage\", {})) as AdaptOrchUsage;\n\t}\n\n\t/**\n\t * `adaptorch_plan_catalog` (read/local). Read the hosted plan catalog.\n\t * Tier names and prices come from the server, never from this client.\n\t */\n\tasync planCatalog(): Promise<Record<string, unknown>> {\n\t\treturn (await this.transport.callTool(\"adaptorch_plan_catalog\", {})) as Record<string, unknown>;\n\t}\n}\n"]}
1
+ {"version":3,"file":"adaptorch-client.js","sourceRoot":"","sources":["../src/adaptorch-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,wBAAwB,EAA+B,MAAM,YAAY,CAAC;AAEnF,SAAS,QAAQ,CAAC,KAAc,EAAoC;IACnE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAAA,CAC5E;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC,eAAe;IACf,mBAAmB;IACnB,yBAAyB;IACzB,qBAAqB;IACr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M,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAmB,CAAC;IAAA,CAChF;IAED;;;OAGG;IACH,KAAK,CAAC,WAAW,GAAqC;QACrD,OAAO,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAA4B,CAAC;IAAA,CAChG;CACD","sourcesContent":["/**\n * AdaptOrch MCP client wrapper.\n *\n * Design-stage / experimental: this module has no production\n * `AdaptOrchTransport` implementation wired in yet. Callers must supply\n * their own transport (e.g. an adapter around an MCP SDK client) until one\n * ships in this package.\n *\n * Tool surface, names, and read/write classification are derived from the\n * server's own inventory: `diagnostics.py::EXPECTED_CORE_TOOLS` and\n * `_FULL_ONLY_TOOLS`, cross-checked against `hardening.py::REMOTE_TOOL_NAMES`\n * and the `output_schema.py` projector table. The engine declares eleven\n * tools. A hardened remote profile exposes nine; trace and topology reads\n * stay full or local. No \"benchmark\" or \"verification\" tools exist in it.\n */\n\nimport { isTopologyClassification, type TopologyClassification } from \"./types.ts\";\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/**\n * Tools every AdaptOrch deployment exposes, including a remote tenant.\n * Mirrors `diagnostics.py::EXPECTED_CORE_TOOLS` in server order.\n */\nexport const ADAPTORCH_REMOTE_TOOLS = [\n\t\"adaptorch_run\",\n\t\"adaptorch_get_run\",\n\t\"adaptorch_get_artifacts\",\n\t\"adaptorch_list_runs\",\n\t\"adaptorch_cancel_run\",\n\t\"adaptorch_server_metrics\",\n\t\"adaptorch_capabilities\",\n\t\"adaptorch_usage\",\n\t\"adaptorch_plan_catalog\",\n] as const;\n\n/**\n * Tools a remote tenant cannot reach. Trace and topology reads need a full or\n * local deployment, so a caller must not advertise them unconditionally.\n */\nexport const ADAPTORCH_FULL_ONLY_TOOLS = [\"adaptorch_get_traces\", \"adaptorch_route_topology\"] as const;\n\n/** The complete tool surface, core tier first. */\nexport const ADAPTORCH_TOOLS = [...ADAPTORCH_REMOTE_TOOLS, ...ADAPTORCH_FULL_ONLY_TOOLS] as const;\n\n/** One tenant's own usage window, as projected by `output_schema.py::_project_usage`. */\nexport interface AdaptOrchUsage {\n\treadonly used: number;\n\treadonly limit: number;\n\treadonly tenant_id?: string;\n\treadonly plan_level?: string;\n\treadonly period?: string;\n\treadonly remaining?: number;\n\treadonly usage_percentage?: number;\n}\n\n/**\n * Abstract transport for invoking AdaptOrch MCP tools by name.\n *\n * The engine declares eleven tools. No concrete transport ships with this\n * package yet; a caller must provide one (e.g. wrapping an MCP SDK client's\n * `callTool`).\n */\nexport interface AdaptOrchTransport {\n\tcallTool(name: string, args: Record<string, unknown>): Promise<unknown>;\n}\n\n/**\n * Payload accepted by `adaptorch_run`.\n *\n * See doc section \"Run / lifecycle (submit, inspect, list, cancel)\":\n * `adaptorch_run` submits a task payload (prompt/context/raw payload,\n * connector, synthesis mode, budget policy) to the control-plane, and can\n * optionally block until the run reaches a terminal status.\n */\nexport interface AdaptOrchRunPayload {\n\ttaskPayload: unknown;\n\tconnector?: string;\n\tsynthesisMode?: string;\n\tbudgetPolicy?: unknown;\n\twaitForTerminal?: boolean;\n\ttimeoutSeconds?: number;\n\tpollIntervalSeconds?: number;\n}\n\n/**\n * Result of `adaptorch_run`.\n *\n * Shape is inferred from the doc's description of the tool's purpose, not\n * guaranteed by an official schema.\n */\nexport interface AdaptOrchRunResult {\n\trun_id: string;\n\tstatus?: string;\n}\n\n/**\n * Result of `adaptorch_get_run`.\n *\n * Shape is inferred from the doc's description (\"fetch a run summary by\n * run_id\"), not guaranteed by an official schema; extra fields are\n * expected to vary by connector/synthesis mode.\n */\nexport interface AdaptOrchRunSummary {\n\trun_id: string;\n\tstatus: string;\n\t[key: string]: unknown;\n}\n\n/**\n * Entry in the result of `adaptorch_list_runs`.\n *\n * Shape is inferred, not guaranteed by an official schema.\n */\nexport interface AdaptOrchRunListEntry {\n\trun_id: string;\n\tstatus: string;\n}\n\n/**\n * Result of `adaptorch_cancel_run`.\n *\n * Shape is inferred from the doc's description (\"request cancellation of\n * an in-flight run by run_id\"), not guaranteed by an official schema.\n */\nexport interface AdaptOrchCancelResult {\n\trun_id: string;\n\tcancelled: boolean;\n}\n\n/**\n * Entry in the result of `adaptorch_get_artifacts`.\n *\n * Shape is inferred from the doc's description (\"fetch artifact metadata\n * for a run\"), not guaranteed by an official schema.\n */\nexport interface AdaptOrchArtifact {\n\tpath: string;\n\tsize_bytes?: number;\n\tcreated_at?: string;\n\t[key: string]: unknown;\n}\n\n/**\n * Entry in the result of `adaptorch_get_traces`.\n *\n * Shape is inferred from the doc's description (\"fetch execution traces\n * for a run by run_id\"), not guaranteed by an official schema.\n */\nexport interface AdaptOrchTraceSpan {\n\tspan_id?: string;\n\tkind?: string;\n\tseverity?: string;\n\t[key: string]: unknown;\n}\n\n/**\n * Result of `adaptorch_route_topology`.\n *\n * `classification` is the validated value from the current response's\n * `topology` field; `raw` retains the transport response for callers that\n * need the accompanying reason, stages, or features.\n */\nexport interface AdaptOrchRouteTopologyResult {\n\tclassification: TopologyClassification;\n\traw: unknown;\n}\n\n/**\n * Typed wrapper around the eleven AdaptOrch MCP tools the engine declares.\n *\n * This class only translates method calls into `transport.callTool` calls\n * with those tool names. It does not implement a transport, and it does not\n * decide whether a remote profile hides the two full-only tools.\n */\nexport class AdaptOrchClient {\n\tprivate readonly transport: AdaptOrchTransport;\n\n\tconstructor(transport: AdaptOrchTransport) {\n\t\tthis.transport = transport;\n\t}\n\n\t/**\n\t * `adaptorch_run` (write). Submit a task payload to the control-plane,\n\t * optionally blocking until the run reaches a terminal status.\n\t */\n\tasync run(payload: AdaptOrchRunPayload): Promise<AdaptOrchRunResult> {\n\t\t// The transport result shape is not schema-validated here; callers\n\t\t// relying on strict correctness should validate at the transport\n\t\t// boundary.\n\t\treturn (await this.transport.callTool(\"adaptorch_run\", { ...payload })) as AdaptOrchRunResult;\n\t}\n\n\t/**\n\t * `adaptorch_get_run` (read). Fetch a run summary by `run_id`.\n\t */\n\tasync getRun(runId: string): Promise<AdaptOrchRunSummary> {\n\t\treturn (await this.transport.callTool(\"adaptorch_get_run\", { run_id: runId })) as AdaptOrchRunSummary;\n\t}\n\n\t/**\n\t * `adaptorch_list_runs` (read). List recent control-plane runs.\n\t */\n\tasync listRuns(params?: { limit?: number }): Promise<AdaptOrchRunListEntry[]> {\n\t\treturn (await this.transport.callTool(\"adaptorch_list_runs\", { ...params })) as AdaptOrchRunListEntry[];\n\t}\n\n\t/**\n\t * `adaptorch_cancel_run` (write). Request cancellation of an in-flight\n\t * run by `run_id`.\n\t */\n\tasync cancelRun(runId: string): Promise<AdaptOrchCancelResult> {\n\t\treturn (await this.transport.callTool(\"adaptorch_cancel_run\", { run_id: runId })) as AdaptOrchCancelResult;\n\t}\n\n\t/**\n\t * `adaptorch_get_artifacts` (read). Fetch artifact metadata for a run.\n\t */\n\tasync getArtifacts(runId: string): Promise<AdaptOrchArtifact[]> {\n\t\treturn (await this.transport.callTool(\"adaptorch_get_artifacts\", { run_id: runId })) as AdaptOrchArtifact[];\n\t}\n\n\t/**\n\t * `adaptorch_get_traces` (read). Fetch execution traces for a run by\n\t * `run_id`.\n\t */\n\tasync getTraces(runId: string): Promise<AdaptOrchTraceSpan[]> {\n\t\treturn (await this.transport.callTool(\"adaptorch_get_traces\", { run_id: runId })) as AdaptOrchTraceSpan[];\n\t}\n\n\t/**\n\t * Route a DAG locally and fail closed if the MCP response drifts from the\n\t * current topology contract. The engine schema takes `subtasks` and optional\n\t * `dependencies` at the top level; wrapping them rejects the call.\n\t */\n\tasync routeTopology(payload: Record<string, unknown>): Promise<AdaptOrchRouteTopologyResult> {\n\t\tconst raw = await this.transport.callTool(\"adaptorch_route_topology\", payload);\n\t\tconst topology = isRecord(raw) ? raw.topology : undefined;\n\t\tif (!isTopologyClassification(topology)) {\n\t\t\tthrow new Error(\"AdaptOrch route response has invalid topology\");\n\t\t}\n\t\treturn { classification: topology, raw };\n\t}\n\n\t/**\n\t * `adaptorch_server_metrics` (read/local). Read redacted MCP server\n\t * metrics (tool-call counters, latency percentiles).\n\t */\n\tasync serverMetrics(): Promise<Record<string, unknown>> {\n\t\treturn (await this.transport.callTool(\"adaptorch_server_metrics\", {})) as Record<string, unknown>;\n\t}\n\n\t/**\n\t * `adaptorch_capabilities` (read/local). Read supported synthesis\n\t * modes, connectors, and server features.\n\t */\n\tasync capabilities(): Promise<Record<string, unknown>> {\n\t\treturn (await this.transport.callTool(\"adaptorch_capabilities\", {})) as Record<string, unknown>;\n\t}\n\n\t/**\n\t * `adaptorch_usage` (read). Read this tenant's own usage window. The\n\t * control plane scopes the response by key, so a caller never sees another\n\t * tenant's counters.\n\t */\n\tasync usage(): Promise<AdaptOrchUsage> {\n\t\treturn (await this.transport.callTool(\"adaptorch_usage\", {})) as AdaptOrchUsage;\n\t}\n\n\t/**\n\t * `adaptorch_plan_catalog` (read/local). Read the hosted plan catalog.\n\t * Tier names and prices come from the server, never from this client.\n\t */\n\tasync planCatalog(): Promise<Record<string, unknown>> {\n\t\treturn (await this.transport.callTool(\"adaptorch_plan_catalog\", {})) as Record<string, unknown>;\n\t}\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omk-adaptorch-wpl",
3
- "version": "1.2.0",
3
+ "version": "1.2.3",
4
4
  "description": "AdaptOrch-native Work Packet Loop (WPL) — state machine, verification layer, and integration bridge for OMK orchestration.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",