foldkit-agent-native 0.2.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Patrick Glenn
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,119 @@
1
+ # `foldkit-agent-native`
2
+
3
+ Compiles a [`foldkit-agent`](../agent) contract into Agent Native actions.
4
+
5
+ It is checked against `@agent-native/core@0.177.1`; the integration suite uses
6
+ the real package registry, tool runtime, and schema wrapper. Full HTTP/MCP/A2A
7
+ deployments remain outside this package's test suite.
8
+
9
+ ## What it does
10
+
11
+ ```ts
12
+ import { AgentNative } from 'foldkit-agent-native'
13
+ import { registerPackageActions } from '@agent-native/core/server'
14
+
15
+ registerPackageActions(
16
+ AgentNative.actions({
17
+ definition: AppAgent,
18
+ resolveRuntime: ctx => runtimeFor(ctx),
19
+ }),
20
+ )
21
+ ```
22
+
23
+ One exposed capability becomes one entry, keyed by capability name, with its
24
+ description, advertised parameters and schema taken from the contract. Each
25
+ entry states `http: POST`, `requiresAuth: true`, and `readOnly: false` — a
26
+ capability dispatches a Message, so it is a write, and claiming otherwise would
27
+ let plan mode run it for real.
28
+
29
+ Nothing is written to disk. A registry has no file to go stale, so a removed
30
+ capability cannot leave behind an action that is still callable.
31
+
32
+ `resolveRuntime` is called **per invocation**, not once at registration, because
33
+ which Model a caller means depends on who is calling. The Runtime it returns must
34
+ already be bound for that caller: when a contract declares `authorize`,
35
+ `Agent.bind` requires a `principal` provider, so the identity mapping stays with
36
+ the application rather than being guessed from `userEmail`.
37
+
38
+ ## The dependency direction
39
+
40
+ Foldkit stays the source of truth. A generated `run` **only dispatches** —
41
+ application behaviour stays in `update`, which is the entire reason for
42
+ generating these rather than writing a second action layer beside the state
43
+ machine.
44
+
45
+ The action layer adds no authority of its own either. Availability,
46
+ authorization and input validation all still happen in the contract, and the
47
+ tests assert that an action refuses exactly what the contract refuses.
48
+
49
+ ## What `run` returns
50
+
51
+ `run` never throws for a contract failure. Unavailable, unauthorized, a failed
52
+ completion, or input the runtime itself rejects all resolve to
53
+ `{ ok: false, message }`; Agent Native records the call as completed and
54
+ serializes that object as the tool output. A surface that decides success from
55
+ the action's status alone therefore reads a refusal as a success -- read `ok`
56
+ instead. Only a host defect is caught, and it is flattened to a generic message
57
+ so application internals never reach the caller.
58
+
59
+ ## The schema bridge
60
+
61
+ The adapter exposes the encoded input schema as a Standard Schema validator,
62
+ rejecting undeclared fields. It preserves encoded values for `dispatchUnknown`
63
+ to decode once, including transforming schemas such as `NumberFromString`.
64
+
65
+ The subtlety is which conversion, and it fails silently:
66
+
67
+ | | `validate` | advertised parameters |
68
+ | --- | --- | --- |
69
+ | `toStandardSchemaV1` | yes | **empty** |
70
+ | `toStandardJSONSchemaV1` | no | full |
71
+ | the two copied together | yes | **empty** |
72
+ | both, called in turn on the same schema | yes | full |
73
+
74
+ All four are accepted without complaint, and three produce a tool an agent sees
75
+ as taking no input. Copying fails because the conversion reads the Effect schema
76
+ itself, so identity has to survive — and both helpers return that same schema,
77
+ sharing one `~standard`, so calling them in turn leaves a single object carrying
78
+ `jsonSchema` and `validate` alike. That is what this package does.
79
+
80
+ ## What it proves
81
+
82
+ Run `pnpm exec vitest run packages/agent-native/test/framework.test.ts` at the
83
+ repository root. No LLM credentials or network server are needed. The suite uses
84
+ an in-memory PGlite database for the framework's internal metadata lookups.
85
+
86
+ | Framework surface | Executable evidence |
87
+ | --- | --- |
88
+ | Package registry | `registerPackageActions` + `autoDiscoverActions` discovers the adapter entry. An actual app-local action file wins a name collision. |
89
+ | Agent tool runtime | `actionsToEngineTools` advertises the encoded schema; `executeAgentToolCall` changes the Foldkit Model for an authorized caller and refuses another caller. |
90
+ | Schema wrapper | `defineAction` derives parameters, preserves transforming input for one decode in Foldkit, and rejects extra fields. |
91
+
92
+ The framework is a development dependency and a pinned peer of this adapter.
93
+ It is not a dependency of `foldkit-agent`. The public adapter types are checked
94
+ against the real `ActionTool` type; only object input schemas are supported,
95
+ because the framework omits other input shapes from its tool list.
96
+
97
+ ## Limits and reuse decision
98
+
99
+ The registry and agent tool runtime can be reused without replacing Foldkit's
100
+ state machine. HTTP, MCP, A2A, CLI, UI queries, auth sessions, and deep links
101
+ still need their framework host and deployment wiring; this suite does not
102
+ claim an end-to-end test of those surfaces. Keep the independent MCP/A2A
103
+ adapters and direct WebMCP adapter.
104
+
105
+ The registry is static: it describes all declared capabilities, while Foldkit
106
+ checks availability at invocation time. The application maps a verified caller
107
+ to a principal when binding a server-held Runtime. Page-local state still belongs
108
+ to WebMCP; no browser RPC bridge is introduced.
109
+
110
+ The framework's package registry retains the first registration of a name and
111
+ skips names inherited from `Object.prototype`, including `__proto__`. Avoid
112
+ those names and restart the host after changing a registered contract. The
113
+ adapter's own returned record preserves these keys, but cannot fix that
114
+ downstream registry behavior.
115
+
116
+ This completes the bounded proof of concept in
117
+ [issue #22](https://github.com/doeixd/foldkit-plus/issues/22), not a claim that
118
+ every Agent Native subsystem is independently reusable. A full deployment test
119
+ of the HTTP, MCP, A2A, CLI, auth, and UI surfaces remains future work.
@@ -0,0 +1,92 @@
1
+ import { Agent } from "foldkit-agent";
2
+ import { ActionTool } from "@agent-native/core/server";
3
+ import { StandardSchemaV1 } from "effect/StandardSchema";
4
+ //#region src/actions.d.ts
5
+ type AgentRuntime = Agent.AgentRuntime<any, any, any, any, any>;
6
+ /**
7
+ * The request context Agent Native hands an action.
8
+ *
9
+ * Deliberately narrower than the framework's own `ActionRunContext`: the
10
+ * adapter promises only the identity a principal mapper needs, so its public
11
+ * surface does not grow with the framework's context. The framework still
12
+ * passes its full context through at runtime.
13
+ */
14
+ interface ActionRunContext {
15
+ readonly userEmail?: string | undefined;
16
+ readonly orgId?: string | null | undefined;
17
+ }
18
+ /** What an action reports back. `run` never decides anything itself. */
19
+ interface ActionResult {
20
+ readonly ok: boolean;
21
+ /** The Message tag that was dispatched, when one was. */
22
+ readonly tag?: string | undefined;
23
+ /** How the operation finished, when the capability declares completion. */
24
+ readonly completion?: 'completed' | 'failed' | undefined;
25
+ readonly message: string;
26
+ }
27
+ /** One entry of the record `registerPackageActions` takes. */
28
+ interface ActionEntry {
29
+ readonly tool: {
30
+ readonly description: string;
31
+ readonly parameters: NonNullable<ActionTool['parameters']>;
32
+ };
33
+ readonly run: (args: unknown, context?: ActionRunContext) => Promise<ActionResult>;
34
+ readonly schema: StandardSchemaV1<unknown, unknown>;
35
+ readonly http: {
36
+ readonly method: 'POST';
37
+ };
38
+ /** Defaults to true in the framework; stated so it is not left to a default. */
39
+ readonly requiresAuth: boolean;
40
+ /**
41
+ * Always false. A capability dispatches a Message into `update`, so it is a
42
+ * write however little it changes.
43
+ *
44
+ * This feeds plan-mode classification, where the dangerous direction is
45
+ * claiming read-only: plan mode would then run it for real. A resource read
46
+ * would be the read-only case, and resources are not exposed as actions yet.
47
+ */
48
+ readonly readOnly: false;
49
+ }
50
+ interface ActionsOptions {
51
+ readonly definition: Agent.Definition<any, any, any, any, any>;
52
+ /**
53
+ * Resolves the Runtime for one request.
54
+ *
55
+ * Called per invocation, because which Model a caller means depends on who is
56
+ * calling. The Runtime it returns must already be bound for that caller: when
57
+ * a contract declares `authorize`, `Agent.bind` requires a `principal`
58
+ * provider, so the identity mapping stays with the application instead of
59
+ * being guessed here from `userEmail`.
60
+ */
61
+ readonly resolveRuntime: (context: ActionRunContext) => AgentRuntime | Promise<AgentRuntime>;
62
+ /** Recorded on the invocation, so an audit log can tell these apart. */
63
+ readonly transport?: string | undefined;
64
+ }
65
+ /**
66
+ * Compiles the exposed capabilities into a package action registry.
67
+ *
68
+ * Hand the result to `registerPackageActions` from `@agent-native/core/server`,
69
+ * which merges it into the registry every surface reads. Nothing is written to
70
+ * disk, so no generated action can outlive the capability it came from.
71
+ *
72
+ * `run` only dispatches. Application behaviour stays in `update`, and the action
73
+ * adds no authority of its own: availability, authorization and input
74
+ * validation all still happen in the contract.
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * registerPackageActions(
79
+ * AgentNative.actions({
80
+ * definition: AppAgent,
81
+ * resolveRuntime: ctx => runtimeFor(ctx),
82
+ * }),
83
+ * )
84
+ * ```
85
+ */
86
+ declare const actions: (options: ActionsOptions) => Record<string, ActionEntry>;
87
+ declare namespace agentNative_d_exports {
88
+ export { ActionEntry, ActionResult, ActionRunContext, ActionsOptions, actions };
89
+ }
90
+ //#endregion
91
+ export { type ActionEntry, type ActionResult, type ActionRunContext, type ActionsOptions, agentNative_d_exports as AgentNative };
92
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/actions.ts","../src/agentNative.ts"],"mappings":";;;;KAKK,eAAe,MAAM;;;;;;;;;UAUT;WACN;WACA;;;UAIM;WACN;;WAEA;;WAEA;WACA;;;UAIM;WACN;aACE;aACA,YAAY,YAAY;;WAE1B,MAAM,eAAe,UAAU,qBAAqB,QAAQ;WAC5D,QAAQ;WACR;aAAiB;;;WAEjB;;;;;;;;;WASA;;UA0BM;WACN,YAAY,MAAM;;;;;;;;;;WAWlB,iBAAiB,SAAS,qBAAqB,eAAe,QAAQ;;WAGtE;;;;;;;;;;;;;;;;;;;;;;;cAwBE,UAAW,SAAS,mBAAiB,eAAe"}
package/dist/index.mjs ADDED
@@ -0,0 +1,95 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
+ import { Agent } from "foldkit-agent";
3
+ import { Effect, Schema } from "effect";
4
+ //#region src/actions.ts
5
+ /**
6
+ * A Standard Schema that both validates and advertises its shape.
7
+ *
8
+ * Neither Effect helper does both alone, and the difference is silent:
9
+ * `toStandardSchemaV1` carries `validate` but no `jsonSchema`, and
10
+ * `defineAction` accepts it while advertising a tool that takes **no input**;
11
+ * `toStandardJSONSchemaV1` carries the `jsonSchema` those parameters come from
12
+ * but no `validate`.
13
+ *
14
+ * Both return the schema itself and share one `~standard`, so calling them in
15
+ * turn leaves a single object carrying both. Copying them into a new object
16
+ * would not work: the conversion reads the Effect schema, so identity matters.
17
+ */
18
+ const describedSchema = (schema) => {
19
+ const described = Schema.toStandardJSONSchemaV1(schema);
20
+ Schema.toStandardSchemaV1(schema, { parseOptions: { onExcessProperty: "error" } });
21
+ return described;
22
+ };
23
+ /**
24
+ * Compiles the exposed capabilities into a package action registry.
25
+ *
26
+ * Hand the result to `registerPackageActions` from `@agent-native/core/server`,
27
+ * which merges it into the registry every surface reads. Nothing is written to
28
+ * disk, so no generated action can outlive the capability it came from.
29
+ *
30
+ * `run` only dispatches. Application behaviour stays in `update`, and the action
31
+ * adds no authority of its own: availability, authorization and input
32
+ * validation all still happen in the contract.
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * registerPackageActions(
37
+ * AgentNative.actions({
38
+ * definition: AppAgent,
39
+ * resolveRuntime: ctx => runtimeFor(ctx),
40
+ * }),
41
+ * )
42
+ * ```
43
+ */
44
+ const actions = (options) => {
45
+ const transport = options.transport ?? "agent-native";
46
+ const entries = Object.create(null);
47
+ for (const variant of options.definition.messages.variants) {
48
+ if (variant.inputJsonSchema.type !== "object") throw new Error(`Agent Native capability "${variant.name}" requires an object input schema`);
49
+ entries[variant.name] = {
50
+ tool: {
51
+ description: variant.description,
52
+ parameters: {
53
+ properties: {},
54
+ ...variant.inputJsonSchema
55
+ }
56
+ },
57
+ schema: describedSchema(Schema.toEncoded(variant.inputSchema)),
58
+ http: { method: "POST" },
59
+ requiresAuth: true,
60
+ readOnly: false,
61
+ run: async (args, context) => {
62
+ const agent = await options.resolveRuntime(context ?? {});
63
+ let outcome;
64
+ try {
65
+ outcome = await Effect.runPromise(Effect.result(agent.messages.dispatchUnknown(variant.name, args, { transport })));
66
+ } catch {
67
+ return {
68
+ ok: false,
69
+ message: `Capability "${variant.name}" failed unexpectedly`
70
+ };
71
+ }
72
+ if (outcome._tag === "Failure") return {
73
+ ok: false,
74
+ message: outcome.failure.message
75
+ };
76
+ const result = outcome.success;
77
+ const summary = Agent.summarize(result);
78
+ return {
79
+ ok: summary.ok,
80
+ tag: result.tag,
81
+ ...result.completion === void 0 ? {} : { completion: result.completion.status },
82
+ message: summary.text
83
+ };
84
+ }
85
+ };
86
+ }
87
+ return entries;
88
+ };
89
+ //#endregion
90
+ //#region src/agentNative.ts
91
+ var agentNative_exports = /* @__PURE__ */ __exportAll({ actions: () => actions });
92
+ //#endregion
93
+ export { agentNative_exports as AgentNative };
94
+
95
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/actions.ts","../src/agentNative.ts"],"sourcesContent":["import { Agent } from 'foldkit-agent'\nimport type { ActionTool } from '@agent-native/core/server'\nimport { Effect, Schema } from 'effect'\nimport type { StandardSchemaV1 } from 'effect/StandardSchema'\n\ntype AgentRuntime = Agent.AgentRuntime<any, any, any, any, any>\n\n/**\n * The request context Agent Native hands an action.\n *\n * Deliberately narrower than the framework's own `ActionRunContext`: the\n * adapter promises only the identity a principal mapper needs, so its public\n * surface does not grow with the framework's context. The framework still\n * passes its full context through at runtime.\n */\nexport interface ActionRunContext {\n readonly userEmail?: string | undefined\n readonly orgId?: string | null | undefined\n}\n\n/** What an action reports back. `run` never decides anything itself. */\nexport interface ActionResult {\n readonly ok: boolean\n /** The Message tag that was dispatched, when one was. */\n readonly tag?: string | undefined\n /** How the operation finished, when the capability declares completion. */\n readonly completion?: 'completed' | 'failed' | undefined\n readonly message: string\n}\n\n/** One entry of the record `registerPackageActions` takes. */\nexport interface ActionEntry {\n readonly tool: {\n readonly description: string\n readonly parameters: NonNullable<ActionTool['parameters']>\n }\n readonly run: (args: unknown, context?: ActionRunContext) => Promise<ActionResult>\n readonly schema: StandardSchemaV1<unknown, unknown>\n readonly http: { readonly method: 'POST' }\n /** Defaults to true in the framework; stated so it is not left to a default. */\n readonly requiresAuth: boolean\n /**\n * Always false. A capability dispatches a Message into `update`, so it is a\n * write however little it changes.\n *\n * This feeds plan-mode classification, where the dangerous direction is\n * claiming read-only: plan mode would then run it for real. A resource read\n * would be the read-only case, and resources are not exposed as actions yet.\n */\n readonly readOnly: false\n}\n\n/**\n * A Standard Schema that both validates and advertises its shape.\n *\n * Neither Effect helper does both alone, and the difference is silent:\n * `toStandardSchemaV1` carries `validate` but no `jsonSchema`, and\n * `defineAction` accepts it while advertising a tool that takes **no input**;\n * `toStandardJSONSchemaV1` carries the `jsonSchema` those parameters come from\n * but no `validate`.\n *\n * Both return the schema itself and share one `~standard`, so calling them in\n * turn leaves a single object carrying both. Copying them into a new object\n * would not work: the conversion reads the Effect schema, so identity matters.\n */\nconst describedSchema = (\n schema: Parameters<typeof Schema.toStandardSchemaV1>[0],\n): StandardSchemaV1<unknown, unknown> => {\n const described = Schema.toStandardJSONSchemaV1(schema as never)\n // Stripping fields here would hide invalid input from dispatch's strict decoder.\n Schema.toStandardSchemaV1(schema, { parseOptions: { onExcessProperty: 'error' } })\n\n return described as unknown as StandardSchemaV1<unknown, unknown>\n}\n\nexport interface ActionsOptions {\n readonly definition: Agent.Definition<any, any, any, any, any>\n\n /**\n * Resolves the Runtime for one request.\n *\n * Called per invocation, because which Model a caller means depends on who is\n * calling. The Runtime it returns must already be bound for that caller: when\n * a contract declares `authorize`, `Agent.bind` requires a `principal`\n * provider, so the identity mapping stays with the application instead of\n * being guessed here from `userEmail`.\n */\n readonly resolveRuntime: (context: ActionRunContext) => AgentRuntime | Promise<AgentRuntime>\n\n /** Recorded on the invocation, so an audit log can tell these apart. */\n readonly transport?: string | undefined\n}\n\n/**\n * Compiles the exposed capabilities into a package action registry.\n *\n * Hand the result to `registerPackageActions` from `@agent-native/core/server`,\n * which merges it into the registry every surface reads. Nothing is written to\n * disk, so no generated action can outlive the capability it came from.\n *\n * `run` only dispatches. Application behaviour stays in `update`, and the action\n * adds no authority of its own: availability, authorization and input\n * validation all still happen in the contract.\n *\n * @example\n * ```ts\n * registerPackageActions(\n * AgentNative.actions({\n * definition: AppAgent,\n * resolveRuntime: ctx => runtimeFor(ctx),\n * }),\n * )\n * ```\n */\nexport const actions = (options: ActionsOptions): Record<string, ActionEntry> => {\n const transport = options.transport ?? 'agent-native'\n const entries: Record<string, ActionEntry> = Object.create(null)\n\n for (const variant of options.definition.messages.variants) {\n if (variant.inputJsonSchema.type !== 'object') {\n throw new Error(`Agent Native capability \"${variant.name}\" requires an object input schema`)\n }\n entries[variant.name] = {\n tool: {\n description: variant.description,\n parameters: {\n properties: {},\n ...variant.inputJsonSchema,\n } as NonNullable<ActionTool['parameters']>,\n },\n // Validated on the *encoded* side. The framework hands `run` whatever\n // this schema parsed, and `run` hands that to `dispatchUnknown`, which\n // decodes. A decoding schema here would decode a transforming input\n // twice, so the contract would then reject its own validated value.\n schema: describedSchema(Schema.toEncoded(variant.inputSchema)),\n http: { method: 'POST' },\n requiresAuth: true,\n readOnly: false,\n\n run: async (args: unknown, context?: ActionRunContext): Promise<ActionResult> => {\n // Resolution is the application's code, and its throw is deliberate --\n // a principal mapper refusing an unauthenticated caller, say. Let it\n // through rather than reporting it as this capability failing.\n const agent = await options.resolveRuntime(context ?? {})\n\n let outcome\n try {\n outcome = await Effect.runPromise(\n Effect.result(agent.messages.dispatchUnknown(variant.name, args, { transport })),\n )\n } catch {\n // `Effect.result` captures expected failures but not defects, and a\n // defect's text may carry application internals.\n return { ok: false, message: `Capability \"${variant.name}\" failed unexpectedly` }\n }\n\n if (outcome._tag === 'Failure') {\n return { ok: false, message: outcome.failure.message }\n }\n\n const result = outcome.success\n const summary = Agent.summarize(result)\n return {\n ok: summary.ok,\n tag: result.tag,\n ...(result.completion === undefined ? {} : { completion: result.completion.status }),\n message: summary.text,\n }\n },\n }\n }\n\n return entries\n}\n","export {\n actions,\n type ActionEntry,\n type ActionResult,\n type ActionRunContext,\n type ActionsOptions,\n} from './actions.js'\n"],"mappings":";;;;;;;;;;;;;;;;;AAiEA,MAAM,mBACJ,WACuC;CACvC,MAAM,YAAY,OAAO,uBAAuB,MAAe;CAE/D,OAAO,mBAAmB,QAAQ,EAAE,cAAc,EAAE,kBAAkB,QAAQ,EAAE,CAAC;CAEjF,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;;AAyCA,MAAa,WAAW,YAAyD;CAC/E,MAAM,YAAY,QAAQ,aAAa;CACvC,MAAM,UAAuC,OAAO,OAAO,IAAI;CAE/D,KAAK,MAAM,WAAW,QAAQ,WAAW,SAAS,UAAU;EAC1D,IAAI,QAAQ,gBAAgB,SAAS,UACnC,MAAM,IAAI,MAAM,4BAA4B,QAAQ,KAAK,kCAAkC;EAE7F,QAAQ,QAAQ,QAAQ;GACtB,MAAM;IACJ,aAAa,QAAQ;IACrB,YAAY;KACV,YAAY,CAAC;KACb,GAAG,QAAQ;IACb;GACF;GAKA,QAAQ,gBAAgB,OAAO,UAAU,QAAQ,WAAW,CAAC;GAC7D,MAAM,EAAE,QAAQ,OAAO;GACvB,cAAc;GACd,UAAU;GAEV,KAAK,OAAO,MAAe,YAAsD;IAI/E,MAAM,QAAQ,MAAM,QAAQ,eAAe,WAAW,CAAC,CAAC;IAExD,IAAI;IACJ,IAAI;KACF,UAAU,MAAM,OAAO,WACrB,OAAO,OAAO,MAAM,SAAS,gBAAgB,QAAQ,MAAM,MAAM,EAAE,UAAU,CAAC,CAAC,CACjF;IACF,QAAQ;KAGN,OAAO;MAAE,IAAI;MAAO,SAAS,eAAe,QAAQ,KAAK;KAAuB;IAClF;IAEA,IAAI,QAAQ,SAAS,WACnB,OAAO;KAAE,IAAI;KAAO,SAAS,QAAQ,QAAQ;IAAQ;IAGvD,MAAM,SAAS,QAAQ;IACvB,MAAM,UAAU,MAAM,UAAU,MAAM;IACtC,OAAO;KACL,IAAI,QAAQ;KACZ,KAAK,OAAO;KACZ,GAAI,OAAO,eAAe,KAAA,IAAY,CAAC,IAAI,EAAE,YAAY,OAAO,WAAW,OAAO;KAClF,SAAS,QAAQ;IACnB;GACF;EACF;CACF;CAEA,OAAO;AACT"}
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll as t };
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "foldkit-agent-native",
3
+ "version": "0.2.0",
4
+ "description": "Agent Native adapter for foldkit-agent. Compiles an exposed Foldkit contract into Agent Native actions.",
5
+ "keywords": [
6
+ "foldkit",
7
+ "effect",
8
+ "agents",
9
+ "agent-native",
10
+ "tools"
11
+ ],
12
+ "type": "module",
13
+ "license": "MIT",
14
+ "author": "Patrick Glenn <doeixd@gmail.com>",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/doeixd/foldkit-plus.git",
18
+ "directory": "packages/agent-native"
19
+ },
20
+ "homepage": "https://github.com/doeixd/foldkit-plus/tree/main/packages/agent-native#readme",
21
+ "bugs": {
22
+ "url": "https://github.com/doeixd/foldkit-plus/issues"
23
+ },
24
+ "sideEffects": false,
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.mts",
31
+ "import": "./dist/index.mjs"
32
+ }
33
+ },
34
+ "files": [
35
+ "dist",
36
+ "README.md",
37
+ "LICENSE"
38
+ ],
39
+ "peerDependencies": {
40
+ "@agent-native/core": "0.177.1",
41
+ "effect": "^4.0.0-rc.112",
42
+ "foldkit": "^0.158.2",
43
+ "foldkit-agent": "^0.2.0"
44
+ },
45
+ "devDependencies": {
46
+ "@agent-native/core": "0.177.1",
47
+ "effect": "4.0.0-rc.112",
48
+ "foldkit": "0.158.2",
49
+ "tsdown": "^0.23.0",
50
+ "typescript": "^5.7.2",
51
+ "foldkit-agent": "0.2.0"
52
+ },
53
+ "scripts": {
54
+ "build": "tsdown",
55
+ "typecheck": "tsc -b"
56
+ }
57
+ }