@48nauts/agent-core 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.
Files changed (43) hide show
  1. package/LICENSE +25 -0
  2. package/README.md +7 -0
  3. package/dist/adapter/db.d.ts +60 -0
  4. package/dist/adapter/db.d.ts.map +1 -0
  5. package/dist/adapter/db.js +10 -0
  6. package/dist/adapter/db.js.map +1 -0
  7. package/dist/adapter/index.d.ts +2 -0
  8. package/dist/adapter/index.d.ts.map +1 -0
  9. package/dist/adapter/index.js +2 -0
  10. package/dist/adapter/index.js.map +1 -0
  11. package/dist/index.d.ts +9 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +4 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/runtime/adapters/index.d.ts +3 -0
  16. package/dist/runtime/adapters/index.d.ts.map +1 -0
  17. package/dist/runtime/adapters/index.js +3 -0
  18. package/dist/runtime/adapters/index.js.map +1 -0
  19. package/dist/runtime/adapters/openai-function.d.ts +37 -0
  20. package/dist/runtime/adapters/openai-function.d.ts.map +1 -0
  21. package/dist/runtime/adapters/openai-function.js +30 -0
  22. package/dist/runtime/adapters/openai-function.js.map +1 -0
  23. package/dist/runtime/adapters/pi-extension.d.ts +26 -0
  24. package/dist/runtime/adapters/pi-extension.d.ts.map +1 -0
  25. package/dist/runtime/adapters/pi-extension.js +48 -0
  26. package/dist/runtime/adapters/pi-extension.js.map +1 -0
  27. package/dist/runtime/create-agent.d.ts +23 -0
  28. package/dist/runtime/create-agent.d.ts.map +1 -0
  29. package/dist/runtime/create-agent.js +37 -0
  30. package/dist/runtime/create-agent.js.map +1 -0
  31. package/dist/runtime/ctx-extras.d.ts +20 -0
  32. package/dist/runtime/ctx-extras.d.ts.map +1 -0
  33. package/dist/runtime/ctx-extras.js +13 -0
  34. package/dist/runtime/ctx-extras.js.map +1 -0
  35. package/dist/runtime/index.d.ts +6 -0
  36. package/dist/runtime/index.d.ts.map +1 -0
  37. package/dist/runtime/index.js +4 -0
  38. package/dist/runtime/index.js.map +1 -0
  39. package/dist/runtime/tool.d.ts +61 -0
  40. package/dist/runtime/tool.d.ts.map +1 -0
  41. package/dist/runtime/tool.js +2 -0
  42. package/dist/runtime/tool.js.map +1 -0
  43. package/package.json +54 -0
