@finalai/agent-provider 0.1.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.

Potentially problematic release.


This version of @finalai/agent-provider might be problematic. Click here for more details.

Files changed (176) hide show
  1. package/README.md +12 -0
  2. package/dist/modules/channel-context.d.mts +102 -0
  3. package/dist/modules/channel-context.mjs +52 -0
  4. package/dist/modules/channel-context.mjs.map +7 -0
  5. package/dist/modules/channel-socket.d.mts +65 -0
  6. package/dist/modules/channel-socket.mjs +188 -0
  7. package/dist/modules/channel-socket.mjs.map +7 -0
  8. package/dist/modules/channel.d.mts +382 -0
  9. package/dist/modules/channel.mjs +146 -0
  10. package/dist/modules/channel.mjs.map +7 -0
  11. package/dist/modules/conformance/agent.d.mts +20 -0
  12. package/dist/modules/conformance/agent.mjs +623 -0
  13. package/dist/modules/conformance/agent.mjs.map +7 -0
  14. package/dist/modules/conformance/fixtures.d.mts +41 -0
  15. package/dist/modules/conformance/fixtures.mjs +190 -0
  16. package/dist/modules/conformance/fixtures.mjs.map +7 -0
  17. package/dist/modules/conformance/harness-kit.d.mts +82 -0
  18. package/dist/modules/conformance/harness-kit.mjs +1303 -0
  19. package/dist/modules/conformance/harness-kit.mjs.map +7 -0
  20. package/dist/modules/conformance/image.d.mts +2 -0
  21. package/dist/modules/conformance/image.mjs +79 -0
  22. package/dist/modules/conformance/image.mjs.map +7 -0
  23. package/dist/modules/conformance/index.d.mts +8 -0
  24. package/dist/modules/conformance/index.mjs +12 -0
  25. package/dist/modules/conformance/index.mjs.map +7 -0
  26. package/dist/modules/conformance/local-harness.d.mts +25 -0
  27. package/dist/modules/conformance/local-harness.mjs +108 -0
  28. package/dist/modules/conformance/local-harness.mjs.map +7 -0
  29. package/dist/modules/conformance/protocol.d.mts +30 -0
  30. package/dist/modules/conformance/protocol.mjs +56 -0
  31. package/dist/modules/conformance/protocol.mjs.map +7 -0
  32. package/dist/modules/conformance/sandbox-kit.d.mts +19 -0
  33. package/dist/modules/conformance/sandbox-kit.mjs +320 -0
  34. package/dist/modules/conformance/sandbox-kit.mjs.map +7 -0
  35. package/dist/modules/conformance/scripted-model/chat-completions.d.mts +30 -0
  36. package/dist/modules/conformance/scripted-model/chat-completions.mjs +125 -0
  37. package/dist/modules/conformance/scripted-model/chat-completions.mjs.map +7 -0
  38. package/dist/modules/conformance/scripted-model/directives.d.mts +84 -0
  39. package/dist/modules/conformance/scripted-model/directives.mjs +304 -0
  40. package/dist/modules/conformance/scripted-model/directives.mjs.map +7 -0
  41. package/dist/modules/conformance/scripted-model/handler.d.mts +14 -0
  42. package/dist/modules/conformance/scripted-model/handler.mjs +133 -0
  43. package/dist/modules/conformance/scripted-model/handler.mjs.map +7 -0
  44. package/dist/modules/conformance/scripted-model/index.d.mts +6 -0
  45. package/dist/modules/conformance/scripted-model/index.mjs +7 -0
  46. package/dist/modules/conformance/scripted-model/index.mjs.map +7 -0
  47. package/dist/modules/conformance/scripted-model/messages.d.mts +39 -0
  48. package/dist/modules/conformance/scripted-model/messages.mjs +139 -0
  49. package/dist/modules/conformance/scripted-model/messages.mjs.map +7 -0
  50. package/dist/modules/conformance/scripted-model/responses.d.mts +62 -0
  51. package/dist/modules/conformance/scripted-model/responses.mjs +273 -0
  52. package/dist/modules/conformance/scripted-model/responses.mjs.map +7 -0
  53. package/dist/modules/conformance/scripted-model/sse.d.mts +15 -0
  54. package/dist/modules/conformance/scripted-model/sse.mjs +75 -0
  55. package/dist/modules/conformance/scripted-model/sse.mjs.map +7 -0
  56. package/dist/modules/conformance/v1-agent.d.mts +24 -0
  57. package/dist/modules/conformance/v1-agent.mjs +40 -0
  58. package/dist/modules/conformance/v1-agent.mjs.map +7 -0
  59. package/dist/modules/credential-routes.d.mts +24 -0
  60. package/dist/modules/credential-routes.mjs +25 -0
  61. package/dist/modules/credential-routes.mjs.map +7 -0
  62. package/dist/modules/credentials.d.mts +206 -0
  63. package/dist/modules/credentials.mjs +207 -0
  64. package/dist/modules/credentials.mjs.map +7 -0
  65. package/dist/modules/dynamic.d.mts +32 -0
  66. package/dist/modules/dynamic.mjs +77 -0
  67. package/dist/modules/dynamic.mjs.map +7 -0
  68. package/dist/modules/harness.d.mts +397 -0
  69. package/dist/modules/harness.mjs +213 -0
  70. package/dist/modules/harness.mjs.map +7 -0
  71. package/dist/modules/index.d.mts +15 -0
  72. package/dist/modules/index.mjs +40 -0
  73. package/dist/modules/index.mjs.map +7 -0
  74. package/dist/modules/json.d.mts +12 -0
  75. package/dist/modules/json.mjs +19 -0
  76. package/dist/modules/json.mjs.map +7 -0
  77. package/dist/modules/local-channel-socket.d.mts +23 -0
  78. package/dist/modules/local-channel-socket.mjs +141 -0
  79. package/dist/modules/local-channel-socket.mjs.map +7 -0
  80. package/dist/modules/manifest.d.mts +558 -0
  81. package/dist/modules/manifest.mjs +266 -0
  82. package/dist/modules/manifest.mjs.map +7 -0
  83. package/dist/modules/mcp-content.d.mts +21 -0
  84. package/dist/modules/mcp-content.mjs +86 -0
  85. package/dist/modules/mcp-content.mjs.map +7 -0
  86. package/dist/modules/provider-ref.d.mts +29 -0
  87. package/dist/modules/provider-ref.mjs +55 -0
  88. package/dist/modules/provider-ref.mjs.map +7 -0
  89. package/dist/modules/sandbox/bytes.d.mts +9 -0
  90. package/dist/modules/sandbox/bytes.mjs +154 -0
  91. package/dist/modules/sandbox/bytes.mjs.map +7 -0
  92. package/dist/modules/sandbox/client.d.mts +51 -0
  93. package/dist/modules/sandbox/client.mjs +500 -0
  94. package/dist/modules/sandbox/client.mjs.map +7 -0
  95. package/dist/modules/sandbox/confined-files.d.mts +22 -0
  96. package/dist/modules/sandbox/confined-files.mjs +142 -0
  97. package/dist/modules/sandbox/confined-files.mjs.map +7 -0
  98. package/dist/modules/sandbox/convenience.d.mts +10 -0
  99. package/dist/modules/sandbox/convenience.mjs +116 -0
  100. package/dist/modules/sandbox/convenience.mjs.map +7 -0
  101. package/dist/modules/sandbox/editor.d.mts +49 -0
  102. package/dist/modules/sandbox/editor.mjs +43 -0
  103. package/dist/modules/sandbox/editor.mjs.map +7 -0
  104. package/dist/modules/sandbox/frame-channel.d.mts +47 -0
  105. package/dist/modules/sandbox/frame-channel.mjs +153 -0
  106. package/dist/modules/sandbox/frame-channel.mjs.map +7 -0
  107. package/dist/modules/sandbox/index.d.mts +18 -0
  108. package/dist/modules/sandbox/index.mjs +70 -0
  109. package/dist/modules/sandbox/index.mjs.map +7 -0
  110. package/dist/modules/sandbox/mcp-channel.d.mts +9 -0
  111. package/dist/modules/sandbox/mcp-channel.mjs +77 -0
  112. package/dist/modules/sandbox/mcp-channel.mjs.map +7 -0
  113. package/dist/modules/sandbox/mcp-hosted.d.mts +46 -0
  114. package/dist/modules/sandbox/mcp-hosted.mjs +221 -0
  115. package/dist/modules/sandbox/mcp-hosted.mjs.map +7 -0
  116. package/dist/modules/sandbox/mcp-search.d.mts +51 -0
  117. package/dist/modules/sandbox/mcp-search.mjs +129 -0
  118. package/dist/modules/sandbox/mcp-search.mjs.map +7 -0
  119. package/dist/modules/sandbox/mcp-shell.d.mts +21 -0
  120. package/dist/modules/sandbox/mcp-shell.mjs +205 -0
  121. package/dist/modules/sandbox/mcp-shell.mjs.map +7 -0
  122. package/dist/modules/sandbox/mcp-testing.d.mts +11 -0
  123. package/dist/modules/sandbox/mcp-testing.mjs +33 -0
  124. package/dist/modules/sandbox/mcp-testing.mjs.map +7 -0
  125. package/dist/modules/sandbox/mcp.d.mts +83 -0
  126. package/dist/modules/sandbox/mcp.mjs +971 -0
  127. package/dist/modules/sandbox/mcp.mjs.map +7 -0
  128. package/dist/modules/sandbox/memory-sandbox.d.mts +32 -0
  129. package/dist/modules/sandbox/memory-sandbox.mjs +416 -0
  130. package/dist/modules/sandbox/memory-sandbox.mjs.map +7 -0
  131. package/dist/modules/sandbox/memory-shell.d.mts +29 -0
  132. package/dist/modules/sandbox/memory-shell.mjs +278 -0
  133. package/dist/modules/sandbox/memory-shell.mjs.map +7 -0
  134. package/dist/modules/sandbox/open-scope-node.d.mts +4 -0
  135. package/dist/modules/sandbox/open-scope-node.mjs +19 -0
  136. package/dist/modules/sandbox/open-scope-node.mjs.map +7 -0
  137. package/dist/modules/sandbox/open-scope.d.mts +16 -0
  138. package/dist/modules/sandbox/open-scope.mjs +66 -0
  139. package/dist/modules/sandbox/open-scope.mjs.map +7 -0
  140. package/dist/modules/sandbox/paths.d.mts +7 -0
  141. package/dist/modules/sandbox/paths.mjs +50 -0
  142. package/dist/modules/sandbox/paths.mjs.map +7 -0
  143. package/dist/modules/sandbox/rpc-peer.d.mts +35 -0
  144. package/dist/modules/sandbox/rpc-peer.mjs +224 -0
  145. package/dist/modules/sandbox/rpc-peer.mjs.map +7 -0
  146. package/dist/modules/sandbox/seeds.d.mts +26 -0
  147. package/dist/modules/sandbox/seeds.mjs +228 -0
  148. package/dist/modules/sandbox/seeds.mjs.map +7 -0
  149. package/dist/modules/sandbox/server.d.mts +66 -0
  150. package/dist/modules/sandbox/server.mjs +567 -0
  151. package/dist/modules/sandbox/server.mjs.map +7 -0
  152. package/dist/modules/sandbox/snapshots.d.mts +49 -0
  153. package/dist/modules/sandbox/snapshots.mjs +55 -0
  154. package/dist/modules/sandbox/snapshots.mjs.map +7 -0
  155. package/dist/modules/sandbox/stream-mux.d.mts +18 -0
  156. package/dist/modules/sandbox/stream-mux.mjs +285 -0
  157. package/dist/modules/sandbox/stream-mux.mjs.map +7 -0
  158. package/dist/modules/sandbox/testing.d.mts +25 -0
  159. package/dist/modules/sandbox/testing.mjs +64 -0
  160. package/dist/modules/sandbox/testing.mjs.map +7 -0
  161. package/dist/modules/sandbox/types.d.mts +352 -0
  162. package/dist/modules/sandbox/types.mjs +86 -0
  163. package/dist/modules/sandbox/types.mjs.map +7 -0
  164. package/dist/modules/sandbox/wire.d.mts +671 -0
  165. package/dist/modules/sandbox/wire.mjs +537 -0
  166. package/dist/modules/sandbox/wire.mjs.map +7 -0
  167. package/dist/modules/sandbox/workspace-root.d.mts +8 -0
  168. package/dist/modules/sandbox/workspace-root.mjs +79 -0
  169. package/dist/modules/sandbox/workspace-root.mjs.map +7 -0
  170. package/dist/modules/schemas.d.mts +121 -0
  171. package/dist/modules/schemas.mjs +146 -0
  172. package/dist/modules/schemas.mjs.map +7 -0
  173. package/dist/modules/semantic-events.d.mts +31 -0
  174. package/dist/modules/semantic-events.mjs +23 -0
  175. package/dist/modules/semantic-events.mjs.map +7 -0
  176. package/package.json +199 -0
