@noetic-tools/core 5.20.0-next.1 → 5.21.0

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.
Files changed (92) hide show
  1. package/dist/adapters/openrouter.d.ts +1 -48
  2. package/dist/adapters/openrouter.js +3 -204
  3. package/dist/builders/acp-agent-checks.d.ts +20 -0
  4. package/dist/builders/acp-agent-checks.js +68 -0
  5. package/dist/builders/acp-agent-tool.d.ts +4 -3
  6. package/dist/builders/acp-agent-tool.js +5 -2
  7. package/dist/builders/connection-ceiling.d.ts +13 -0
  8. package/dist/builders/connection-ceiling.js +17 -0
  9. package/dist/builders/document-entries.d.ts +13 -0
  10. package/dist/builders/document-entries.js +18 -0
  11. package/dist/builders/dynamic-workflow.d.ts +53 -8
  12. package/dist/builders/dynamic-workflow.js +53 -25
  13. package/dist/builders/mcp-url-pattern.d.ts +13 -0
  14. package/dist/builders/mcp-url-pattern.js +85 -0
  15. package/dist/builders/step-builders.d.ts +14 -6
  16. package/dist/builders/step-builders.js +25 -2
  17. package/dist/builders/workflow-acp-grants.d.ts +42 -0
  18. package/dist/builders/workflow-acp-grants.js +224 -0
  19. package/dist/builders/workflow-child-nodes.js +8 -0
  20. package/dist/builders/workflow-connection-nodes.d.ts +13 -3
  21. package/dist/builders/workflow-connection-nodes.js +129 -3
  22. package/dist/builders/workflow-connections.js +2 -1
  23. package/dist/builders/workflow-hydrator.d.ts +24 -1
  24. package/dist/builders/workflow-hydrator.js +8 -167
  25. package/dist/builders/workflow-mcp-servers.d.ts +44 -0
  26. package/dist/builders/workflow-mcp-servers.js +327 -0
  27. package/dist/builders/workflow-tool-entries.d.ts +84 -0
  28. package/dist/builders/workflow-tool-entries.js +216 -0
  29. package/dist/connections/durability.d.ts +11 -1
  30. package/dist/connections/durability.js +34 -0
  31. package/dist/connections/entries.d.ts +33 -0
  32. package/dist/connections/entries.js +118 -0
  33. package/dist/connections/errors.d.ts +6 -0
  34. package/dist/connections/errors.js +12 -0
  35. package/dist/connections/harness-wiring.d.ts +4 -4
  36. package/dist/connections/harness-wiring.js +1 -1
  37. package/dist/connections/in-memory-connection.d.ts +2 -0
  38. package/dist/connections/in-memory-connection.js +5 -0
  39. package/dist/connections/model-tools.d.ts +35 -12
  40. package/dist/connections/model-tools.js +348 -202
  41. package/dist/connections/registry-types.d.ts +7 -0
  42. package/dist/connections/registry.d.ts +35 -6
  43. package/dist/connections/registry.js +183 -39
  44. package/dist/connections/step-tools.d.ts +64 -0
  45. package/dist/connections/step-tools.js +154 -0
  46. package/dist/connections/views.d.ts +3 -2
  47. package/dist/connections/views.js +15 -6
  48. package/dist/harness/agent-harness.d.ts +11 -1
  49. package/dist/harness/agent-harness.js +69 -8
  50. package/dist/harness/connection-gate.d.ts +49 -8
  51. package/dist/harness/connection-gate.js +137 -26
  52. package/dist/harness/deps/interpreter.d.ts +3 -3
  53. package/dist/harness/deps/interpreter.js +3 -3
  54. package/dist/harness/harness-options.d.ts +4 -3
  55. package/dist/harness/model-call.d.ts +0 -1
  56. package/dist/harness/model-call.js +0 -48
  57. package/dist/harness/model-request.js +3 -1
  58. package/dist/harness/model-schema.d.ts +1 -19
  59. package/dist/harness/model-schema.js +0 -28
  60. package/dist/harness/model-tool-round.js +2 -2
  61. package/dist/index.d.ts +5 -5
  62. package/dist/index.js +1 -1
  63. package/dist/interpreter/acp-events.d.ts +25 -1
  64. package/dist/interpreter/acp-events.js +53 -1
  65. package/dist/interpreter/acp-layers.d.ts +20 -0
  66. package/dist/interpreter/acp-layers.js +55 -0
  67. package/dist/interpreter/acp-tools.d.ts +108 -0
  68. package/dist/interpreter/acp-tools.js +462 -0
  69. package/dist/interpreter/collect-tools.d.ts +28 -0
  70. package/dist/interpreter/collect-tools.js +112 -15
  71. package/dist/interpreter/connection-steps.d.ts +0 -2
  72. package/dist/interpreter/connection-steps.js +30 -8
  73. package/dist/interpreter/execute-acp-agent.js +263 -72
  74. package/dist/interpreter/execute-action.d.ts +76 -1
  75. package/dist/interpreter/execute-action.js +35 -42
  76. package/dist/interpreter/execute.d.ts +2 -0
  77. package/dist/interpreter/execute.js +24 -1
  78. package/dist/interpreter/verify-host.js +2 -1
  79. package/dist/runtime/tool-call.d.ts +67 -0
  80. package/dist/runtime/tool-call.js +244 -0
  81. package/dist/runtime/tool-context.d.ts +1 -2
  82. package/dist/runtime/tool-context.js +6 -2
  83. package/dist/schemas/workflow.d.ts +1 -1
  84. package/dist/types/connection-entry.d.ts +22 -0
  85. package/dist/types/connection-entry.js +8 -0
  86. package/dist/util/harness-internals.d.ts +2 -0
  87. package/dist/util/root-context.d.ts +3 -0
  88. package/dist/util/root-context.js +8 -0
  89. package/dist/util/tool-name.d.ts +8 -0
  90. package/dist/util/tool-name.js +10 -0
  91. package/package.json +3 -3
  92. package/schema/noetic-workflow.schema.json +498 -128
