@arnilo/prism 0.6.0 → 0.8.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 (178) hide show
  1. package/CHANGELOG.md +79 -5
  2. package/README.md +12 -11
  3. package/dist/agent-approval.d.ts +4 -0
  4. package/dist/agent-approval.js +5 -1
  5. package/dist/agent-definitions.js +1 -0
  6. package/dist/agent-run-lifecycle.js +39 -4
  7. package/dist/agent-run-state.d.ts +18 -0
  8. package/dist/agent-run-state.js +39 -9
  9. package/dist/agent-session/helpers.js +6 -1
  10. package/dist/agent-session/session/assemble.js +159 -7
  11. package/dist/agent-session/session/persist.d.ts +16 -0
  12. package/dist/agent-session/session/persist.js +64 -4
  13. package/dist/agent-session/session/provider-round.d.ts +3 -3
  14. package/dist/agent-session/session/provider-round.js +12 -6
  15. package/dist/agent-session/session/tool-round.js +5 -1
  16. package/dist/agent-session/session/types.d.ts +22 -1
  17. package/dist/agent-session/session.d.ts +16 -0
  18. package/dist/agent-session/session.js +42 -3
  19. package/dist/artifacts.d.ts +39 -1
  20. package/dist/artifacts.js +73 -0
  21. package/dist/attention-compiler.d.ts +121 -0
  22. package/dist/attention-compiler.js +479 -0
  23. package/dist/checkpoints.js +7 -11
  24. package/dist/cli-init.js +20 -6
  25. package/dist/context-budget.d.ts +20 -1
  26. package/dist/context-budget.js +10 -1
  27. package/dist/contracts-core/agent.d.ts +7 -0
  28. package/dist/contracts-core/attention.d.ts +66 -0
  29. package/dist/contracts-core/attention.js +2 -0
  30. package/dist/contracts-core/compaction.d.ts +59 -0
  31. package/dist/contracts-core/compaction.js +77 -1
  32. package/dist/contracts-core/content.d.ts +5 -0
  33. package/dist/contracts-core/loop.d.ts +42 -0
  34. package/dist/contracts-core/provider.d.ts +4 -0
  35. package/dist/contracts-core/run-limits.d.ts +2 -0
  36. package/dist/contracts-core.d.ts +1 -0
  37. package/dist/contracts-core.js +1 -0
  38. package/dist/contracts-protocol.d.ts +44 -3
  39. package/dist/contracts-run-state.d.ts +32 -5
  40. package/dist/evidence-grounding.d.ts +29 -0
  41. package/dist/evidence-grounding.js +162 -0
  42. package/dist/host-composition.d.ts +91 -0
  43. package/dist/host-composition.js +279 -0
  44. package/dist/index.d.ts +13 -6
  45. package/dist/index.js +7 -4
  46. package/dist/input.d.ts +13 -1
  47. package/dist/input.js +40 -1
  48. package/dist/provider-events.d.ts +3 -1
  49. package/dist/provider-events.js +2 -2
  50. package/dist/providers/transport.d.ts +3 -1
  51. package/dist/providers/transport.js +36 -0
  52. package/dist/redaction.js +18 -2
  53. package/dist/run-bundle.d.ts +89 -0
  54. package/dist/run-bundle.js +149 -0
  55. package/dist/secure-agent.d.ts +2 -0
  56. package/dist/secure-agent.js +6 -1
  57. package/dist/testing/state-concurrency-conformance.js +5 -12
  58. package/dist/tool-result-fold.d.ts +12 -0
  59. package/dist/tool-result-fold.js +13 -6
  60. package/dist/tools.d.ts +10 -0
  61. package/dist/tools.js +41 -0
  62. package/docs/acp-agent.md +42 -11
  63. package/docs/acp.md +2 -1
  64. package/docs/ag-ui.md +10 -3
  65. package/docs/agent-definitions.md +9 -1
  66. package/docs/agent-events.md +4 -1
  67. package/docs/agent-loops.md +33 -0
  68. package/docs/agent-session-runtime.md +8 -7
  69. package/docs/attention-compiler.md +272 -0
  70. package/docs/cli-rpc.md +4 -2
  71. package/docs/coding-agent-tools.md +1 -1
  72. package/docs/coding-security.md +6 -3
  73. package/docs/coding-tools.md +0 -1
  74. package/docs/coding-workspaces.md +22 -0
  75. package/docs/compaction-and-retry.md +36 -4
  76. package/docs/compaction-observational-memory.md +63 -10
  77. package/docs/connected-apps.md +116 -0
  78. package/docs/context-and-skills.md +17 -2
  79. package/docs/conversations.md +1 -1
  80. package/docs/core.md +1 -1
  81. package/docs/dev-inspector.md +4 -0
  82. package/docs/device-adapters.md +1 -0
  83. package/docs/diagrams.md +6 -6
  84. package/docs/document-reader.md +18 -10
  85. package/docs/documents.md +40 -11
  86. package/docs/durable-runs.md +87 -0
  87. package/docs/enterprise-postgres-state.md +6 -2
  88. package/docs/evaluations.md +168 -4
  89. package/docs/execution-timeline.md +186 -0
  90. package/docs/guardrails.md +33 -0
  91. package/docs/history/0.7.0-primitive-review.md +254 -0
  92. package/docs/history/079-messaging-primitive-review.md +391 -0
  93. package/docs/history/080-messaging-followon-primitive-review.md +234 -0
  94. package/docs/history/081-connected-apps-primitive-review.md +74 -0
  95. package/docs/history/083-prism-work-primitive-review.md +84 -0
  96. package/docs/history/084-primitive-review.md +96 -0
  97. package/docs/history/085-honesty-and-cut-primitive-review.md +91 -0
  98. package/docs/history/README.md +5 -0
  99. package/docs/history/migration-0.0.md +2 -2
  100. package/docs/history/release-handoffs.md +75 -1
  101. package/docs/host-compositions.md +149 -0
  102. package/docs/host-security.md +2 -2
  103. package/docs/hosted-sandboxes.md +94 -0
  104. package/docs/index.md +82 -45
  105. package/docs/input-and-prompt-assembly.md +1 -0
  106. package/docs/knowledge-sync.md +84 -0
  107. package/docs/language-intelligence.md +1 -1
  108. package/docs/live-testing.md +8 -3
  109. package/docs/mcp-tools.md +3 -1
  110. package/docs/memory-fabric.md +416 -0
  111. package/docs/messaging-channel-operations.md +166 -0
  112. package/docs/messaging-channels.md +150 -0
  113. package/docs/migrate-to-0.5.md +1 -1
  114. package/docs/migrate-to-0.6.md +1 -0
  115. package/docs/migrate-to-0.7.md +345 -0
  116. package/docs/migrate-to-0.8.md +124 -0
  117. package/docs/migration.md +43 -1
  118. package/docs/model-registry.md +12 -2
  119. package/docs/model-routing.md +79 -4
  120. package/docs/multi-agent-patterns.md +20 -6
  121. package/docs/observability.md +52 -1
  122. package/docs/openapi-tools.md +1 -1
  123. package/docs/operations.md +14 -4
  124. package/docs/options-index.md +47 -3
  125. package/docs/peer-dependencies.md +12 -10
  126. package/docs/postgres-persistence.md +1 -1
  127. package/docs/process-sessions.md +3 -1
  128. package/docs/prompt-registry.md +1 -1
  129. package/docs/provider-caching.md +4 -2
  130. package/docs/provider-conformance.md +1 -1
  131. package/docs/provider-layer.md +2 -2
  132. package/docs/provider-packages.md +22 -22
  133. package/docs/providers/bedrock.md +71 -7
  134. package/docs/providers/neuralwatt.md +5 -1
  135. package/docs/providers/openai.md +1 -1
  136. package/docs/rag.md +24 -8
  137. package/docs/realtime-voice.md +87 -0
  138. package/docs/release-and-install.md +53 -45
  139. package/docs/run-bundle.md +92 -0
  140. package/docs/runs-and-usage.md +17 -2
  141. package/docs/server.md +7 -3
  142. package/docs/sheets.md +9 -9
  143. package/docs/signal-channel.md +112 -0
  144. package/docs/speech.md +7 -1
  145. package/docs/sqlite-persistence.md +1 -1
  146. package/docs/supervisors.md +33 -5
  147. package/docs/telegram-channel.md +157 -0
  148. package/docs/testing.md +2 -2
  149. package/docs/thinking-and-reasoning.md +3 -1
  150. package/docs/tools.md +6 -5
  151. package/docs/web-tools.md +2 -1
  152. package/docs/wiki.md +1 -1
  153. package/docs/work-artifacts-and-review.md +14 -4
  154. package/docs/work-connectors.md +12 -10
  155. package/docs/work-sandbox.md +115 -0
  156. package/docs/work-tools.md +50 -18
  157. package/docs/workflows.md +69 -1
  158. package/docs/working-and-semantic-memory.md +25 -14
  159. package/package.json +5 -3
  160. package/templates/README.md +2 -0
  161. package/templates/business-worker/README.md.tmpl +19 -0
  162. package/templates/business-worker/env.example.tmpl +1 -0
  163. package/templates/business-worker/gitignore.tmpl +11 -0
  164. package/templates/business-worker/manifest.json +12 -0
  165. package/templates/business-worker/package.json.tmpl +23 -0
  166. package/templates/business-worker/src/agent.ts.tmpl +92 -0
  167. package/templates/business-worker/src/index.ts.tmpl +13 -0
  168. package/templates/business-worker/src/tests/agent.test.ts.tmpl +77 -0
  169. package/templates/business-worker/tsconfig.json.tmpl +15 -0
  170. package/templates/personal-assistant/README.md.tmpl +18 -0
  171. package/templates/personal-assistant/env.example.tmpl +1 -0
  172. package/templates/personal-assistant/gitignore.tmpl +11 -0
  173. package/templates/personal-assistant/manifest.json +11 -0
  174. package/templates/personal-assistant/package.json.tmpl +23 -0
  175. package/templates/personal-assistant/src/agent.ts.tmpl +65 -0
  176. package/templates/personal-assistant/src/index.ts.tmpl +13 -0
  177. package/templates/personal-assistant/src/tests/agent.test.ts.tmpl +28 -0
  178. package/templates/personal-assistant/tsconfig.json.tmpl +15 -0
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "business-worker",
3
+ "description": "Multi-tenant business worker: durable storage, tenant isolation, verified identity, and governed invocation boundaries",
4
+ "version": "0.1.0",
5
+ "tags": ["business", "worker", "multi-tenant", "enterprise", "secure"],
6
+ "packages": [
7
+ "@arnilo/prism",
8
+ "@arnilo/prism-core",
9
+ "@arnilo/prism-providers",
10
+ "@arnilo/prism-work"
11
+ ]
12
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "__PROJECT_NAME__",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "build": "tsc -p tsconfig.json",
8
+ "typecheck": "tsc -p tsconfig.json --noEmit",
9
+ "test": "npm run build && node --test dist/__tests__/agent.test.js",
10
+ "start": "npm run build && node dist/index.js",
11
+ "dev": "prism dev"
12
+ },
13
+ "dependencies": {
14
+ __DEPENDENCIES__
15
+ },
16
+ "devDependencies": {
17
+ "@types/node": "^22.0.0",
18
+ "typescript": "^5.7.0"
19
+ },
20
+ "engines": {
21
+ "node": ">=20"
22
+ }
23
+ }
@@ -0,0 +1,92 @@
1
+ import {
2
+ type Agent,
3
+ createMemoryCheckpointStore,
4
+ createMockProvider,
5
+ createSecretRedactor,
6
+ createSecureAgent,
7
+ createStaticPermissionPolicy,
8
+ createStaticTrustPolicy,
9
+ providerDone,
10
+ providerTextDelta,
11
+ } from "@arnilo/prism";
12
+ import { createJsonSchemaArgumentValidator } from "@arnilo/prism-core/validation/json-schema";
13
+ import { createMemoryWorkDraftStore, type SyncWorkDraftStore } from "@arnilo/prism-work/connectors";
14
+ import type { AgentIdentity } from "@arnilo/prism";
15
+
16
+ export interface CreateBusinessWorkerOptions {
17
+ readonly tenantId?: string;
18
+ readonly userId?: string;
19
+ readonly identity?: AgentIdentity;
20
+ readonly store?: import("@arnilo/prism").CheckpointStore;
21
+ readonly provider?: import("@arnilo/prism").AIProvider;
22
+ readonly model?: { readonly provider: string; readonly model: string };
23
+ readonly workspaceRoot?: string;
24
+ }
25
+
26
+ export function createAppAgent(options: CreateBusinessWorkerOptions = {}): Agent {
27
+ const tenantId = options.tenantId ?? "tenant-corp";
28
+ const userId = options.userId ?? "worker-1";
29
+
30
+ const identity: AgentIdentity = options.identity ?? {
31
+ tenantId,
32
+ userId,
33
+ principal: { kind: "user", id: userId },
34
+ scopes: ["worker:execute"],
35
+ verified: true,
36
+ issuedAt: new Date().toISOString(),
37
+ };
38
+
39
+ const redactor = createSecretRedactor(
40
+ [process.env.BUSINESS_API_KEY].filter((v): v is string => typeof v === "string" && v.length > 0),
41
+ );
42
+
43
+ const provider =
44
+ options.provider ??
45
+ createMockProvider([
46
+ providerTextDelta("Business worker ready for tenant tasks."),
47
+ providerDone(),
48
+ ]);
49
+
50
+ return createSecureAgent({
51
+ id: "business-worker",
52
+ definitionRevision: "1",
53
+ ownership: { tenantId, userId },
54
+ identity,
55
+ redactor,
56
+ permission: createStaticPermissionPolicy(true),
57
+ trust: createStaticTrustPolicy(true),
58
+ toolArgumentValidator: createJsonSchemaArgumentValidator(),
59
+ limits: { maxToolRounds: 15 },
60
+ runState: { checkpoints: options.store ?? createMemoryCheckpointStore() },
61
+ tools: [
62
+ {
63
+ name: "process_tenant_record",
64
+ description: "Processes a verified tenant batch item",
65
+ parameters: {
66
+ type: "object",
67
+ properties: {
68
+ recordId: { type: "string" },
69
+ action: { type: "string" },
70
+ },
71
+ required: ["recordId", "action"],
72
+ additionalProperties: false,
73
+ },
74
+ execute: async (args, ctx) => ({
75
+ toolCallId: ctx.toolCallId,
76
+ name: "process_tenant_record",
77
+ value: {
78
+ processed: true,
79
+ tenantId,
80
+ recordId: (args as { recordId: string }).recordId,
81
+ },
82
+ }),
83
+ },
84
+ ],
85
+ provider,
86
+ model: options.model ?? { provider: "mock", model: "corp-worker-model" },
87
+ });
88
+ }
89
+
90
+ export function createWorkerDraftStore(): SyncWorkDraftStore {
91
+ return createMemoryWorkDraftStore();
92
+ }
@@ -0,0 +1,13 @@
1
+ import { createAppAgent } from "./agent.js";
2
+
3
+ async function main() {
4
+ const agent = createAppAgent({ tenantId: "tenant-acme", userId: "worker-prod-1" });
5
+ const session = agent.createSession({ id: "biz-session-1" });
6
+ const result = await session.run("Process batch queue item");
7
+ console.log(result.text);
8
+ }
9
+
10
+ main().catch((error) => {
11
+ console.error("Business worker failed:", error);
12
+ process.exit(1);
13
+ });
@@ -0,0 +1,77 @@
1
+ import assert from "node:assert/strict";
2
+ import { describe, it } from "node:test";
3
+ import { assertHostCompositionReadiness, inspectHostComposition, HostCompositionError } from "@arnilo/prism";
4
+ import { validateApproval } from "@arnilo/prism-work/connectors";
5
+ import type { AgentIdentity } from "@arnilo/prism";
6
+ import { createAppAgent, createWorkerDraftStore } from "../agent.js";
7
+
8
+ describe("business worker template", () => {
9
+ it("creates agent and processes task with tenant context", async () => {
10
+ const agent = createAppAgent({ tenantId: "tenant-enterprise", userId: "worker-test" });
11
+ const session = agent.createSession({ id: "test-biz-session" });
12
+ const result = await session.run("Run tenant task");
13
+ assert.ok(result.text.includes("Business worker ready"));
14
+ });
15
+
16
+ it("fails business readiness if memory-only store is configured", () => {
17
+ const agent = createAppAgent({ tenantId: "tenant-enterprise", userId: "worker-test" });
18
+ assert.throws(
19
+ () => {
20
+ assertHostCompositionReadiness({
21
+ profile: "business",
22
+ agent,
23
+ store: { kind: "memory", durable: false },
24
+ });
25
+ },
26
+ (error) => error instanceof HostCompositionError && error.message.includes("durable storage"),
27
+ );
28
+ });
29
+
30
+ it("passes business readiness with durable store and isolated workspace", () => {
31
+ const agent = createAppAgent({ tenantId: "tenant-enterprise", userId: "worker-test" });
32
+ const report = inspectHostComposition({
33
+ profile: "business",
34
+ agent,
35
+ store: { kind: "postgres", durable: true },
36
+ workspaceRoot: "/var/tenant-enterprise",
37
+ sandboxRoots: ["/var/tenant-enterprise/tasks"],
38
+ credentialRefs: ["BUSINESS_API_KEY"],
39
+ });
40
+
41
+ assert.equal(report.profile, "business");
42
+ assert.equal(report.ownership.tenantId, "tenant-enterprise");
43
+ assert.equal(report.storage.durable, true);
44
+ assert.equal(report.sandbox.isolated, true);
45
+ assert.equal(report.readiness.ok, true);
46
+ });
47
+
48
+ it("rejects a stale draft revision after edit", () => {
49
+ const store = createWorkerDraftStore();
50
+ const identity: AgentIdentity = {
51
+ tenantId: "tenant-enterprise",
52
+ userId: "worker-test",
53
+ principal: { kind: "user", id: "worker-test" },
54
+ scopes: ["Mail.Send"],
55
+ issuedAt: new Date().toISOString(),
56
+ verified: true,
57
+ };
58
+ const draft = store.createDraft({
59
+ provider: "microsoft365",
60
+ op: "mail.send",
61
+ identity,
62
+ payload: { to: "a@contoso.com", subject: "v1" },
63
+ });
64
+ const approval = {
65
+ draftId: draft.draftId,
66
+ revision: draft.revision,
67
+ payloadDigest: draft.payloadDigest,
68
+ };
69
+ const updated = store.updateDraft({
70
+ draftId: draft.draftId,
71
+ identity,
72
+ payload: { to: "a@contoso.com", subject: "v2" },
73
+ expectedRevision: 1,
74
+ });
75
+ assert.throws(() => validateApproval(updated, approval), /does not match draft revision/);
76
+ });
77
+ });
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "strict": true,
7
+ "outDir": "dist",
8
+ "rootDir": "src",
9
+ "declaration": true,
10
+ "skipLibCheck": true,
11
+ "esModuleInterop": true,
12
+ "forceConsistentCasingInFileNames": true
13
+ },
14
+ "include": ["src"]
15
+ }
@@ -0,0 +1,18 @@
1
+ # __PROJECT_NAME__
2
+
3
+ Personal workstation assistant built with Prism. Features single-user ownership, local tools, credential references, and loopback dev inspection.
4
+
5
+ ## Quickstart
6
+
7
+ ```bash
8
+ npm install
9
+ npm test
10
+ npm run dev # Boots loopback dev inspector at http://127.0.0.1:4311
11
+ ```
12
+
13
+ ## Security Posture
14
+
15
+ - **Single-User Ownership**: Bounded to the local workstation operator (`userId: process.env.USER`).
16
+ - **Secret Redaction**: Environment secrets are redacted before persistence or logs.
17
+ - **Durable Verification**: Uses memory/local storage; in-memory storage is recognized as non-durable.
18
+ - **Containment**: Tool actions are contained to local workspace roots.
@@ -0,0 +1 @@
1
+ OPENAI_API_KEY=
@@ -0,0 +1,11 @@
1
+ node_modules/
2
+ dist/
3
+ .env
4
+ .env.local
5
+ *.db
6
+ *.sqlite
7
+ *.sqlite3
8
+ .prism/
9
+ coverage/
10
+ .DS_Store
11
+ *.log
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "personal-assistant",
3
+ "description": "Personal workstation assistant: local single-user agent with file tools, credential references, and loopback dev inspection",
4
+ "version": "0.1.0",
5
+ "tags": ["personal", "workstation", "assistant", "local", "secure"],
6
+ "packages": [
7
+ "@arnilo/prism",
8
+ "@arnilo/prism-core",
9
+ "@arnilo/prism-providers"
10
+ ]
11
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "__PROJECT_NAME__",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "build": "tsc -p tsconfig.json",
8
+ "typecheck": "tsc -p tsconfig.json --noEmit",
9
+ "test": "npm run build && node --test dist/__tests__/agent.test.js",
10
+ "start": "npm run build && node dist/index.js",
11
+ "dev": "prism dev"
12
+ },
13
+ "dependencies": {
14
+ __DEPENDENCIES__
15
+ },
16
+ "devDependencies": {
17
+ "@types/node": "^22.0.0",
18
+ "typescript": "^5.7.0"
19
+ },
20
+ "engines": {
21
+ "node": ">=20"
22
+ }
23
+ }
@@ -0,0 +1,65 @@
1
+ import {
2
+ type Agent,
3
+ createMemoryCheckpointStore,
4
+ createMockProvider,
5
+ createSecretRedactor,
6
+ createSecureAgent,
7
+ createStaticPermissionPolicy,
8
+ createStaticTrustPolicy,
9
+ providerDone,
10
+ providerTextDelta,
11
+ } from "@arnilo/prism";
12
+ import { createJsonSchemaArgumentValidator } from "@arnilo/prism-core/validation/json-schema";
13
+
14
+ export interface CreatePersonalAgentOptions {
15
+ readonly userId?: string;
16
+ readonly provider?: import("@arnilo/prism").AIProvider;
17
+ readonly model?: { readonly provider: string; readonly model: string };
18
+ readonly workspaceRoot?: string;
19
+ }
20
+
21
+ export function createAppAgent(options: CreatePersonalAgentOptions = {}): Agent {
22
+ const userId = options.userId ?? process.env.USER ?? "local-user";
23
+ const redactor = createSecretRedactor(
24
+ [process.env.OPENAI_API_KEY].filter((v): v is string => typeof v === "string" && v.length > 0),
25
+ );
26
+
27
+ const provider =
28
+ options.provider ??
29
+ createMockProvider([
30
+ providerTextDelta("Personal Assistant ready. How can I help you today?"),
31
+ providerDone(),
32
+ ]);
33
+
34
+ return createSecureAgent({
35
+ id: "personal-assistant",
36
+ definitionRevision: "1",
37
+ ownership: { userId },
38
+ redactor,
39
+ permission: createStaticPermissionPolicy(true),
40
+ trust: createStaticTrustPolicy(true),
41
+ toolArgumentValidator: createJsonSchemaArgumentValidator(),
42
+ limits: { maxToolRounds: 10 },
43
+ runState: { checkpoints: createMemoryCheckpointStore() },
44
+ tools: [
45
+ {
46
+ name: "workspace_status",
47
+ description: "Reports the local workspace status and configuration",
48
+ parameters: {
49
+ type: "object",
50
+ properties: {
51
+ details: { type: "boolean", description: "Include detailed status" },
52
+ },
53
+ additionalProperties: false,
54
+ },
55
+ execute: async (_args, ctx) => ({
56
+ toolCallId: ctx.toolCallId,
57
+ name: "workspace_status",
58
+ value: { ok: true, user: userId, status: "active" },
59
+ }),
60
+ },
61
+ ],
62
+ provider,
63
+ model: options.model ?? { provider: "mock", model: "personal-default" },
64
+ });
65
+ }
@@ -0,0 +1,13 @@
1
+ import { createAppAgent } from "./agent.js";
2
+
3
+ async function main() {
4
+ const agent = createAppAgent();
5
+ const session = agent.createSession({ id: "personal-session-1" });
6
+ const result = await session.run("Check workspace status");
7
+ console.log(result.text);
8
+ }
9
+
10
+ main().catch((error) => {
11
+ console.error("Personal assistant failed:", error);
12
+ process.exit(1);
13
+ });
@@ -0,0 +1,28 @@
1
+ import assert from "node:assert/strict";
2
+ import { describe, it } from "node:test";
3
+ import { assertHostCompositionReadiness, inspectHostComposition } from "@arnilo/prism";
4
+ import { createAppAgent } from "../agent.js";
5
+
6
+ describe("personal assistant template", () => {
7
+ it("creates agent and runs an offline turn", async () => {
8
+ const agent = createAppAgent({ userId: "test-user" });
9
+ const session = agent.createSession({ id: "test-session" });
10
+ const result = await session.run("Hello");
11
+ assert.ok(result.text.includes("Personal Assistant ready"));
12
+ });
13
+
14
+ it("passes personal host composition readiness inspection", () => {
15
+ const agent = createAppAgent({ userId: "test-user" });
16
+ const report = inspectHostComposition({
17
+ profile: "personal",
18
+ agent,
19
+ credentialRefs: ["OPENAI_API_KEY"],
20
+ });
21
+
22
+ assert.equal(report.profile, "personal");
23
+ assert.equal(report.ownership.userId, "test-user");
24
+ assert.equal(report.readiness.ok, true);
25
+ assert.equal(report.storage.durable, false, "in-memory store is non-durable");
26
+ assert.doesNotThrow(() => assertHostCompositionReadiness({ profile: "personal", agent }));
27
+ });
28
+ });
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "strict": true,
7
+ "outDir": "dist",
8
+ "rootDir": "src",
9
+ "declaration": true,
10
+ "skipLibCheck": true,
11
+ "esModuleInterop": true,
12
+ "forceConsistentCasingInFileNames": true
13
+ },
14
+ "include": ["src"]
15
+ }