@@ -0,0 +1,79 @@
1
+ import { createConfinedFileReader } from "./confined-files.mjs";
2
+ import { normalizePosixPath, relativeTo } from "./paths.mjs";
3
+ const WINDOWS_ROOT = /^(?:[A-Za-z]:[\\/]|[\\/]{2})/;
4
+ const segmentsOf = (path) => path.split("/").filter((segment) => segment !== "" && segment !== ".");
5
+ const namesSessionRoot = (sessionRoot, path) => {
6
+ const base = segmentsOf(sessionRoot);
7
+ const written = segmentsOf(path);
8
+ return base.every((segment, index) => written[index] === segment);
9
+ };
10
+ const escapeError = (path) => new Error(`${path} climbs out of the sandbox workspace root`);
11
+ const joinUnder = (root, segments, separator) => {
12
+ if (segments.length === 0) return root;
13
+ const trimmed = separator === "\\" ? root.replace(/[\\/]+$/, "") : root.replace(/\/+$/, "");
14
+ return `${trimmed}${separator}${segments.join(separator)}`;
15
+ };
16
+ const mapSessionPath = (args) => {
17
+ const { path } = args;
18
+ if (!path.startsWith("/")) return path;
19
+ const windows = WINDOWS_ROOT.test(args.workspaceRoot);
20
+ if (!windows) {
21
+ const root = normalizePosixPath(args.workspaceRoot);
22
+ if (root === normalizePosixPath(args.sessionRoot) || relativeTo(root, path) != null)
23
+ return path;
24
+ }
25
+ const written = windows ? path.replaceAll("\\", "/") : path;
26
+ const remainder = relativeTo(args.sessionRoot, written);
27
+ if (remainder == null) {
28
+ if (namesSessionRoot(args.sessionRoot, written)) throw escapeError(path);
29
+ return path;
30
+ }
31
+ const segments = segmentsOf(remainder);
32
+ return windows ? joinUnder(args.workspaceRoot, segments, "\\") : joinUnder(normalizePosixPath(args.workspaceRoot), segments, "/");
33
+ };
34
+ const withSessionWorkspaceRoot = (sandbox, sessionRoot) => {
35
+ const map = (path) => mapSessionPath({ sessionRoot, workspaceRoot: sandbox.defaultWorkingDirectory, path });
36
+ const mapPath = (options) => ({
37
+ ...options,
38
+ path: map(options.path)
39
+ });
40
+ const mapConfined = (options) => ({
41
+ ...options,
42
+ path: map(options.path),
43
+ root: map(options.root)
44
+ });
45
+ const mapScoped = (options) => {
46
+ const mapped = mapPath(options);
47
+ return options.root == null ? mapped : { ...mapped, root: map(options.root) };
48
+ };
49
+ const mapProcess = (options) => ({
50
+ ...options,
51
+ cwd: map(options.cwd ?? sandbox.defaultWorkingDirectory)
52
+ });
53
+ const confined = sandbox.confinedFileReader ?? createConfinedFileReader(sandbox);
54
+ return {
55
+ ...sandbox,
56
+ confinedFileReader: {
57
+ readFile: async (options) => confined.readFile(mapConfined(options)),
58
+ stat: async (options) => confined.stat(mapConfined(options)),
59
+ readDir: async (options) => confined.readDir(mapConfined(options))
60
+ },
61
+ resolvePath: (path) => sandbox.resolvePath(map(path)),
62
+ readFile: async (options) => sandbox.readFile(mapScoped(options)),
63
+ readBinaryFile: async (options) => sandbox.readBinaryFile(mapPath(options)),
64
+ readTextFile: async (options) => sandbox.readTextFile(mapPath(options)),
65
+ writeFile: async (options) => sandbox.writeFile(mapPath(options)),
66
+ writeBinaryFile: async (options) => sandbox.writeBinaryFile(mapPath(options)),
67
+ writeTextFile: async (options) => sandbox.writeTextFile(mapPath(options)),
68
+ spawn: async (options) => sandbox.spawn(mapProcess(options)),
69
+ run: async (options) => sandbox.run(mapProcess(options)),
70
+ stat: async (options) => sandbox.stat(mapScoped(options)),
71
+ readDir: async (options) => sandbox.readDir(mapScoped(options)),
72
+ removePath: async (options) => sandbox.removePath(mapPath(options))
73
+ };
74
+ };
75
+ export {
76
+ mapSessionPath,
77
+ withSessionWorkspaceRoot
78
+ };
79
+ //# sourceMappingURL=workspace-root.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/sandbox/workspace-root.ts"],
4
+ "sourcesContent": ["import { createConfinedFileReader } from \"./confined-files.mjs\";\nimport { normalizePosixPath, relativeTo } from \"./paths.mjs\";\nimport type {\n ConfinedSandboxFilesIface,\n NetworkSandboxSessionIface,\n SandboxProcessOptionsIface,\n} from \"./types.mjs\";\n\n// A session addresses every sandbox under one POSIX root (the session service\n// gives each ACP session `/workspaces`), while each sandbox reports its own\n// working root as `defaultWorkingDirectory`: `/workspaces` on a computer, a real\n// folder on a Device, the provider's work directory elsewhere. A path at or\n// under the session root lands on the sandbox's root, in the sandbox's own path\n// flavour; every other path passes through as it is. Results keep the sandbox's\n// real paths.\n\n// Drive (`C:\\`, `c:/`) and UNC roots: a Windows Device.\nconst WINDOWS_ROOT = /^(?:[A-Za-z]:[\\\\/]|[\\\\/]{2})/;\n\nconst segmentsOf = (path: string): string[] =>\n path.split('/').filter((segment) => segment !== '' && segment !== '.');\n\n// Whether the path, as written, starts with the session root's segments.\nconst namesSessionRoot = (sessionRoot: string, path: string): boolean => {\n const base = segmentsOf(sessionRoot);\n const written = segmentsOf(path);\n return base.every((segment, index) => written[index] === segment);\n};\n\nconst escapeError = (path: string): Error =>\n new Error(`${path} climbs out of the sandbox workspace root`);\n\nconst joinUnder = (root: string, segments: readonly string[], separator: string): string => {\n if (segments.length === 0) return root;\n const trimmed = separator === '\\\\' ? root.replace(/[\\\\/]+$/, '') : root.replace(/\\/+$/, '');\n return `${trimmed}${separator}${segments.join(separator)}`;\n};\n\nexport interface MapSessionPathArgsIface {\n // The root the session's harness was given (POSIX, absolute).\n sessionRoot: string;\n // The sandbox's own working root (its defaultWorkingDirectory).\n workspaceRoot: string;\n path: string;\n}\n\n// `path` as the sandbox should see it. Relative paths and absolute paths outside\n// the session root are unchanged; a path that names the session root and then\n// climbs out of it with `..` is refused.\nexport const mapSessionPath = (args: MapSessionPathArgsIface): string => {\n const { path } = args;\n if (!path.startsWith('/')) return path;\n const windows = WINDOWS_ROOT.test(args.workspaceRoot);\n if (!windows) {\n const root = normalizePosixPath(args.workspaceRoot);\n // The session root is the sandbox's own (a computer), or the path is\n // already under the sandbox's root: nothing to map.\n if (root === normalizePosixPath(args.sessionRoot) || relativeTo(root, path) != null)\n return path;\n }\n // Windows reads `\\` as a separator too: split on it before resolving `..`.\n const written = windows ? path.replaceAll('\\\\', '/') : path;\n const remainder = relativeTo(args.sessionRoot, written);\n if (remainder == null) {\n if (namesSessionRoot(args.sessionRoot, written)) throw escapeError(path);\n return path;\n }\n const segments = segmentsOf(remainder);\n return windows\n ? joinUnder(args.workspaceRoot, segments, '\\\\')\n : joinUnder(normalizePosixPath(args.workspaceRoot), segments, '/');\n};\n\n// The handle with every path and working directory it is given mapped onto its\n// own working root (mapSessionPath). A call without a cwd runs in that root; a\n// refused path rejects the call.\nexport const withSessionWorkspaceRoot = <S extends NetworkSandboxSessionIface>(\n sandbox: S,\n sessionRoot: string,\n): S => {\n const map = (path: string): string =>\n mapSessionPath({ sessionRoot, workspaceRoot: sandbox.defaultWorkingDirectory, path });\n const mapPath = <T extends { path: string }>(options: T): T => ({\n ...options,\n path: map(options.path),\n });\n const mapConfined = <T extends { path: string; root: string }>(options: T): T => ({\n ...options,\n path: map(options.path),\n root: map(options.root),\n });\n const mapScoped = <T extends { path: string; root?: string }>(options: T): T => {\n const mapped = mapPath(options);\n return options.root == null ? mapped : { ...mapped, root: map(options.root) };\n };\n const mapProcess = (options: SandboxProcessOptionsIface): SandboxProcessOptionsIface => ({\n ...options,\n cwd: map(options.cwd ?? sandbox.defaultWorkingDirectory),\n });\n // The handle RPC falls back to the same reader over the handle when a\n // provider has none; binding it here maps its paths too.\n const confined: ConfinedSandboxFilesIface =\n sandbox.confinedFileReader ?? createConfinedFileReader(sandbox);\n return {\n ...sandbox,\n confinedFileReader: {\n readFile: async (options) => confined.readFile(mapConfined(options)),\n stat: async (options) => confined.stat(mapConfined(options)),\n readDir: async (options) => confined.readDir(mapConfined(options)),\n },\n resolvePath: (path) => sandbox.resolvePath(map(path)),\n readFile: async (options) => sandbox.readFile(mapScoped(options)),\n readBinaryFile: async (options) => sandbox.readBinaryFile(mapPath(options)),\n readTextFile: async (options) => sandbox.readTextFile(mapPath(options)),\n writeFile: async (options) => sandbox.writeFile(mapPath(options)),\n writeBinaryFile: async (options) => sandbox.writeBinaryFile(mapPath(options)),\n writeTextFile: async (options) => sandbox.writeTextFile(mapPath(options)),\n spawn: async (options) => sandbox.spawn(mapProcess(options)),\n run: async (options) => sandbox.run(mapProcess(options)),\n stat: async (options) => sandbox.stat(mapScoped(options)),\n readDir: async (options) => sandbox.readDir(mapScoped(options)),\n removePath: async (options) => sandbox.removePath(mapPath(options)),\n };\n};\n"],
5
+ "mappings": "AAAA,SAAS,gCAAgC;AACzC,SAAS,oBAAoB,kBAAkB;AAgB/C,MAAM,eAAe;AAErB,MAAM,aAAa,CAAC,SAClB,KAAK,MAAM,GAAG,EAAE,OAAO,CAAC,YAAY,YAAY,MAAM,YAAY,GAAG;AAGvE,MAAM,mBAAmB,CAAC,aAAqB,SAA0B;AACvE,QAAM,OAAO,WAAW,WAAW;AACnC,QAAM,UAAU,WAAW,IAAI;AAC/B,SAAO,KAAK,MAAM,CAAC,SAAS,UAAU,QAAQ,KAAK,MAAM,OAAO;AAClE;AAEA,MAAM,cAAc,CAAC,SACnB,IAAI,MAAM,GAAG,IAAI,2CAA2C;AAE9D,MAAM,YAAY,CAAC,MAAc,UAA6B,cAA8B;AAC1F,MAAI,SAAS,WAAW,EAAG,QAAO;AAClC,QAAM,UAAU,cAAc,OAAO,KAAK,QAAQ,WAAW,EAAE,IAAI,KAAK,QAAQ,QAAQ,EAAE;AAC1F,SAAO,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,KAAK,SAAS,CAAC;AAC1D;AAaO,MAAM,iBAAiB,CAAC,SAA0C;AACvE,QAAM,EAAE,KAAK,IAAI;AACjB,MAAI,CAAC,KAAK,WAAW,GAAG,EAAG,QAAO;AACl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ACL,GAAG;AAAA,IACH,oBAAoB;AAAA,MAClB,UAAU,OAAO,YAAY,SAAS,SAAS,YAAY,OAAO,CAAC;AAAA,MACnE,MAAM,OAAO,YAAY,SAAS,KAAK,YAAY,OAAO,CAAC;AAAA,MAC3D,SAAS,OAAO,YAAY,SAAS,QAAQ,YAAY,OAAO,CAAC;AAAA,IACnE;AAAA,IACA,aAAa,CAAC,SAAS,QAAQ,YAAY,IAAI,IAAI,CAAC;AAAA,IACpD,UAAU,OAAO,YAAY,QAAQ,SAAS,UAAU,OAAO,CAAC;AAAA,IAChE,gBAAgB,OAAO,YAAY,QAAQ,eAAe,QAAQ,OAAO,CAAC;AAAA,IAC1E,cAAc,OAAO,YAAY,QAAQ,aAAa,QAAQ,OAAO,CAAC;AAAA,IACtE,WAAW,OAAO,YAAY,QAAQ,UAAU,QAAQ,OAAO,CAAC;AAAA,IAChE,iBAAiB,OAAO,YAAY,QAAQ,gBAAgB,QAAQ,OAAO,CAAC;AAAA,IAC5E,eAAe,OAAO,YAAY,QAAQ,cAAc,QAAQ,OAAO,CAAC;AAAA,IACxE,OAAO,OAAO,YAAY,QAAQ,MAAM,WAAW,OAAO,CAAC;AAAA,IAC3D,KAAK,OAAO,YAAY,QAAQ,IAAI,WAAW,OAAO,CAAC;AAAA,IACvD,MAAM,OAAO,YAAY,QAAQ,KAAK,UAAU,OAAO,CAAC;AAAA,IACxD,SAAS,OAAO,YAAY,QAAQ,QAAQ,UAAU,OAAO,CAAC;AAAA,IAC9D,YAAY,OAAO,YAAY,QAAQ,WAAW,QAAQ,OAAO,CAAC;AAAA,EACpE;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,121 @@
1
+ import type { JsonSchema } from "./json.mjs";
2
+ export declare const SCHEMA_IDS: {
3
+ readonly modelPicker: "final://schemas/model-picker";
4
+ readonly credentialPolicy: "final://schemas/credential-policy";
5
+ readonly permissionMode: "final://schemas/permission-mode";
6
+ readonly instructions: "final://schemas/instructions";
7
+ readonly skills: "final://schemas/skills";
8
+ readonly reasoning: "final://schemas/reasoning";
9
+ readonly secretRef: "final://schemas/secret-ref";
10
+ };
11
+ export declare const SHARED_SCHEMAS: {
12
+ "final://schemas/model-picker": {
13
+ $id: "final://schemas/model-picker";
14
+ title: string;
15
+ type: string;
16
+ 'x-final-widget': string;
17
+ };
18
+ "final://schemas/reasoning": {
19
+ $id: "final://schemas/reasoning";
20
+ title: string;
21
+ enum: string[];
22
+ 'x-final-widget': string;
23
+ };
24
+ "final://schemas/credential-policy": {
25
+ $id: "final://schemas/credential-policy";
26
+ title: string;
27
+ type: string;
28
+ required: string[];
29
+ properties: {
30
+ payer: {
31
+ enum: string[];
32
+ };
33
+ tryInOrder: {
34
+ type: string;
35
+ minItems: number;
36
+ items: import("./json.mjs").JsonObject;
37
+ };
38
+ };
39
+ 'x-final-widget': string;
40
+ };
41
+ "final://schemas/permission-mode": {
42
+ $id: "final://schemas/permission-mode";
43
+ title: string;
44
+ type: string;
45
+ 'x-final-widget': string;
46
+ };
47
+ "final://schemas/instructions": {
48
+ $id: "final://schemas/instructions";
49
+ title: string;
50
+ type: string;
51
+ items: {
52
+ anyOf: (import("./json.mjs").JsonObject | {
53
+ type: string;
54
+ required: string[];
55
+ properties: {
56
+ role: {
57
+ enum: string[];
58
+ };
59
+ content: {
60
+ type: string;
61
+ };
62
+ source: {
63
+ type: string;
64
+ };
65
+ };
66
+ })[];
67
+ };
68
+ 'x-final-widget': string;
69
+ };
70
+ "final://schemas/skills": {
71
+ $id: "final://schemas/skills";
72
+ title: string;
73
+ type: string;
74
+ items: {
75
+ anyOf: (import("./json.mjs").JsonObject | {
76
+ type: string;
77
+ required: string[];
78
+ properties: {
79
+ key: {
80
+ type: string;
81
+ };
82
+ description: {
83
+ type: string;
84
+ };
85
+ files: {
86
+ type: string;
87
+ items: {
88
+ type: string;
89
+ required: string[];
90
+ properties: {
91
+ path: {
92
+ type: string;
93
+ };
94
+ content: {
95
+ type: string;
96
+ };
97
+ };
98
+ };
99
+ };
100
+ };
101
+ })[];
102
+ };
103
+ 'x-final-widget': string;
104
+ };
105
+ "final://schemas/secret-ref": {
106
+ $id: "final://schemas/secret-ref";
107
+ title: string;
108
+ type: string;
109
+ required: string[];
110
+ properties: {
111
+ secretKey: {
112
+ type: string;
113
+ };
114
+ };
115
+ 'x-final-widget': string;
116
+ };
117
+ };
118
+ export interface SharedSchemaReferencesIface {
119
+ [field: string]: string;
120
+ }
121
+ export declare const referencedSharedSchemas: (configSchema: JsonSchema) => SharedSchemaReferencesIface;
@@ -0,0 +1,146 @@
1
+ import * as z from "zod";
2
+ const SCHEMA_IDS = {
3
+ modelPicker: "final://schemas/model-picker",
4
+ credentialPolicy: "final://schemas/credential-policy",
5
+ permissionMode: "final://schemas/permission-mode",
6
+ instructions: "final://schemas/instructions",
7
+ skills: "final://schemas/skills",
8
+ reasoning: "final://schemas/reasoning",
9
+ secretRef: "final://schemas/secret-ref"
10
+ };
11
+ const dynamicSlotJsonSchema = {
12
+ type: "object",
13
+ required: ["$dynamic"],
14
+ properties: {
15
+ $dynamic: {
16
+ type: "object",
17
+ required: ["resolver", "events"],
18
+ properties: {
19
+ resolver: { type: "string" },
20
+ events: { type: "array", items: { enum: ["session.started", "turn.started"] } },
21
+ description: { type: "string" },
22
+ preview: { type: "string" }
23
+ }
24
+ }
25
+ }
26
+ };
27
+ const credentialNodeJsonSchema = {
28
+ type: "object",
29
+ required: ["kind"],
30
+ properties: {
31
+ kind: { enum: ["subscription", "api-key", "platform", "harness-owned", "custom"] },
32
+ owner: { enum: ["payer", "organization"] },
33
+ vendor: { type: "string" },
34
+ pin: { type: "string" },
35
+ secret: { type: "string" },
36
+ baseUrl: { type: "string", format: "uri" },
37
+ budget: { type: "string" },
38
+ resolver: { type: "string" }
39
+ }
40
+ };
41
+ const SHARED_SCHEMAS = {
42
+ [SCHEMA_IDS.modelPicker]: {
43
+ $id: SCHEMA_IDS.modelPicker,
44
+ title: "Model",
45
+ // The harness supplies the enum: { $ref: model-picker, enum: [...] }.
46
+ type: "string",
47
+ "x-final-widget": "model-picker"
48
+ },
49
+ [SCHEMA_IDS.reasoning]: {
50
+ $id: SCHEMA_IDS.reasoning,
51
+ title: "Reasoning",
52
+ enum: ["none", "minimal", "low", "medium", "high", "max"],
53
+ "x-final-widget": "reasoning-picker"
54
+ },
55
+ [SCHEMA_IDS.credentialPolicy]: {
56
+ $id: SCHEMA_IDS.credentialPolicy,
57
+ title: "Credentials",
58
+ type: "object",
59
+ required: ["payer", "tryInOrder"],
60
+ properties: {
61
+ payer: { enum: ["agent-owner", "organization", "prompting-user", "conversation-owner"] },
62
+ tryInOrder: { type: "array", minItems: 1, items: credentialNodeJsonSchema }
63
+ },
64
+ "x-final-widget": "credential-policy"
65
+ },
66
+ [SCHEMA_IDS.permissionMode]: {
67
+ $id: SCHEMA_IDS.permissionMode,
68
+ title: "Permission mode",
69
+ // The harness supplies the enum of its own modes.
70
+ type: "string",
71
+ "x-final-widget": "permission-mode"
72
+ },
73
+ [SCHEMA_IDS.instructions]: {
74
+ $id: SCHEMA_IDS.instructions,
75
+ title: "Instructions",
76
+ type: "array",
77
+ items: {
78
+ anyOf: [
79
+ {
80
+ type: "object",
81
+ required: ["role", "content"],
82
+ properties: {
83
+ role: { enum: ["system", "user"] },
84
+ content: { type: "string" },
85
+ source: { type: "string" }
86
+ }
87
+ },
88
+ dynamicSlotJsonSchema
89
+ ]
90
+ },
91
+ "x-final-widget": "instructions"
92
+ },
93
+ [SCHEMA_IDS.skills]: {
94
+ $id: SCHEMA_IDS.skills,
95
+ title: "Skills",
96
+ type: "array",
97
+ items: {
98
+ anyOf: [
99
+ {
100
+ type: "object",
101
+ required: ["key", "files"],
102
+ properties: {
103
+ key: { type: "string" },
104
+ description: { type: "string" },
105
+ files: {
106
+ type: "array",
107
+ items: {
108
+ type: "object",
109
+ required: ["path", "content"],
110
+ properties: { path: { type: "string" }, content: { type: "string" } }
111
+ }
112
+ }
113
+ }
114
+ },
115
+ dynamicSlotJsonSchema
116
+ ]
117
+ },
118
+ "x-final-widget": "skills"
119
+ },
120
+ [SCHEMA_IDS.secretRef]: {
121
+ $id: SCHEMA_IDS.secretRef,
122
+ title: "Secret",
123
+ type: "object",
124
+ required: ["secretKey"],
125
+ properties: { secretKey: { type: "string" } },
126
+ "x-final-widget": "secret-picker"
127
+ }
128
+ };
129
+ const fieldRefSchema = z.object({ $ref: z.string().startsWith("final://schemas/") });
130
+ const propertiesSchema = z.object({ properties: z.record(z.string(), z.json()) });
131
+ const referencedSharedSchemas = (configSchema) => {
132
+ const parsed = propertiesSchema.safeParse(configSchema);
133
+ const out = {};
134
+ if (!parsed.success) return out;
135
+ for (const [field, fieldSchema] of Object.entries(parsed.data.properties)) {
136
+ const ref = fieldRefSchema.safeParse(fieldSchema);
137
+ if (ref.success) out[field] = ref.data.$ref;
138
+ }
139
+ return out;
140
+ };
141
+ export {
142
+ SCHEMA_IDS,
143
+ SHARED_SCHEMAS,
144
+ referencedSharedSchemas
145
+ };
146
+ //# sourceMappingURL=schemas.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/schemas.ts"],
4
+ "sourcesContent": ["import * as z from 'zod';\nimport type { JsonSchema } from \"./json.mjs\";\n\n// Shared JSON Schema fragments harness config schemas may $ref so Build renders\n// the familiar pickers. A harness with none of these\n// fields leaves them out.\n\nexport const SCHEMA_IDS = {\n modelPicker: 'final://schemas/model-picker',\n credentialPolicy: 'final://schemas/credential-policy',\n permissionMode: 'final://schemas/permission-mode',\n instructions: 'final://schemas/instructions',\n skills: 'final://schemas/skills',\n reasoning: 'final://schemas/reasoning',\n secretRef: 'final://schemas/secret-ref',\n} as const;\n\nconst dynamicSlotJsonSchema: JsonSchema = {\n type: 'object',\n required: ['$dynamic'],\n properties: {\n $dynamic: {\n type: 'object',\n required: ['resolver', 'events'],\n properties: {\n resolver: { type: 'string' },\n events: { type: 'array', items: { enum: ['session.started', 'turn.started'] } },\n description: { type: 'string' },\n preview: { type: 'string' },\n },\n },\n },\n};\n\nconst credentialNodeJsonSchema: JsonSchema = {\n type: 'object',\n required: ['kind'],\n properties: {\n kind: { enum: ['subscription', 'api-key', 'platform', 'harness-owned', 'custom'] },\n owner: { enum: ['payer', 'organization'] },\n vendor: { type: 'string' },\n pin: { type: 'string' },\n secret: { type: 'string' },\n baseUrl: { type: 'string', format: 'uri' },\n budget: { type: 'string' },\n resolver: { type: 'string' },\n },\n};\n\nexport const SHARED_SCHEMAS = {\n [SCHEMA_IDS.modelPicker]: {\n $id: SCHEMA_IDS.modelPicker,\n title: 'Model',\n // The harness supplies the enum: { $ref: model-picker, enum: [...] }.\n type: 'string',\n 'x-final-widget': 'model-picker',\n },\n [SCHEMA_IDS.reasoning]: {\n $id: SCHEMA_IDS.reasoning,\n title: 'Reasoning',\n enum: ['none', 'minimal', 'low', 'medium', 'high', 'max'],\n 'x-final-widget': 'reasoning-picker',\n },\n [SCHEMA_IDS.credentialPolicy]: {\n $id: SCHEMA_IDS.credentialPolicy,\n title: 'Credentials',\n type: 'object',\n required: ['payer', 'tryInOrder'],\n properties: {\n payer: { enum: ['agent-owner', 'organization', 'prompting-user', 'conversation-owner'] },\n tryInOrder: { type: 'array', minItems: 1, items: credentialNodeJsonSchema },\n },\n 'x-final-widget': 'credential-policy',\n },\n [SCHEMA_IDS.permissionMode]: {\n $id: SCHEMA_IDS.permissionMode,\n title: 'Permission mode',\n // The harness supplies the enum of its own modes.\n type: 'string',\n 'x-final-widget': 'permission-mode',\n },\n [SCHEMA_IDS.instructions]: {\n $id: SCHEMA_IDS.instructions,\n title: 'Instructions',\n type: 'array',\n items: {\n anyOf: [\n {\n type: 'object',\n required: ['role', 'content'],\n properties: {\n role: { enum: ['system', 'user'] },\n content: { type: 'string' },\n source: { type: 'string' },\n },\n },\n dynamicSlotJsonSchema,\n ],\n },\n 'x-final-widget': 'instructions',\n },\n [SCHEMA_IDS.skills]: {\n $id: SCHEMA_IDS.skills,\n title: 'Skills',\n type: 'array',\n items: {\n anyOf: [\n {\n type: 'object',\n required: ['key', 'files'],\n properties: {\n key: { type: 'string' },\n description: { type: 'string' },\n files: {\n type: 'array',\n items: {\n type: 'object',\n required: ['path', 'content'],\n properties: { path: { type: 'string' }, content: { type: 'string' } },\n },\n },\n },\n },\n dynamicSlotJsonSchema,\n ],\n },\n 'x-final-widget': 'skills',\n },\n [SCHEMA_IDS.secretRef]: {\n $id: SCHEMA_IDS.secretRef,\n title: 'Secret',\n type: 'object',\n required: ['secretKey'],\n properties: { secretKey: { type: 'string' } },\n 'x-final-widget': 'secret-picker',\n },\n} satisfies Record<string, JsonSchema>;\n\n// Which shared fragments a config schema references at its top level, e.g.\n// to decide whether the directory's instructions/skills apply to a harness.\nconst fieldRefSchema = z.object({ $ref: z.string().startsWith('final://schemas/') });\nconst propertiesSchema = z.object({ properties: z.record(z.string(), z.json()) });\n\nexport interface SharedSchemaReferencesIface {\n [field: string]: string;\n}\n\nexport const referencedSharedSchemas = (configSchema: JsonSchema): SharedSchemaReferencesIface => {\n const parsed = propertiesSchema.safeParse(configSchema);\n const out: SharedSchemaReferencesIface = {};\n if (!parsed.success) return out;\n for (const [field, fieldSchema] of Object.entries(parsed.data.properties)) {\n const ref = fieldRefSchema.safeParse(fieldSchema);\n if (ref.success) out[field] = ref.data.$ref;\n }\n return out;\n};\n"],
5
+ "mappings": "AAAA,YAAY,OAAO;AAOZ,MAAM,aAAa;AAAA,EACxB,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,WAAW;AACb;AAEA,MAAM,wBAAoC;AAAA,EACxC,MAAM;AAAA,EACN,UAAU,CAAC,UAAU;AAAA,EACrB,YAAY;AAAA,IACV,UAAU;AAAA,MACR,MAAM;AAAA,MACN,UAAU,CAAC,YAAY,QAAQ;AAAA,MAC/B,YAAY;AAAA,QACV,UAAU,EAAE,MAAM,SAAS;AAAA,QAC3B,QAAQ,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C,WAAW,SAAS,GAAG;AAAA,IACtB,KAAK,WAAW;AAAA,IAChB,OAAO;AAAA,IACP,MAAM;AAAA,IACN,UAAU,CAAC,WAAW;AAAA,IACtB,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,EAAE;AAAA,IAC5C,kBAAkB;AAAA,EACpB;AACF;AAIA,MAAM,iBAAiB,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,kBAAkB,EAAE,CAAC;AACnF,MAAM,mBAAmB,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC;AAMzE,MAAM,0BAA0B,CAAC,iBAA0D;AAChG,QAAM,SAAS,iBAAiB,UAAU,YAAY;AACtD,QAAM,MAAmC,CAAC;AAC1C,MAAI,CAAC,OAAO,QAAS,QAAO;AAC5B,aAAW,CAAC,OAAO,WAAW,KAAK,OAAO,QAAQ,OAAO,KAAK,UAAU,GAAG;AACzE,UAAM,MAAM,eAAe,UAAU,WAAW;AAChD,QAAI,IAAI,QAAS,KAAI,KAAK,IAAI,IAAI,KAAK;AAAA,EACzC;AACA,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -0,0 +1,31 @@
1
+ import * as z from 'zod';
2
+ import { type JsonObject } from "./json.mjs";
3
+ export declare enum SemanticChannelEventKind {
4
+ MessageDelta = "message.delta",
5
+ MessageCompleted = "message.completed",
6
+ TurnStarted = "turn.started",
7
+ TurnCompleted = "turn.completed"
8
+ }
9
+ export declare const channelMessageCompletedSchema: z.ZodObject<{
10
+ message: z.ZodObject<{
11
+ id: z.ZodString;
12
+ content: z.ZodArray<z.ZodType<JsonObject, unknown, z.core.$ZodTypeInternals<JsonObject, unknown>>>;
13
+ }, z.core.$strip>;
14
+ finishReason: z.ZodNullable<z.ZodString>;
15
+ }, z.core.$strip>;
16
+ export type ChannelMessageCompletedDataIface = z.infer<typeof channelMessageCompletedSchema>;
17
+ export interface ChannelMessageDeltaDataIface {
18
+ messageId: string;
19
+ delta: JsonObject;
20
+ }
21
+ export declare const channelTurnEventSchema: z.ZodObject<{
22
+ turnId: z.ZodString;
23
+ stopReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
24
+ }, z.core.$strip>;
25
+ export type ChannelTurnEventDataIface = z.infer<typeof channelTurnEventSchema>;
26
+ export interface ChannelSemanticDataByKindIface {
27
+ 'message.delta': ChannelMessageDeltaDataIface;
28
+ 'message.completed': ChannelMessageCompletedDataIface;
29
+ 'turn.started': ChannelTurnEventDataIface;
30
+ 'turn.completed': ChannelTurnEventDataIface;
31
+ }
@@ -0,0 +1,23 @@
1
+ import * as z from "zod";
2
+ import { jsonObjectSchema } from "./json.mjs";
3
+ var SemanticChannelEventKind = /* @__PURE__ */ ((SemanticChannelEventKind2) => {
4
+ SemanticChannelEventKind2["MessageDelta"] = "message.delta";
5
+ SemanticChannelEventKind2["MessageCompleted"] = "message.completed";
6
+ SemanticChannelEventKind2["TurnStarted"] = "turn.started";
7
+ SemanticChannelEventKind2["TurnCompleted"] = "turn.completed";
8
+ return SemanticChannelEventKind2;
9
+ })(SemanticChannelEventKind || {});
10
+ const channelMessageCompletedSchema = z.object({
11
+ message: z.object({ id: z.string(), content: z.array(jsonObjectSchema) }),
12
+ finishReason: z.string().nullable()
13
+ });
14
+ const channelTurnEventSchema = z.object({
15
+ turnId: z.string(),
16
+ stopReason: z.string().nullable().optional()
17
+ });
18
+ export {
19
+ SemanticChannelEventKind,
20
+ channelMessageCompletedSchema,
21
+ channelTurnEventSchema
22
+ };
23
+ //# sourceMappingURL=semantic-events.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/semantic-events.ts"],
4
+ "sourcesContent": ["import * as z from 'zod';\nimport { jsonObjectSchema, type JsonObject } from \"./json.mjs\";\n\nexport enum SemanticChannelEventKind {\n MessageDelta = 'message.delta',\n MessageCompleted = 'message.completed',\n TurnStarted = 'turn.started',\n TurnCompleted = 'turn.completed',\n}\n\nexport const channelMessageCompletedSchema = z.object({\n message: z.object({ id: z.string(), content: z.array(jsonObjectSchema) }),\n finishReason: z.string().nullable(),\n});\nexport type ChannelMessageCompletedDataIface = z.infer<typeof channelMessageCompletedSchema>;\nexport interface ChannelMessageDeltaDataIface {\n messageId: string;\n delta: JsonObject;\n}\nexport const channelTurnEventSchema = z.object({\n turnId: z.string(),\n stopReason: z.string().nullable().optional(),\n});\nexport type ChannelTurnEventDataIface = z.infer<typeof channelTurnEventSchema>;\nexport interface ChannelSemanticDataByKindIface {\n 'message.delta': ChannelMessageDeltaDataIface;\n 'message.completed': ChannelMessageCompletedDataIface;\n 'turn.started': ChannelTurnEventDataIface;\n 'turn.completed': ChannelTurnEventDataIface;\n}\n"],
5
+ "mappings": "AAAA,YAAY,OAAO;AACnB,SAAS,wBAAyC;AAE3C,IAAK,2BAAL,kBAAKA,8BAAL;AACL,EAAAA,0BAAA,kBAAe;AACf,EAAAA,0BAAA,sBAAmB;AACnB,EAAAA,0BAAA,iBAAc;AACd,EAAAA,0BAAA,mBAAgB;AAJN,SAAAA;AAAA,GAAA;AAOL,MAAM,gCAAgC,EAAE,OAAO;AAAA,EACpD,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,SAAS,EAAE,MAAM,gBAAgB,EAAE,CAAC;AAAA,EACxE,cAAc,EAAE,OAAO,EAAE,SAAS;AACpC,CAAC;AAMM,MAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,QAAQ,EAAE,OAAO;AAAA,EACjB,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAC7C,CAAC;",
6
+ "names": ["SemanticChannelEventKind"]
7
+ }
package/package.json ADDED
@@ -0,0 +1,199 @@
1
+ {
2
+ "name": "@finalai/agent-provider",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "description": "Provider contracts for the agent stack: harnesses, sandboxes (handle, wire, MCP projection), channels, credential policies, and the conformance kit.",
6
+ "license": "UNLICENSED",
7
+ "files": [
8
+ "dist",
9
+ "README.md",
10
+ "THIRD_PARTY_NOTICES.md"
11
+ ],
12
+ "type": "module",
13
+ "sideEffects": false,
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/modules/index.d.mts",
17
+ "import": "./dist/modules/index.mjs",
18
+ "default": "./dist/modules/index.mjs"
19
+ },
20
+ "./harness": {
21
+ "types": "./dist/modules/harness.d.mts",
22
+ "import": "./dist/modules/harness.mjs",
23
+ "default": "./dist/modules/harness.mjs"
24
+ },
25
+ "./credential-routes": {
26
+ "types": "./dist/modules/credential-routes.d.mts",
27
+ "import": "./dist/modules/credential-routes.mjs",
28
+ "default": "./dist/modules/credential-routes.mjs"
29
+ },
30
+ "./channel": {
31
+ "types": "./dist/modules/channel.d.mts",
32
+ "import": "./dist/modules/channel.mjs",
33
+ "default": "./dist/modules/channel.mjs"
34
+ },
35
+ "./credentials": {
36
+ "types": "./dist/modules/credentials.d.mts",
37
+ "import": "./dist/modules/credentials.mjs",
38
+ "default": "./dist/modules/credentials.mjs"
39
+ },
40
+ "./schemas": {
41
+ "types": "./dist/modules/schemas.d.mts",
42
+ "import": "./dist/modules/schemas.mjs",
43
+ "default": "./dist/modules/schemas.mjs"
44
+ },
45
+ "./sandbox": {
46
+ "types": "./dist/modules/sandbox/index.d.mts",
47
+ "import": "./dist/modules/sandbox/index.mjs",
48
+ "default": "./dist/modules/sandbox/index.mjs"
49
+ },
50
+ "./sandbox/wire": {
51
+ "types": "./dist/modules/sandbox/wire.d.mts",
52
+ "import": "./dist/modules/sandbox/wire.mjs",
53
+ "default": "./dist/modules/sandbox/wire.mjs"
54
+ },
55
+ "./sandbox/client": {
56
+ "types": "./dist/modules/sandbox/client.d.mts",
57
+ "import": "./dist/modules/sandbox/client.mjs",
58
+ "default": "./dist/modules/sandbox/client.mjs"
59
+ },
60
+ "./sandbox/server": {
61
+ "types": "./dist/modules/sandbox/server.d.mts",
62
+ "import": "./dist/modules/sandbox/server.mjs",
63
+ "default": "./dist/modules/sandbox/server.mjs"
64
+ },
65
+ "./sandbox/mcp": {
66
+ "types": "./dist/modules/sandbox/mcp.d.mts",
67
+ "import": "./dist/modules/sandbox/mcp.mjs",
68
+ "default": "./dist/modules/sandbox/mcp.mjs"
69
+ },
70
+ "./sandbox/bytes": {
71
+ "types": "./dist/modules/sandbox/bytes.d.mts",
72
+ "import": "./dist/modules/sandbox/bytes.mjs",
73
+ "default": "./dist/modules/sandbox/bytes.mjs"
74
+ },
75
+ "./sandbox/convenience": {
76
+ "types": "./dist/modules/sandbox/convenience.d.mts",
77
+ "import": "./dist/modules/sandbox/convenience.mjs",
78
+ "default": "./dist/modules/sandbox/convenience.mjs"
79
+ },
80
+ "./sandbox/workspace-root": {
81
+ "types": "./dist/modules/sandbox/workspace-root.d.mts",
82
+ "import": "./dist/modules/sandbox/workspace-root.mjs",
83
+ "default": "./dist/modules/sandbox/workspace-root.mjs"
84
+ },
85
+ "./sandbox/open-scope-node": {
86
+ "types": "./dist/modules/sandbox/open-scope-node.d.mts",
87
+ "import": "./dist/modules/sandbox/open-scope-node.mjs",
88
+ "default": "./dist/modules/sandbox/open-scope-node.mjs"
89
+ },
90
+ "./conformance": {
91
+ "types": "./dist/modules/conformance/index.d.mts",
92
+ "import": "./dist/modules/conformance/index.mjs",
93
+ "default": "./dist/modules/conformance/index.mjs"
94
+ },
95
+ "./conformance/scripted-model": {
96
+ "types": "./dist/modules/conformance/scripted-model/index.d.mts",
97
+ "import": "./dist/modules/conformance/scripted-model/index.mjs",
98
+ "default": "./dist/modules/conformance/scripted-model/index.mjs"
99
+ },
100
+ "./json": {
101
+ "types": "./dist/modules/json.d.mts",
102
+ "import": "./dist/modules/json.mjs",
103
+ "default": "./dist/modules/json.mjs"
104
+ },
105
+ "./package.json": "./package.json",
106
+ "./mcp-content": {
107
+ "types": "./dist/modules/mcp-content.d.mts",
108
+ "import": "./dist/modules/mcp-content.mjs",
109
+ "default": "./dist/modules/mcp-content.mjs"
110
+ },
111
+ "./provider-ref": {
112
+ "types": "./dist/modules/provider-ref.d.mts",
113
+ "import": "./dist/modules/provider-ref.mjs",
114
+ "default": "./dist/modules/provider-ref.mjs"
115
+ },
116
+ "./manifest": {
117
+ "types": "./dist/modules/manifest.d.mts",
118
+ "import": "./dist/modules/manifest.mjs",
119
+ "default": "./dist/modules/manifest.mjs"
120
+ },
121
+ "./dynamic": {
122
+ "types": "./dist/modules/dynamic.d.mts",
123
+ "import": "./dist/modules/dynamic.mjs",
124
+ "default": "./dist/modules/dynamic.mjs"
125
+ },
126
+ "./semantic-events": {
127
+ "types": "./dist/modules/semantic-events.d.mts",
128
+ "import": "./dist/modules/semantic-events.mjs",
129
+ "default": "./dist/modules/semantic-events.mjs"
130
+ },
131
+ "./channel-context": {
132
+ "types": "./dist/modules/channel-context.d.mts",
133
+ "import": "./dist/modules/channel-context.mjs",
134
+ "default": "./dist/modules/channel-context.mjs"
135
+ },
136
+ "./sandbox/types": {
137
+ "types": "./dist/modules/sandbox/types.d.mts",
138
+ "import": "./dist/modules/sandbox/types.mjs",
139
+ "default": "./dist/modules/sandbox/types.mjs"
140
+ },
141
+ "./sandbox/snapshots": {
142
+ "types": "./dist/modules/sandbox/snapshots.d.mts",
143
+ "import": "./dist/modules/sandbox/snapshots.mjs",
144
+ "default": "./dist/modules/sandbox/snapshots.mjs"
145
+ },
146
+ "./sandbox/open-scope": {
147
+ "types": "./dist/modules/sandbox/open-scope.d.mts",
148
+ "import": "./dist/modules/sandbox/open-scope.mjs",
149
+ "default": "./dist/modules/sandbox/open-scope.mjs"
150
+ },
151
+ "./sandbox/frame-channel": {
152
+ "types": "./dist/modules/sandbox/frame-channel.d.mts",
153
+ "import": "./dist/modules/sandbox/frame-channel.mjs",
154
+ "default": "./dist/modules/sandbox/frame-channel.mjs"
155
+ },
156
+ "./sandbox/rpc-peer": {
157
+ "types": "./dist/modules/sandbox/rpc-peer.d.mts",
158
+ "import": "./dist/modules/sandbox/rpc-peer.mjs",
159
+ "default": "./dist/modules/sandbox/rpc-peer.mjs"
160
+ },
161
+ "./sandbox/stream-mux": {
162
+ "types": "./dist/modules/sandbox/stream-mux.d.mts",
163
+ "import": "./dist/modules/sandbox/stream-mux.mjs",
164
+ "default": "./dist/modules/sandbox/stream-mux.mjs"
165
+ },
166
+ "./channel-socket": {
167
+ "types": "./dist/modules/channel-socket.d.mts",
168
+ "import": "./dist/modules/channel-socket.mjs",
169
+ "default": "./dist/modules/channel-socket.mjs"
170
+ },
171
+ "./local-channel-socket": {
172
+ "types": "./dist/modules/local-channel-socket.d.mts",
173
+ "import": "./dist/modules/local-channel-socket.mjs",
174
+ "default": "./dist/modules/local-channel-socket.mjs"
175
+ }
176
+ },
177
+ "publishConfig": {
178
+ "access": "restricted",
179
+ "registry": "https://registry.npmjs.org/"
180
+ },
181
+ "dependencies": {
182
+ "@agentclientprotocol/sdk": "1.8.0",
183
+ "@finalai/acp-session": "0.1.0",
184
+ "@finalai/agent-protocol": "0.1.0",
185
+ "@modelcontextprotocol/client": "^2.1.0",
186
+ "@modelcontextprotocol/core": "^2.1.0",
187
+ "@modelcontextprotocol/server": "^2.1.0",
188
+ "re2js": "2.8.6",
189
+ "zod": "4.6.5"
190
+ },
191
+ "engines": {
192
+ "node": ">=26"
193
+ },
194
+ "repository": {
195
+ "type": "git",
196
+ "url": "git+https://github.com/final-company/packages-typescript.git",
197
+ "directory": "packages/@finalai/agent-provider"
198
+ }
199
+ }