package/LICENSE ADDED
@@ -0,0 +1,25 @@
1
+ SPDX-License-Identifier: AGPL-3.0-or-later
2
+
3
+ @48nauts/agent-core (NautCore)
4
+ Copyright (C) 2026 48Nauts (Andre / hello@48nauts.com)
5
+
6
+ This program is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU Affero General Public License as published by
8
+ the Free Software Foundation, either version 3 of the License, or
9
+ (at your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU Affero General Public License for more details.
15
+
16
+ You should have received a copy of the GNU Affero General Public License
17
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
18
+
19
+ ---
20
+
21
+ NOTE: This file is the SPDX header + short notice. Before this repo is made
22
+ public, replace the section below with the full AGPL-3.0 license text from
23
+ https://www.gnu.org/licenses/agpl-3.0.txt (or run `curl -o LICENSE.full https://www.gnu.org/licenses/agpl-3.0.txt`).
24
+ The SPDX header above is the legally-binding identifier; the long text is the
25
+ canonical reference required for public distribution.
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # @48nauts/agent-core
2
+
3
+ Runtime + workflow primitives + adapter interfaces. The kernel of NautCore.
4
+
5
+ Wraps `@earendil-works/pi-agent-core` for now. May graduate to native runtime later (planned: `NativeAgentRuntime`).
6
+
7
+ See [`../../INTERFACE.md`](../../INTERFACE.md) for the public surface.
@@ -0,0 +1,60 @@
1
+ /**
2
+ * DbAdapter — the dependency-injection seam between @48nauts/tools-crud and the
3
+ * consumer's actual database. Drizzle, Prisma, or any future ORM wires itself
4
+ * into this shape, and the CRUD tools are free of vendor concerns.
5
+ *
6
+ * Sprint 01: the canonical KMU shape (projects/tasks/notes). Grows as more
7
+ * consumers join.
8
+ */
9
+ export interface ProjectRecord {
10
+ id: string;
11
+ name: string;
12
+ description: string;
13
+ createdAt: number;
14
+ updatedAt: number;
15
+ }
16
+ export type TaskStatus = 'todo' | 'in_progress' | 'blocked' | 'done';
17
+ export type TaskPriority = 'low' | 'medium' | 'high';
18
+ export interface TaskRecord {
19
+ id: string;
20
+ projectId: string;
21
+ title: string;
22
+ description: string;
23
+ status: TaskStatus;
24
+ priority: TaskPriority;
25
+ dueDate?: string;
26
+ createdAt: number;
27
+ }
28
+ export interface NoteRecord {
29
+ id: string;
30
+ projectId: string;
31
+ title: string;
32
+ content: string;
33
+ createdAt: number;
34
+ }
35
+ export interface ProjectsRepo {
36
+ get(id: string): Promise<ProjectRecord | null>;
37
+ list(): Promise<ProjectRecord[]>;
38
+ /** Fuzzy search by name. Implementations may use ILIKE / FTS / trigram — caller doesn't care. */
39
+ search(query: string, limit?: number): Promise<ProjectRecord[]>;
40
+ create(input: Omit<ProjectRecord, 'id' | 'createdAt' | 'updatedAt'>): Promise<ProjectRecord>;
41
+ update(id: string, patch: Partial<Omit<ProjectRecord, 'id' | 'createdAt'>>): Promise<ProjectRecord>;
42
+ }
43
+ export interface TasksRepo {
44
+ get(id: string): Promise<TaskRecord | null>;
45
+ listByProject(projectId: string, filter?: {
46
+ status?: TaskStatus;
47
+ }): Promise<TaskRecord[]>;
48
+ create(input: Omit<TaskRecord, 'id' | 'createdAt'>): Promise<TaskRecord>;
49
+ update(id: string, patch: Partial<Omit<TaskRecord, 'id' | 'createdAt'>>): Promise<TaskRecord>;
50
+ }
51
+ export interface NotesRepo {
52
+ listByProject(projectId: string): Promise<NoteRecord[]>;
53
+ create(input: Omit<NoteRecord, 'id' | 'createdAt'>): Promise<NoteRecord>;
54
+ }
55
+ export interface DbAdapter {
56
+ projects: ProjectsRepo;
57
+ tasks: TasksRepo;
58
+ notes: NotesRepo;
59
+ }
60
+ //# sourceMappingURL=db.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../src/adapter/db.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,aAAa,GAAG,SAAS,GAAG,MAAM,CAAA;AACpE,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEpD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,UAAU,CAAA;IAClB,QAAQ,EAAE,YAAY,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAA;IAC9C,IAAI,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC,CAAA;IAChC,iGAAiG;IACjG,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAA;IAC/D,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,WAAW,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;IAC5F,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,WAAW,CAAC,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;CACpG;AAED,MAAM,WAAW,SAAS;IACxB,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAA;IAC3C,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,UAAU,CAAA;KAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IACzF,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IACxE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,WAAW,CAAC,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;CAC9F;AAED,MAAM,WAAW,SAAS;IACxB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IACvD,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;CACzE;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,YAAY,CAAA;IACtB,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,EAAE,SAAS,CAAA;CACjB"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * DbAdapter — the dependency-injection seam between @48nauts/tools-crud and the
3
+ * consumer's actual database. Drizzle, Prisma, or any future ORM wires itself
4
+ * into this shape, and the CRUD tools are free of vendor concerns.
5
+ *
6
+ * Sprint 01: the canonical KMU shape (projects/tasks/notes). Grows as more
7
+ * consumers join.
8
+ */
9
+ export {};
10
+ //# sourceMappingURL=db.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"db.js","sourceRoot":"","sources":["../../src/adapter/db.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
@@ -0,0 +1,2 @@
1
+ export type { DbAdapter, ProjectsRepo, TasksRepo, NotesRepo, ProjectRecord, TaskRecord, NoteRecord, TaskStatus, TaskPriority, } from './db.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapter/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,SAAS,EACT,YAAY,EACZ,SAAS,EACT,SAAS,EACT,aAAa,EACb,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,GACb,MAAM,SAAS,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/adapter/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ export declare const VERSION = "0.0.1";
2
+ export { createAgent } from './runtime/index.js';
3
+ export type { CreateAgentOpts, LlmProvider } from './runtime/index.js';
4
+ export type { ToolDef, AnyToolDef, ToolContext, ToolProgressUpdate } from './runtime/index.js';
5
+ export { requireDb, MissingExtraError, type DbExtras, registerToolsWithPi, toPiExtension, toOpenAiFunction, toOpenAiFunctions, runOpenAiTool, } from './runtime/index.js';
6
+ export type { PiAdapterOpts, OpenAiFunctionTool } from './runtime/index.js';
7
+ export type { DbAdapter, ProjectsRepo, TasksRepo, NotesRepo, ProjectRecord, TaskRecord, NoteRecord, TaskStatus, TaskPriority, } from './adapter/index.js';
8
+ export type { AgentTool, AgentMessage, Agent } from '@earendil-works/pi-agent-core';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAA;AAE9B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEtE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAC9F,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,KAAK,QAAQ,EACb,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,GACd,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAE3E,YAAY,EACV,SAAS,EACT,YAAY,EACZ,SAAS,EACT,SAAS,EACT,aAAa,EACb,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,GACb,MAAM,oBAAoB,CAAA;AAG3B,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export const VERSION = '0.0.1';
2
+ export { createAgent } from './runtime/index.js';
3
+ export { requireDb, MissingExtraError, registerToolsWithPi, toPiExtension, toOpenAiFunction, toOpenAiFunctions, runOpenAiTool, } from './runtime/index.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAA;AAE9B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAIhD,OAAO,EACL,SAAS,EACT,iBAAiB,EAEjB,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,GACd,MAAM,oBAAoB,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { registerToolsWithPi, toPiExtension, type PiAdapterOpts, } from './pi-extension.js';
2
+ export { toOpenAiFunction, toOpenAiFunctions, runOpenAiTool, type OpenAiFunctionTool, } from './openai-function.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/adapters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,KAAK,aAAa,GACnB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,KAAK,kBAAkB,GACxB,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { registerToolsWithPi, toPiExtension, } from './pi-extension.js';
2
+ export { toOpenAiFunction, toOpenAiFunctions, runOpenAiTool, } from './openai-function.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime/adapters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,aAAa,GAEd,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,GAEd,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * OpenAI adapter — turn ToolDefs into OpenAI function-calling shapes.
3
+ *
4
+ * import { weatherTool } from '@48nauts/tools-generic/weather'
5
+ * import { toOpenAiFunctions, runOpenAiTool } from '@48nauts/agent-core/runtime'
6
+ *
7
+ * const tools = toOpenAiFunctions([weatherTool])
8
+ * // ... pass `tools` to OpenAI SDK's chat.completions.create()
9
+ *
10
+ * // When the model calls a tool:
11
+ * const result = await runOpenAiTool([weatherTool], toolCall.function.name, JSON.parse(toolCall.function.arguments))
12
+ *
13
+ * TypeBox `Type.Object(...)` IS a JSON Schema object at runtime, so it's
14
+ * passed straight through to OpenAI as `function.parameters`.
15
+ */
16
+ import type { AnyToolDef, ToolContext } from '../tool.js';
17
+ export interface OpenAiFunctionTool {
18
+ type: 'function';
19
+ function: {
20
+ name: string;
21
+ description: string;
22
+ parameters: unknown;
23
+ };
24
+ }
25
+ export declare function toOpenAiFunction(tool: AnyToolDef): OpenAiFunctionTool;
26
+ export declare function toOpenAiFunctions(tools: AnyToolDef[]): OpenAiFunctionTool[];
27
+ /**
28
+ * Dispatch a single OpenAI tool call to the matching ToolDef and return its
29
+ * raw result. Callers are responsible for serialising the result into the
30
+ * tool message that goes back to the model (typically `JSON.stringify`).
31
+ *
32
+ * Throws if no tool matches `name`. Validation of `args` against the tool's
33
+ * TypeBox schema is left to the caller (use `Value.Check` from `@sinclair/typebox/value`)
34
+ * — the kernel stays validation-policy-free.
35
+ */
36
+ export declare function runOpenAiTool(tools: AnyToolDef[], name: string, args: unknown, ctx?: ToolContext): Promise<unknown>;
37
+ //# sourceMappingURL=openai-function.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openai-function.d.ts","sourceRoot":"","sources":["../../../src/runtime/adapters/openai-function.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAEzD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,UAAU,CAAA;IAChB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAA;QACZ,WAAW,EAAE,MAAM,CAAA;QACnB,UAAU,EAAE,OAAO,CAAA;KACpB,CAAA;CACF;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,kBAAkB,CASrE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,kBAAkB,EAAE,CAE3E;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,UAAU,EAAE,EACnB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EACb,GAAG,CAAC,EAAE,WAAW,GAChB,OAAO,CAAC,OAAO,CAAC,CAMlB"}
@@ -0,0 +1,30 @@
1
+ export function toOpenAiFunction(tool) {
2
+ return {
3
+ type: 'function',
4
+ function: {
5
+ name: tool.name,
6
+ description: tool.description,
7
+ parameters: tool.params,
8
+ },
9
+ };
10
+ }
11
+ export function toOpenAiFunctions(tools) {
12
+ return tools.map(toOpenAiFunction);
13
+ }
14
+ /**
15
+ * Dispatch a single OpenAI tool call to the matching ToolDef and return its
16
+ * raw result. Callers are responsible for serialising the result into the
17
+ * tool message that goes back to the model (typically `JSON.stringify`).
18
+ *
19
+ * Throws if no tool matches `name`. Validation of `args` against the tool's
20
+ * TypeBox schema is left to the caller (use `Value.Check` from `@sinclair/typebox/value`)
21
+ * — the kernel stays validation-policy-free.
22
+ */
23
+ export async function runOpenAiTool(tools, name, args, ctx) {
24
+ const tool = tools.find((t) => t.name === name);
25
+ if (!tool) {
26
+ throw new Error(`Unknown tool: ${name}`);
27
+ }
28
+ return tool.execute(args, ctx);
29
+ }
30
+ //# sourceMappingURL=openai-function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openai-function.js","sourceRoot":"","sources":["../../../src/runtime/adapters/openai-function.ts"],"names":[],"mappings":"AA0BA,MAAM,UAAU,gBAAgB,CAAC,IAAgB;IAC/C,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE;YACR,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,UAAU,EAAE,IAAI,CAAC,MAAM;SACxB;KACF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAmB;IACnD,OAAO,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAA;AACpC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,KAAmB,EACnB,IAAY,EACZ,IAAa,EACb,GAAiB;IAEjB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAA;IAC/C,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAA;IAC1C,CAAC;IACD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAa,EAAE,GAAG,CAAC,CAAA;AACzC,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Pi adapter — turn a neutral ToolDef into a Pi extension factory.
3
+ *
4
+ * Usage from a Pi extension entrypoint:
5
+ *
6
+ * import { weatherTool } from '@48nauts/tools-generic/weather'
7
+ * import { toPiExtension } from '@48nauts/agent-core/runtime'
8
+ *
9
+ * export default toPiExtension(weatherTool)
10
+ *
11
+ * Or register many tools via one factory:
12
+ *
13
+ * export default registerToolsWithPi([weatherTool, councilReviewTool])
14
+ *
15
+ * pi-coding-agent is a peer dep — agent-core does not pull in Pi at runtime.
16
+ * Consumers using these adapters must install `@earendil-works/pi-coding-agent`.
17
+ */
18
+ import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';
19
+ import type { AnyToolDef } from '../tool.js';
20
+ export interface PiAdapterOpts {
21
+ /** Host-supplied extras (e.g. DbAdapter) forwarded to every tool's ctx.extras. */
22
+ extras?: Record<string, unknown>;
23
+ }
24
+ export declare function registerToolsWithPi(tools: AnyToolDef[], opts?: PiAdapterOpts): (pi: ExtensionAPI) => void;
25
+ export declare function toPiExtension(tool: AnyToolDef, opts?: PiAdapterOpts): (pi: ExtensionAPI) => void;
26
+ //# sourceMappingURL=pi-extension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pi-extension.d.ts","sourceRoot":"","sources":["../../../src/runtime/adapters/pi-extension.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,KAAK,EAAE,UAAU,EAAmC,MAAM,YAAY,CAAA;AAmB7E,MAAM,WAAW,aAAa;IAC5B,kFAAkF;IAClF,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACjC;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,UAAU,EAAE,EACnB,IAAI,GAAE,aAAkB,GACvB,CAAC,EAAE,EAAE,YAAY,KAAK,IAAI,CA4B5B;AAED,wBAAgB,aAAa,CAC3B,IAAI,EAAE,UAAU,EAChB,IAAI,GAAE,aAAkB,GACvB,CAAC,EAAE,EAAE,YAAY,KAAK,IAAI,CAE5B"}
@@ -0,0 +1,48 @@
1
+ /** Pi expects content as TextContent | ImageContent; we only emit text here. */
2
+ function toPiContent(text) {
3
+ return [{ type: 'text', text }];
4
+ }
5
+ function asText(result) {
6
+ if (typeof result === 'string')
7
+ return result;
8
+ return JSON.stringify(result, null, 2);
9
+ }
10
+ function asDetails(result) {
11
+ if (result && typeof result === 'object' && !Array.isArray(result)) {
12
+ return result;
13
+ }
14
+ return { result };
15
+ }
16
+ export function registerToolsWithPi(tools, opts = {}) {
17
+ return (pi) => {
18
+ for (const tool of tools) {
19
+ pi.registerTool({
20
+ name: tool.name,
21
+ label: tool.label ?? tool.name,
22
+ description: tool.description,
23
+ parameters: tool.params,
24
+ async execute(_toolCallId, params, signal, onUpdate) {
25
+ const ctx = {
26
+ signal,
27
+ extras: opts.extras,
28
+ onUpdate: (update) => {
29
+ onUpdate?.({
30
+ content: update.content,
31
+ details: (update.details ?? {}),
32
+ });
33
+ },
34
+ };
35
+ const result = await tool.execute(params, ctx);
36
+ return {
37
+ content: toPiContent(asText(result)),
38
+ details: asDetails(result),
39
+ };
40
+ },
41
+ });
42
+ }
43
+ };
44
+ }
45
+ export function toPiExtension(tool, opts = {}) {
46
+ return registerToolsWithPi([tool], opts);
47
+ }
48
+ //# sourceMappingURL=pi-extension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pi-extension.js","sourceRoot":"","sources":["../../../src/runtime/adapters/pi-extension.ts"],"names":[],"mappings":"AAoBA,gFAAgF;AAChF,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,CAAA;AAC1C,CAAC;AAED,SAAS,MAAM,CAAC,MAAe;IAC7B,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAA;IAC7C,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AACxC,CAAC;AAED,SAAS,SAAS,CAAC,MAAe;IAChC,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACnE,OAAO,MAAiC,CAAA;IAC1C,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,CAAA;AACnB,CAAC;AAOD,MAAM,UAAU,mBAAmB,CACjC,KAAmB,EACnB,OAAsB,EAAE;IAExB,OAAO,CAAC,EAAgB,EAAE,EAAE;QAC1B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,EAAE,CAAC,YAAY,CAAC;gBACd,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI;gBAC9B,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,UAAU,EAAE,IAAI,CAAC,MAAM;gBACvB,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ;oBACjD,MAAM,GAAG,GAAgB;wBACvB,MAAM;wBACN,MAAM,EAAE,IAAI,CAAC,MAAM;wBACnB,QAAQ,EAAE,CAAC,MAA0B,EAAE,EAAE;4BACvC,QAAQ,EAAE,CAAC;gCACT,OAAO,EAAE,MAAM,CAAC,OAAO;gCACvB,OAAO,EAAE,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAU;6BACzC,CAAC,CAAA;wBACJ,CAAC;qBACF,CAAA;oBACD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;oBAC9C,OAAO;wBACL,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;wBACpC,OAAO,EAAE,SAAS,CAAC,MAAM,CAAU;qBACpC,CAAA;gBACH,CAAC;aACF,CAAC,CAAA;QACJ,CAAC;IACH,CAAC,CAAA;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAC3B,IAAgB,EAChB,OAAsB,EAAE;IAExB,OAAO,mBAAmB,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;AAC1C,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * createAgent — minimal generic factory wrapping Pi's Agent class.
3
+ *
4
+ * Kernel-level: knows about LLM providers and tool wiring, knows nothing about
5
+ * the consumer's domain (no KMU specifics, no Engram specifics). Higher-level
6
+ * crews/extensions compose on top.
7
+ *
8
+ * Local providers (lmstudio, ollama) are NOT in `LlmProvider` — they're
9
+ * configured at the Pi runtime layer via `~/.pi/agent/models.json`, not
10
+ * through `getModel()`. Keep this union aligned with `KnownProvider` from
11
+ * `@earendil-works/pi-ai`.
12
+ */
13
+ import { Agent } from '@earendil-works/pi-agent-core';
14
+ import type { AgentTool } from '@earendil-works/pi-agent-core';
15
+ export type LlmProvider = 'openai' | 'anthropic' | 'google';
16
+ export interface CreateAgentOpts {
17
+ systemPrompt: string;
18
+ tools?: AgentTool[];
19
+ provider?: LlmProvider;
20
+ modelId?: string;
21
+ }
22
+ export declare function createAgent(opts: CreateAgentOpts): Agent;
23
+ //# sourceMappingURL=create-agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-agent.d.ts","sourceRoot":"","sources":["../../src/runtime/create-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAA;AACrD,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAI5E,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,CAAA;AAE3D,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,SAAS,EAAE,CAAA;IACnB,QAAQ,CAAC,EAAE,WAAW,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAYD,wBAAgB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,KAAK,CAexD"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * createAgent — minimal generic factory wrapping Pi's Agent class.
3
+ *
4
+ * Kernel-level: knows about LLM providers and tool wiring, knows nothing about
5
+ * the consumer's domain (no KMU specifics, no Engram specifics). Higher-level
6
+ * crews/extensions compose on top.
7
+ *
8
+ * Local providers (lmstudio, ollama) are NOT in `LlmProvider` — they're
9
+ * configured at the Pi runtime layer via `~/.pi/agent/models.json`, not
10
+ * through `getModel()`. Keep this union aligned with `KnownProvider` from
11
+ * `@earendil-works/pi-ai`.
12
+ */
13
+ import { Agent } from '@earendil-works/pi-agent-core';
14
+ import { getModel } from '@earendil-works/pi-ai';
15
+ const DEFAULT_MODEL = {
16
+ openai: 'gpt-4o',
17
+ anthropic: 'claude-sonnet-4-6',
18
+ google: 'gemini-2.5-pro',
19
+ };
20
+ const LLM_ROLES = new Set(['user', 'assistant', 'toolResult']);
21
+ const isLlmMessage = (m) => LLM_ROLES.has(m.role);
22
+ export function createAgent(opts) {
23
+ const provider = opts.provider ?? 'anthropic';
24
+ const modelId = opts.modelId ?? DEFAULT_MODEL[provider];
25
+ // Pi's getModel is typed to known modelIds per provider; we accept any string
26
+ // here since consumers may target newer models than Pi's table knows about.
27
+ const model = getModel(provider, modelId);
28
+ return new Agent({
29
+ initialState: {
30
+ systemPrompt: opts.systemPrompt,
31
+ model,
32
+ tools: opts.tools ?? [],
33
+ },
34
+ convertToLlm: (messages) => messages.filter(isLlmMessage),
35
+ });
36
+ }
37
+ //# sourceMappingURL=create-agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-agent.js","sourceRoot":"","sources":["../../src/runtime/create-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAYhD,MAAM,aAAa,GAAgC;IACjD,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,mBAAmB;IAC9B,MAAM,EAAE,gBAAgB;CACzB,CAAA;AAED,MAAM,SAAS,GAAG,IAAI,GAAG,CAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,CAAA;AAE/E,MAAM,YAAY,GAAG,CAAC,CAAe,EAAgB,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,IAAuB,CAAC,CAAA;AAEhG,MAAM,UAAU,WAAW,CAAC,IAAqB;IAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,WAAW,CAAA;IAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAA;IACvD,8EAA8E;IAC9E,4EAA4E;IAC5E,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,EAAE,OAAgB,CAAC,CAAA;IAElD,OAAO,IAAI,KAAK,CAAC;QACf,YAAY,EAAE;YACZ,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,KAAK;YACL,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE;SACxB;QACD,YAAY,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC;KAC1D,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Helpers for pulling typed extras out of a ToolContext.
3
+ *
4
+ * Tools that depend on host-supplied extras (DbAdapter, session, auth) use
5
+ * these helpers instead of casting `ctx.extras` directly. The host registers
6
+ * its extras object when wiring adapters:
7
+ *
8
+ * toPiExtension(listProjectsTool, { extras: { db } })
9
+ * runOpenAiTool(tools, name, args, { extras: { db } })
10
+ */
11
+ import type { DbAdapter } from '../adapter/index.js';
12
+ import type { ToolContext } from './tool.js';
13
+ export interface DbExtras {
14
+ db: DbAdapter;
15
+ }
16
+ export declare class MissingExtraError extends Error {
17
+ constructor(key: string);
18
+ }
19
+ export declare function requireDb(ctx?: ToolContext): DbAdapter;
20
+ //# sourceMappingURL=ctx-extras.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ctx-extras.d.ts","sourceRoot":"","sources":["../../src/runtime/ctx-extras.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,SAAS,CAAA;CACd;AAED,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,GAAG,EAAE,MAAM;CAIxB;AAED,wBAAgB,SAAS,CAAC,GAAG,CAAC,EAAE,WAAW,GAAG,SAAS,CAItD"}
@@ -0,0 +1,13 @@
1
+ export class MissingExtraError extends Error {
2
+ constructor(key) {
3
+ super(`Tool requires ctx.extras.${key} but none was provided by the host.`);
4
+ this.name = 'MissingExtraError';
5
+ }
6
+ }
7
+ export function requireDb(ctx) {
8
+ const extras = ctx?.extras;
9
+ if (!extras?.db)
10
+ throw new MissingExtraError('db');
11
+ return extras.db;
12
+ }
13
+ //# sourceMappingURL=ctx-extras.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ctx-extras.js","sourceRoot":"","sources":["../../src/runtime/ctx-extras.ts"],"names":[],"mappings":"AAiBA,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC1C,YAAY,GAAW;QACrB,KAAK,CAAC,4BAA4B,GAAG,qCAAqC,CAAC,CAAA;QAC3E,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAA;IACjC,CAAC;CACF;AAED,MAAM,UAAU,SAAS,CAAC,GAAiB;IACzC,MAAM,MAAM,GAAG,GAAG,EAAE,MAAuC,CAAA;IAC3D,IAAI,CAAC,MAAM,EAAE,EAAE;QAAE,MAAM,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAA;IAClD,OAAO,MAAM,CAAC,EAAE,CAAA;AAClB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { createAgent } from './create-agent.js';
2
+ export type { CreateAgentOpts, LlmProvider } from './create-agent.js';
3
+ export type { ToolDef, AnyToolDef, ToolContext, ToolProgressUpdate } from './tool.js';
4
+ export { requireDb, MissingExtraError, type DbExtras } from './ctx-extras.js';
5
+ export { registerToolsWithPi, toPiExtension, toOpenAiFunction, toOpenAiFunctions, runOpenAiTool, type PiAdapterOpts, type OpenAiFunctionTool, } from './adapters/index.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAErE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAErF,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE7E,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,kBAAkB,GACxB,MAAM,qBAAqB,CAAA"}
@@ -0,0 +1,4 @@
1
+ export { createAgent } from './create-agent.js';
2
+ export { requireDb, MissingExtraError } from './ctx-extras.js';
3
+ export { registerToolsWithPi, toPiExtension, toOpenAiFunction, toOpenAiFunctions, runOpenAiTool, } from './adapters/index.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAK/C,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAA;AAE7E,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,GAGd,MAAM,qBAAqB,CAAA"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * ToolDef — neutral, host-agnostic tool shape.
3
+ *
4
+ * The kernel doesn't pick a tool-hosting format. Authors write tools as
5
+ * `ToolDef`, then adapters in `./adapters/` translate to:
6
+ * - Pi runtime (via `pi.registerTool` — see `toPiExtension`)
7
+ * - OpenAI function-calling (via `toOpenAiFunction` + `runOpenAiTool`)
8
+ *
9
+ * TypeBox `Type.Object(...)` returns a literal JSON Schema, so the same
10
+ * `params` value satisfies both shapes without conversion.
11
+ */
12
+ import type { Static, TSchema } from '@sinclair/typebox';
13
+ /**
14
+ * Streaming progress update. Mirrors Pi's `onUpdate` payload so the Pi
15
+ * adapter can pass it through verbatim. OpenAI hosts ignore these.
16
+ */
17
+ export interface ToolProgressUpdate {
18
+ content: Array<{
19
+ type: 'text';
20
+ text: string;
21
+ }>;
22
+ details?: Record<string, unknown>;
23
+ }
24
+ /**
25
+ * Per-call context passed to `execute`. All fields optional — tools that
26
+ * don't need them just ignore the argument.
27
+ *
28
+ * `ctx.db` is filled in by the host when the tool is registered against a
29
+ * `DbAdapter`. CRUD tools depend on it; pure tools (weather, council-review)
30
+ * leave it undefined.
31
+ */
32
+ export interface ToolContext<TExtras = Record<string, unknown>> {
33
+ signal?: AbortSignal;
34
+ onUpdate?: (update: ToolProgressUpdate) => void;
35
+ /** Host-supplied extras: DbAdapter, session, auth, etc. */
36
+ extras?: TExtras;
37
+ }
38
+ export interface ToolDef<TParams extends TSchema = TSchema, TResult = unknown> {
39
+ /** Stable identifier — same string for Pi and OpenAI registrations. */
40
+ name: string;
41
+ /** Human-readable label (used by Pi UIs; OpenAI ignores it). */
42
+ label?: string;
43
+ /** Description shown to the model when deciding whether to call. */
44
+ description: string;
45
+ /** TypeBox schema for the tool's input parameters. */
46
+ params: TParams;
47
+ /** Optional list of categories or labels for catalogs/dashboards. */
48
+ tags?: string[];
49
+ /** Actual implementation. May be sync or async. */
50
+ execute: (params: Static<TParams>, ctx?: ToolContext) => Promise<TResult> | TResult;
51
+ }
52
+ /**
53
+ * Loose ToolDef used when collecting heterogeneous tools into a registry.
54
+ * Adapters accept this; type-safe authors use the parameterized `ToolDef`.
55
+ *
56
+ * `any` is intentional here — a concrete `ToolDef<typeof MyParams>` has a
57
+ * narrower `execute` signature than `ToolDef<TSchema, unknown>` and would
58
+ * not be assignable to an `unknown`-parameterized variant.
59
+ */
60
+ export type AnyToolDef = ToolDef<any, any>;
61
+ //# sourceMappingURL=tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/runtime/tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAExD;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC5D,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAA;IAC/C,2DAA2D;IAC3D,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,OAAO,CAAC,OAAO,SAAS,OAAO,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO;IAC3E,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAA;IACZ,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oEAAoE;IACpE,WAAW,EAAE,MAAM,CAAA;IACnB,sDAAsD;IACtD,MAAM,EAAE,OAAO,CAAA;IACf,qEAAqE;IACrE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,mDAAmD;IACnD,OAAO,EAAE,CACP,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,EACvB,GAAG,CAAC,EAAE,WAAW,KACd,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAA;CAChC;AAED;;;;;;;GAOG;AAEH,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool.js","sourceRoot":"","sources":["../../src/runtime/tool.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@48nauts/agent-core",
3
+ "version": "0.1.0",
4
+ "description": "Agent runtime, workflow primitives, and adapter interfaces. The kernel.",
5
+ "license": "AGPL-3.0-or-later",
6
+ "type": "module",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ },
14
+ "./adapter": {
15
+ "types": "./dist/adapter/index.d.ts",
16
+ "import": "./dist/adapter/index.js"
17
+ },
18
+ "./runtime": {
19
+ "types": "./dist/runtime/index.d.ts",
20
+ "import": "./dist/runtime/index.js"
21
+ },
22
+ "./tool": {
23
+ "types": "./dist/runtime/tool.d.ts",
24
+ "import": "./dist/runtime/tool.js"
25
+ }
26
+ },
27
+ "dependencies": {
28
+ "@earendil-works/pi-agent-core": "^0.74.0",
29
+ "@earendil-works/pi-ai": "^0.74.0",
30
+ "@sinclair/typebox": "^0.34.0"
31
+ },
32
+ "peerDependencies": {
33
+ "@earendil-works/pi-coding-agent": "*"
34
+ },
35
+ "peerDependenciesMeta": {
36
+ "@earendil-works/pi-coding-agent": {
37
+ "optional": true
38
+ }
39
+ },
40
+ "devDependencies": {
41
+ "@earendil-works/pi-coding-agent": "^0.74.0",
42
+ "typescript": "^5.5.0"
43
+ },
44
+ "files": [
45
+ "dist"
46
+ ],
47
+ "publishConfig": {
48
+ "access": "public"
49
+ },
50
+ "scripts": {
51
+ "typecheck": "tsc --noEmit",
52
+ "build": "tsc"
53
+ }
54
+ }