@@ -7,40 +7,63 @@
7
7
  * `'ask'` read). A connection with no profile has no eager set, so its tools
8
8
  * are exposed as they are.
9
9
  * - `'all'`: every operation as its own tool.
10
+ * - `'call'`: only `<name>_ops` and `<name>_call`.
10
11
  * - `'none'`: none; the connection is for steps and triggers only.
11
12
  *
12
13
  * Tools are named `<name>_<op>` (dots become underscores). When two
13
14
  * connections offer the same profile operation, the model gets one tool named
14
15
  * after the operation (`ui_tap`) with a `target` argument naming the
15
- * connection. Two operations that would still share a name are a
16
+ * connection; two or more `'call'` connections likewise share one `ops` and
17
+ * one `call`. Two operations that would still share a name are a
16
18
  * `CONNECTION_TOOL_COLLISION`. Every call passes the same gates as a step.
17
19
  *
18
- * `connectionTools(handle, { ops })` builds tools for one handle, for a
19
- * `callModel` step that narrows what it offers.
20
+ * The tools are built once per turn, from the harness's connections and the
21
+ * ones the turn attached, so a connection gives the same tools wherever it is
22
+ * attached. `connectionTools(handle, { ops })` picks part of them for a step,
23
+ * and each tool cuts itself to what the step picked (`cutForStep`).
20
24
  */
21
- import type { ConnectionHandle, Tool } from '@noetic-tools/types';
25
+ import type { ConnectionEntry, ConnectionHandle, ConnectionPick, Tool } from '@noetic-tools/types';
22
26
  import type { ConnectionRuntime } from './registry.js';
23
27
  /** `connectionTools()` options. */
24
28
  export interface ConnectionToolsOptions {
25
29
  /** Operation globs to offer; default every operation. */
26
30
  readonly ops?: ReadonlyArray<string>;
27
31
  }
32
+ /** Whether a step may run operation, or read resource, `name` of `connection`. */
33
+ export type StepAllows = (connection: string, name: string) => boolean;
28
34
  /** `<connection>_<op>` with dots and other characters a tool name cannot carry as `_`. */
29
35
  export declare function connectionToolName(connection: string, op: string): string;
30
36
  /** The registry a harness exposes, if it has one. */
31
37
  export declare function runtimeOf(harness: unknown): ConnectionRuntime | undefined;
32
38
  /**
33
- * The model tools for every ready connection in `runtime`, built fresh each
34
- * turn so a renegotiated connection's tools change at the next turn, never
35
- * mid-turn.
39
+ * The model tools for every ready connection of a turn — the harness's, and
40
+ * the ones attached under `rootId` — built fresh each turn so a renegotiated
41
+ * connection's tools change at the next turn, never mid-turn.
36
42
  *
37
43
  * @throws NoeticConfigError `CONNECTION_TOOL_COLLISION` when two operations would share a tool name.
38
44
  */
39
- export declare function buildConnectionTools(runtime: ConnectionRuntime): Tool[];
45
+ export declare function buildConnectionTools(runtime: ConnectionRuntime, rootId?: string): Tool[];
46
+ /**
47
+ * Cuts a tool built by `buildConnectionTools` to what a step may use (see
48
+ * `StepCut`): a merged tool keeps only the targets the step may use, its
49
+ * `target` enum and routing with them, and `<name>_ops` / `<name>_call` only
50
+ * the operations and reads. Returns `'not-connection'` for any other tool.
51
+ */
52
+ export declare function cutForStep(tool: Tool, allows: StepAllows): Tool | undefined | 'not-connection';
40
53
  /**
41
54
  * @public
42
- * Tools for one connection handle, for a `callModel` step that narrows what it
43
- * offers: one tool per profile operation matching `ops`, or — for a handle with
44
- * no profile — one `<name>_call` tool limited to `ops`.
55
+ * Picks part of one connection's model tools for a step: the tools the turn
56
+ * built for it, under the same names — `<name>_<op>`, `<name>_ops` /
57
+ * `<name>_call`, and merged profile tools that take `target` — narrowed to the
58
+ * operations matching `ops`. A step that lists the pick is offered a tool only
59
+ * when every operation the tool can run matches, so `<name>_call` comes with a
60
+ * pick only when every operation behind it does. Picking from an entry
61
+ * (`mcp({ name, … })`) attaches it to the step, as listing the entry would.
62
+ * A name picks a connection the harness or the turn attaches; it is checked
63
+ * when the turn's tool set is built.
64
+ *
65
+ * @throws NoeticConfigError `CONNECTION_INVALID` for a handle with `fresh` (a
66
+ * pool has no model tools), an entry with no name, or a malformed name. The
67
+ * turn fails with `CONNECTION_UNKNOWN` when no connection has the name.
45
68
  */
46
- export declare function connectionTools(handle: ConnectionHandle, options?: ConnectionToolsOptions): Tool[];
69
+ export declare function connectionTools(target: string | ConnectionHandle | ConnectionEntry, options?: ConnectionToolsOptions): ConnectionPick;