@feltdb/feltkit 0.3.21 → 0.3.23

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 (140) hide show
  1. package/dist/app.d.ts +17 -3
  2. package/dist/app.js +10 -0
  3. package/dist/app.js.map +1 -1
  4. package/dist/appboundry/build.js +4 -0
  5. package/dist/appboundry/build.js.map +1 -1
  6. package/dist/authorize.d.ts +1 -1
  7. package/dist/cli/main.js +8 -152
  8. package/dist/cli/main.js.map +1 -1
  9. package/dist/client/index.d.ts +83 -4
  10. package/dist/client/index.js +154 -2
  11. package/dist/client/index.js.map +1 -1
  12. package/dist/dashboard/assets/index-BEjtLLYq.js +15 -0
  13. package/dist/dashboard/index.html +1 -1
  14. package/dist/docs.d.ts +1 -1
  15. package/dist/docs.js +1 -0
  16. package/dist/docs.js.map +1 -1
  17. package/dist/index.d.ts +4 -2
  18. package/dist/index.js.map +1 -1
  19. package/dist/platform/approvals.d.ts +102 -0
  20. package/dist/platform/approvals.js +155 -0
  21. package/dist/platform/approvals.js.map +1 -0
  22. package/dist/platform/artifacts.d.ts +126 -0
  23. package/dist/platform/artifacts.js +251 -0
  24. package/dist/platform/artifacts.js.map +1 -0
  25. package/dist/platform/blobs.d.ts +25 -0
  26. package/dist/platform/blobs.js +78 -0
  27. package/dist/platform/blobs.js.map +1 -0
  28. package/dist/platform/diff.d.ts +23 -0
  29. package/dist/platform/diff.js +107 -0
  30. package/dist/platform/diff.js.map +1 -0
  31. package/dist/platform/exec.d.ts +182 -0
  32. package/dist/platform/exec.js +575 -0
  33. package/dist/platform/exec.js.map +1 -0
  34. package/dist/platform/operations.d.ts +30 -13
  35. package/dist/platform/operations.js +8 -17
  36. package/dist/platform/operations.js.map +1 -1
  37. package/dist/platform/permissions.d.ts +15 -0
  38. package/dist/platform/permissions.js +16 -0
  39. package/dist/platform/permissions.js.map +1 -0
  40. package/dist/platform/platform.d.ts +28 -0
  41. package/dist/platform/platform.js +84 -5
  42. package/dist/platform/platform.js.map +1 -1
  43. package/dist/platform/releases.d.ts +110 -0
  44. package/dist/platform/releases.js +344 -0
  45. package/dist/platform/releases.js.map +1 -0
  46. package/dist/platform/review.d.ts +10 -0
  47. package/dist/platform/review.js +109 -0
  48. package/dist/platform/review.js.map +1 -0
  49. package/dist/platform/server.js +7 -0
  50. package/dist/platform/server.js.map +1 -1
  51. package/dist/platform/source.d.ts +2 -0
  52. package/dist/platform/source.js +1 -1
  53. package/dist/platform/source.js.map +1 -1
  54. package/dist/platform/workspace-operations.d.ts +2 -0
  55. package/dist/platform/workspace-operations.js +590 -0
  56. package/dist/platform/workspace-operations.js.map +1 -0
  57. package/dist/platform/workspaces.d.ts +211 -0
  58. package/dist/platform/workspaces.js +435 -0
  59. package/dist/platform/workspaces.js.map +1 -0
  60. package/dist/react/index.d.ts +29 -1
  61. package/dist/react/index.js +50 -0
  62. package/dist/react/index.js.map +1 -1
  63. package/dist/runtime/activity.d.ts +1 -1
  64. package/dist/runtime/agent.d.ts +216 -2
  65. package/dist/runtime/agent.js +333 -7
  66. package/dist/runtime/agent.js.map +1 -1
  67. package/dist/runtime/approval-rules.d.ts +16 -0
  68. package/dist/runtime/approval-rules.js +37 -0
  69. package/dist/runtime/approval-rules.js.map +1 -0
  70. package/dist/runtime/authority.d.ts +18 -1
  71. package/dist/runtime/authority.js +26 -1
  72. package/dist/runtime/authority.js.map +1 -1
  73. package/dist/runtime/browser-inference.d.ts +52 -0
  74. package/dist/runtime/browser-inference.js +53 -0
  75. package/dist/runtime/browser-inference.js.map +1 -0
  76. package/dist/runtime/context.d.ts +110 -0
  77. package/dist/runtime/decisions.d.ts +23 -0
  78. package/dist/runtime/decisions.js +54 -0
  79. package/dist/runtime/decisions.js.map +1 -1
  80. package/dist/runtime/generation.d.ts +94 -0
  81. package/dist/runtime/generation.js +295 -0
  82. package/dist/runtime/generation.js.map +1 -0
  83. package/dist/runtime/runtime.d.ts +10 -2
  84. package/dist/runtime/runtime.js +125 -1
  85. package/dist/runtime/runtime.js.map +1 -1
  86. package/dist/server/admin.d.ts +9 -1
  87. package/dist/server/admin.js +84 -2
  88. package/dist/server/admin.js.map +1 -1
  89. package/dist/server/index.d.ts +1 -1
  90. package/dist/server/index.js +159 -8
  91. package/dist/server/index.js.map +1 -1
  92. package/dist/testing/index.d.ts +11 -0
  93. package/dist/testing/index.js +7 -3
  94. package/dist/testing/index.js.map +1 -1
  95. package/docs/AUTH.md +2 -2
  96. package/docs/GENERATION.md +136 -0
  97. package/docs/README.md +3 -2
  98. package/package.json +2 -4
  99. package/skills/.claude-plugin/marketplace.json +1 -1
  100. package/skills/.claude-plugin/plugin.json +1 -1
  101. package/dist/cli/compose.d.ts +0 -31
  102. package/dist/cli/compose.js +0 -274
  103. package/dist/cli/compose.js.map +0 -1
  104. package/dist/cli/create.d.ts +0 -219
  105. package/dist/cli/create.js +0 -1193
  106. package/dist/cli/create.js.map +0 -1
  107. package/dist/cli/domain.d.ts +0 -174
  108. package/dist/cli/domain.js +0 -1119
  109. package/dist/cli/domain.js.map +0 -1
  110. package/dist/cli/shell.d.ts +0 -7
  111. package/dist/cli/shell.js +0 -59
  112. package/dist/cli/shell.js.map +0 -1
  113. package/dist/composition/catalog.d.ts +0 -3
  114. package/dist/composition/catalog.js +0 -217
  115. package/dist/composition/catalog.js.map +0 -1
  116. package/dist/composition/contract.d.ts +0 -165
  117. package/dist/composition/contract.js +0 -12
  118. package/dist/composition/contract.js.map +0 -1
  119. package/dist/composition/execute.d.ts +0 -110
  120. package/dist/composition/execute.js +0 -350
  121. package/dist/composition/execute.js.map +0 -1
  122. package/dist/composition/generate.d.ts +0 -105
  123. package/dist/composition/generate.js +0 -274
  124. package/dist/composition/generate.js.map +0 -1
  125. package/dist/composition/plan.d.ts +0 -131
  126. package/dist/composition/plan.js +0 -558
  127. package/dist/composition/plan.js.map +0 -1
  128. package/dist/composition/profiles.d.ts +0 -20
  129. package/dist/composition/profiles.js +0 -81
  130. package/dist/composition/profiles.js.map +0 -1
  131. package/dist/composition/reconcile.d.ts +0 -153
  132. package/dist/composition/reconcile.js +0 -282
  133. package/dist/composition/reconcile.js.map +0 -1
  134. package/dist/composition/recover.d.ts +0 -89
  135. package/dist/composition/recover.js +0 -407
  136. package/dist/composition/recover.js.map +0 -1
  137. package/dist/composition/resolve.d.ts +0 -2
  138. package/dist/composition/resolve.js +0 -208
  139. package/dist/composition/resolve.js.map +0 -1
  140. package/dist/dashboard/assets/index-BrC1AtZ1.js +0 -15
@@ -0,0 +1,136 @@
1
+ # Model generation, tools and approvals in an application
2
+
3
+ An application can hold a conversation with the environment's model and let the model *propose*
4
+ work through the application's own AppPort capabilities. The model never changes state itself:
5
+ reading capabilities run when it asks, changing ones wait for the owner's approval, and every
6
+ generation, proposal, approval and execution is recorded in FeltDB.
7
+
8
+ ```ts
9
+ // feltkit/chat.ts
10
+ export const turn = app.action({
11
+ access: "assistant.turn",
12
+ args: { key: s.string(), message: s.string() },
13
+ handler: async (ctx, { key, message }) => {
14
+ const { taskId, created } = await ctx.agent.openTask({ key, objective: message }); // one task per turn
15
+ if (!created) return { replayed: true, actions: await ctx.agent.actions(taskId) }; // a retry is the same turn
16
+ const tools = await ctx.agent.tools(); // capabilities the caller may use
17
+ const g = await ctx.model.generate({ taskId, messages: [{ role: "user", content: message }], tools });
18
+ for (const call of g.toolCalls) {
19
+ await ctx.agent.propose(taskId, { capability: call.name, input: call.input, reason: message, idempotencyKey: call.id,
20
+ model: { provider: g.receipt.provider, model: g.receipt.model, generation: { memoryId: g.memoryId, toolCallId: call.id } } });
21
+ }
22
+ return { text: g.text };
23
+ },
24
+ });
25
+ ```
26
+
27
+ ```tsx
28
+ // src/Chat.tsx
29
+ const turn = useAction(api.chat.turn); // turn.run(args), turn.text (streamed), turn.cancel()
30
+ const mine = useOwnActions({ state: "proposed" }); // what waits for me; mine.approve(a), mine.reject(a)
31
+ ```
32
+
33
+ ## Actions (`app.action`)
34
+
35
+ A third function kind beside queries and mutations. It is **not a transaction** and has no `ctx.db`:
36
+ it reads with `ctx.runQuery` and writes with `ctx.runMutation` (each authorized as the caller, each its
37
+ own transaction) or through proposals. It may call the model, and it streams to its caller:
38
+
39
+ | | |
40
+ |---|---|
41
+ | `POST /api/action/<name>` with `Accept: text/event-stream` | events `event` (each `ctx.emit`, model `delta`s, `generation`, `proposal`), then `result` or `error` |
42
+ | `client.action(ref, args, { onDelta, onEvent, signal })` | aborting `signal` closes the request; the server aborts the action's model call |
43
+ | `useAction(ref)` | `run`, `cancel`, `running`, `text`, `events`, `error` |
44
+ | `t.as(who).action(ref, args, { onEvent, signal, context })` | in tests |
45
+
46
+ An action cannot be an AppPort capability or require approval (expose a mutation for that). It is
47
+ refused by `feltkit build --target appboundry`: it needs the FeltKit server.
48
+
49
+ ## Generation (`ctx.model.generate`)
50
+
51
+ The model, provider, endpoint and credential come from where decisions get them: the environment's
52
+ AppPort Services Intelligence selection with FeltKit's credential custody, or a Resolver reference
53
+ (`feltkit({ agent: { model } })`) resolved **once per generation**, so changing the reference in
54
+ Resolver changes the next generation with no restart and no mixing of revisions. Protocols: OpenAI
55
+ chat completions (OpenAI and OpenAI-compatible servers, including gateways) and Anthropic Messages,
56
+ streamed. `ctx.model.status()` says what is configured. Timeout: `agent.generationTimeoutMs` (120 s).
57
+
58
+ ### Every attempt has a durable outcome
59
+
60
+ Each generation is a chain of FeltDB agent-memory records on the turn's task, each step a
61
+ compare-and-swap like an action's:
62
+
63
+ ```
64
+ requested ──▶ running ──▶ completed
65
+ │ ├──────▶ failed (timeout, unavailable, credential_refused, provider_error, malformed, …)
66
+ │ ├──────▶ cancelled (the caller cancelled; the text so far is kept)
67
+ └────────────┴──────▶ interrupted (the process stopped while it was open; set at the next start)
68
+ ```
69
+
70
+ - **requested** is written before any provider is contacted, so an attempt never disappears.
71
+ - **running** records what it runs on: provider, model, protocol, endpoint, source (Resolver or
72
+ Intelligence), the Resolver reference and revision, and the credential's *reference* (never its value).
73
+ - **The final record** holds:
74
+ - the output (bounded; on failure or cancellation, what had streamed);
75
+ - the tool calls;
76
+ - finish, token usage, and cost when the provider reports one;
77
+ - start and end times and the duration;
78
+ - for a failure: its classification (`code`, `problem`, `retryable`) and a redacted message;
79
+ - for a cancellation or interruption: the reason.
80
+ - **The input** is kept by reference: a digest of the messages and tool names, their count and roles.
81
+ The application keeps the conversation itself.
82
+ - **Evidence:** a checkpoint FeltDB verifies at commit cites each final record.
83
+ `GET /api/agent/tasks/<id>/generations` (and `AgentHost.generations`) returns each generation with
84
+ the proposals and observations its tool calls led to.
85
+ - **A failure reaches the app as an error** whose `details.generationId` names the record.
86
+
87
+ ## Tools and proposals
88
+
89
+ `ctx.agent.tools()` lists the application capabilities the caller may use, with the JSON Schema of
90
+ their input (the model's tool parameters) and their effect. `ctx.agent.propose(...)`:
91
+
92
+ - **observation** (a query capability): runs now, through AppPort, as the caller; its output comes back.
93
+ - **consequential** (a mutation capability): recorded as `proposed`. It runs only when its owner
94
+ approves it, as the owner, through AppPort, once (compare-and-swap transitions; a duplicate or
95
+ concurrent approval does not run it again).
96
+ - The same `idempotencyKey` on the same task returns the first proposal.
97
+ - With `model`, the proposer is recorded as `model:<provider>/<model>` acting for the owner
98
+ (`onBehalfOf`), so the person approving is never the proposer.
99
+
100
+ ## Approvals in the application
101
+
102
+ The signed-in person approves their own proposals from the application, with the same server-side
103
+ rules as Studio (a person, not an agent; may perform the capability; the owner may too), plus
104
+ ownership: another person's tasks do not exist for them.
105
+
106
+ | | |
107
+ |---|---|
108
+ | `GET /api/agent/actions?state=proposed` | the caller's own actions |
109
+ | `POST /api/agent/actions/approve` / `reject` `{ taskId, actionId }` | runs it (approve) and returns its outcome, with the activity record that is its receipt |
110
+ | `GET /api/agent/tasks/<id>/generations` | the turn's generation records |
111
+ | `GET /api/agent/actions/events` | live (server-sent events): the caller's actions now, and again whenever FeltDB's agent state changes them, from any client or process; re-read from FeltDB each time |
112
+ | `client.ownActions`, `client.watchOwnActions`, `client.approveAction`, `client.rejectAction`, `useOwnActions` (live) | the same from the client |
113
+
114
+ **Proposal timing and authority:**
115
+ - **Expiry:** a consequential proposal can be approved until its `expiresAt`. The default is 24 hours (`agent.proposalTtlMs`). After that, approving is refused (`FAILED_PRECONDITION`) and the proposal is cancelled as expired. The next start sweeps proposals nobody touched.
116
+ - **Authority at proposal time, for model tool calls:** a model's tool call for a capability its owner may not use (one it was never offered) is refused when proposed (`FORBIDDEN`, recorded as `agent.action.refused`). Other proposers (MCP agents, playbooks) keep the recoverable contract: such a proposal is recorded and refused at approval until the owner is granted the capability.
117
+
118
+ **On a FeltDB server**, agent state is not in FeltKit's change markers, so the live stream also re-reads every 2 seconds there (10 seconds locally).
119
+
120
+ ## Caller context
121
+
122
+ The client sends the user's IANA time zone and locale with every request (`X-FeltKit-Time-Zone`,
123
+ `X-FeltKit-Locale`, from the browser by default; `createClient({ context })` overrides or turns it
124
+ off). The server validates them; functions read `ctx.auth.context.timeZone` and `.locale` (null when
125
+ not sent, e.g. jobs). A preference for interpreting and presenting dates, never authority.
126
+
127
+ ## Proven by
128
+
129
+ `packages/sdk/test/agent-hardening.test.ts` (timeout and disconnect mid-stream, unreachable provider, restart
130
+ during a generation, cancellation racing tool execution, concurrent and duplicate approvals over HTTP,
131
+ expiry, unauthorized tool calls, concurrent conversations, live approval state, no credential leaks),
132
+ `packages/sdk/test/generation.test.ts` (loopback OpenAI and Anthropic streaming servers, plus one real
133
+ provider when `AI_GATEWAY_API_KEY` or `OPENAI_API_KEY` is set) and the Resolver test in
134
+ `test/resolver-model.test.ts` (generation follows a reference change with no restart; a change during a
135
+ running generation never mixes revisions). The application
136
+ acceptance is rkendel1/personalos (`tests/turn.test.ts`, `tests/real-provider.test.ts`, `e2e/acceptance.mjs`).
package/docs/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # FeltKit 0.3.21 documentation
1
+ # FeltKit 0.3.23 documentation
2
2
 
3
3
  Shipped with `@feltdb/feltkit`. In a project: `node_modules/@feltdb/feltkit/docs/`, or run `npx feltkit docs`.
4
- Public copy: https://cdn.jsdelivr.net/npm/@feltdb/feltkit@0.3.21/docs/README.md
4
+ Public copy: https://cdn.jsdelivr.net/npm/@feltdb/feltkit@0.3.23/docs/README.md
5
5
 
6
6
  - [ARCHITECTURE.md](ARCHITECTURE.md): How FeltKit is put together: one FeltDB instance, AppPort, AppPort Services
7
7
  - [GUARANTEES.md](GUARANTEES.md): What FeltKit guarantees, and its known limitations
@@ -9,6 +9,7 @@ Public copy: https://cdn.jsdelivr.net/npm/@feltdb/feltkit@0.3.21/docs/README.md
9
9
  - [SECURITY.md](SECURITY.md): Authorization, sessions, credentials, and production Studio
10
10
  - [AUTH.md](AUTH.md): Accounts, sessions, workspaces (tenancy), invitations, and the React sign-in and workspace screens
11
11
  - [AGENT-OPERATIONS.md](AGENT-OPERATIONS.md): Agents: MCP, tasks, proposals, approvals, and evidence
12
+ - [GENERATION.md](GENERATION.md): Model generation in an application: actions, streaming, tools as proposals, in-app approvals, caller context
12
13
  - [RESOLVER.md](RESOLVER.md): Model references: change the model a deployed app uses through Resolver, without a redeploy
13
14
  - [PATH-TO-PRODUCTION.md](PATH-TO-PRODUCTION.md): From a local app to production: deploy targets and what you must provide
14
15
  - [BACKUP.md](BACKUP.md): Backing up and restoring an environment's state
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feltdb/feltkit",
3
- "version": "0.3.21",
3
+ "version": "0.3.23",
4
4
  "description": "FeltKit: one application, one FeltDB instance, one developer experience. SDK, runtime, CLI, and dashboard.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -51,8 +51,6 @@
51
51
  "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p dashboard/tsconfig.json --noEmit && tsc -p test/tsconfig.composition.json",
52
52
  "test": "node --import tsx --test --test-concurrency=1 test/*.test.ts && npm run test:conformance",
53
53
  "test:conformance": "vitest run",
54
- "test:composition-coverage": "node --import tsx --test --test-concurrency=1 --test-timeout=900000 test/coverage/*.test.ts",
55
- "matrix": "node --import tsx test/matrix/run.ts",
56
54
  "prepack": "npm run build"
57
55
  },
58
56
  "dependencies": {
@@ -65,7 +63,7 @@
65
63
  "@appport/server": "1.3.1",
66
64
  "@appport/services": ">=0.16.0 <1.0.0",
67
65
  "@feltdb/core": ">=0.21.0 <1.0.0",
68
- "create-feltkit": "0.3.21",
66
+ "create-feltkit": "0.3.23",
69
67
  "esbuild": "0.25.12",
70
68
  "express": "4.22.3",
71
69
  "mailerport": ">=0.1.0 <1.0.0",
@@ -10,7 +10,7 @@
10
10
  "name": "feltkit",
11
11
  "source": "./",
12
12
  "description": "Skills for building and operating FeltKit applications.",
13
- "version": "0.3.21"
13
+ "version": "0.3.23"
14
14
  }
15
15
  ]
16
16
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://anthropic.com/claude-code/plugin.schema.json",
3
3
  "name": "feltkit",
4
- "version": "0.3.21",
4
+ "version": "0.3.23",
5
5
  "description": "Skills for building and operating FeltKit applications: project structure and SDK, AppPort Services, FeltDB data and consistency, the FeltKit agent over MCP, and operations. Guidance only: they grant no permission.",
6
6
  "author": {
7
7
  "name": "FeltKit"
@@ -1,31 +0,0 @@
1
- import { type CompositionInputs } from "../composition/generate.js";
2
- import { readGeneratedState } from "../composition/reconcile.js";
3
- export { readGeneratedState };
4
- export interface ComposeOptions {
5
- check: boolean;
6
- profile?: string;
7
- include: string[];
8
- /** `capability.parameter=value`, value as JSON when it parses (true, 7, ["a"]), else a string. */
9
- params: string[];
10
- json: boolean;
11
- }
12
- export declare function parseParams(values: string[]): CompositionInputs["params"];
13
- export declare function compose(projectDir: string, options: ComposeOptions): number;
14
- /** `feltkit compose reconcile`: report, never change. */
15
- export declare function reconcileCommand(projectDir: string, json: boolean): Promise<number>;
16
- export interface PlanCommandOptions {
17
- profile?: string;
18
- include: string[];
19
- exclude: string[];
20
- params: string[];
21
- json: boolean;
22
- }
23
- /** `feltkit compose plan`: show what would change, never change it. */
24
- export declare function planCommand(projectDir: string, options: PlanCommandOptions): Promise<number>;
25
- export interface ApplyCommandOptions extends PlanCommandOptions {
26
- approve?: string;
27
- }
28
- /** `feltkit compose apply`: execute exactly one approved plan, and show the evidence. */
29
- export declare function applyCommand(projectDir: string, options: ApplyCommandOptions): Promise<number>;
30
- /** `feltkit compose recover --inspect`: explain an interrupted transaction; change nothing. */
31
- export declare function recoverCommand(projectDir: string, json: boolean): Promise<number>;
@@ -1,274 +0,0 @@
1
- /**
2
- * `feltkit compose`: write the generator-owned foundation files, or check them.
3
- *
4
- * It reads and writes only the three generated paths (composition/generate.ts). It never loads the
5
- * application (feltkit/app.ts imports the generated declaration, so loading it first would be circular)
6
- * and never reads or writes any other file. A generated file that differs from its lock is refused, not
7
- * overwritten: the developer decides what happens to the change.
8
- */
9
- import { mkdirSync, renameSync, writeFileSync } from "node:fs";
10
- import { dirname, join } from "node:path";
11
- import { FeltKitError } from "../errors.js";
12
- import { GENERATED_PATHS, RECORD_PATH, checkFoundation, generateFoundation, } from "../composition/generate.js";
13
- import { readGeneratedState, reconcile } from "../composition/reconcile.js";
14
- import { planComposition } from "../composition/plan.js";
15
- import { executePlan } from "../composition/execute.js";
16
- import { inspectRecovery } from "../composition/recover.js";
17
- export { readGeneratedState };
18
- import { c, line, symbols } from "./output.js";
19
- /** Problems that mean a generated file is not what the generator wrote: never overwritten. */
20
- const REFUSE = new Set(["GENERATED_FILE_MODIFIED", "RECORD_MODIFIED", "RECORD_MALFORMED", "LOCK_MALFORMED", "UNTRACKED_GENERATED_FILE"]);
21
- export function parseParams(values) {
22
- const params = {};
23
- for (const raw of values) {
24
- const eq = raw.indexOf("=");
25
- const key = eq < 0 ? raw : raw.slice(0, eq);
26
- const dot = key.lastIndexOf(".");
27
- if (eq < 0 || dot <= 0 || dot === key.length - 1) {
28
- throw new FeltKitError("INVALID_ARGUMENT", `--param ${raw} is not <capability>.<parameter>=<value>.`, { hint: "For example --param identity.accounts.emailFrom=auth@example.com" });
29
- }
30
- const text = raw.slice(eq + 1);
31
- let value = text;
32
- try {
33
- value = JSON.parse(text);
34
- }
35
- catch {
36
- // Not JSON: the string itself.
37
- }
38
- const capability = key.slice(0, dot);
39
- const parameter = key.slice(dot + 1);
40
- const own = (params[capability] ??= {});
41
- if (parameter in own)
42
- throw new FeltKitError("INVALID_ARGUMENT", `--param ${key} was given more than once; give it once.`);
43
- own[parameter] = value;
44
- }
45
- return params;
46
- }
47
- function printProblem(p) {
48
- line(`${symbols.fail} ${p.code}${p.file ? ` ${p.file}` : ""}: ${p.message}`);
49
- if (p.expected !== undefined)
50
- line(` expected ${p.expected}`);
51
- if (p.observed !== undefined)
52
- line(` observed ${p.observed}`);
53
- for (const r of p.recovery)
54
- line(c.dim(` - ${r}`));
55
- }
56
- /** Write atomically (temporary file, then rename), so an interrupted run never leaves half a file. */
57
- function write(projectDir, path, text) {
58
- const file = join(projectDir, path);
59
- mkdirSync(dirname(file), { recursive: true });
60
- const temporary = `${file}.${process.pid}.tmp`;
61
- writeFileSync(temporary, text);
62
- renameSync(temporary, file);
63
- }
64
- export function compose(projectDir, options) {
65
- const state = readGeneratedState(projectDir);
66
- const check = checkFoundation(state);
67
- if (options.check) {
68
- if (options.json)
69
- line(JSON.stringify({ ok: check.ok, problems: check.problems }, null, 2));
70
- else if (check.ok)
71
- line(`${symbols.ok} The generated foundation is current: ${GENERATED_PATHS.join(", ")} match ${RECORD_PATH} and FeltKit's definitions.`);
72
- else
73
- check.problems.forEach(printProblem);
74
- return check.ok ? 0 : 1;
75
- }
76
- // Refuse before anything is written: a changed generated file stays exactly as the developer left it.
77
- const refused = check.problems.filter((p) => REFUSE.has(p.code));
78
- if (refused.length) {
79
- refused.forEach(printProblem);
80
- line(`${symbols.fail} Nothing was written. \`feltkit compose\` never overwrites a generated file that was changed after it wrote it.`);
81
- return 1;
82
- }
83
- const fresh = options.profile !== undefined || options.include.length > 0 || options.params.length > 0;
84
- let inputs;
85
- if (fresh) {
86
- if (!options.profile)
87
- throw new FeltKitError("INVALID_ARGUMENT", "Name the profile: feltkit compose --profile <collaborative-workspace|individual-accounts> [--param identity.accounts.emailFrom=<sender>]");
88
- inputs = { profile: options.profile, include: options.include, params: parseParams(options.params) };
89
- }
90
- else if (check.record) {
91
- inputs = { profile: check.record.profile.id, include: check.record.include, params: check.record.params };
92
- }
93
- else {
94
- throw new FeltKitError("INVALID_ARGUMENT", `There is no ${RECORD_PATH} to compose from.`, { hint: "Start one: feltkit compose --profile <collaborative-workspace|individual-accounts> [--param identity.accounts.emailFrom=<sender>]" });
95
- }
96
- const result = generateFoundation(inputs);
97
- if (!result.ok) {
98
- for (const e of result.errors) {
99
- line(`${symbols.fail} ${e.code}${e.capability ? ` ${e.capability}${e.parameter ? `.${e.parameter}` : ""}` : ""}: ${e.message}`);
100
- line(c.dim(` ${e.hint}`));
101
- }
102
- line(`${symbols.fail} Nothing was written.`);
103
- return 1;
104
- }
105
- const written = [];
106
- for (const path of GENERATED_PATHS) {
107
- if (state[path] === result.files[path])
108
- continue;
109
- write(projectDir, path, result.files[path]);
110
- written.push(path);
111
- }
112
- if (options.json) {
113
- line(JSON.stringify({ ok: true, written, composition: result.record.composition, capabilities: result.record.capabilities, limitations: result.record.limitations }, null, 2));
114
- return 0;
115
- }
116
- if (!written.length)
117
- line(`${symbols.ok} The generated foundation is already current (${result.record.composition.slice(0, 19)}…). Nothing was written.`);
118
- else
119
- for (const path of written)
120
- line(`${symbols.ok} ${path} written`);
121
- line(c.dim(` ${result.record.profile.id} v${result.record.profile.version}: ${result.record.capabilities.map((x) => `${x.id}@${x.version}`).join(", ")}`));
122
- if (result.record.limitations.length)
123
- line(c.dim(` The application's own tests must uphold: ${result.record.limitations.join(", ")}`));
124
- if (written.includes(GENERATED_PATHS[0]))
125
- line(c.dim(" feltkit/app.ts is yours: import { foundation } from \"./_foundation/declaration.js\" and spread it into feltkit({...})."));
126
- return 0;
127
- }
128
- // ── Reconciliation (read-only) ───────────────────────────────────────────────
129
- function printFinding(f) {
130
- line(`${symbols.fail} ${f.state} · ${f.code}${f.paths.length ? ` ${f.paths.join(", ")}` : ""}${f.confidence === "uncertain" ? c.dim(" (needs a person)") : ""}`);
131
- line(` ${f.what}`);
132
- line(c.dim(` ${f.why}`));
133
- if (f.expected !== undefined)
134
- line(` expected ${f.expected}`);
135
- if (f.observed !== undefined)
136
- line(` observed ${f.observed}`);
137
- for (const n of f.next)
138
- line(c.dim(` - ${n}`));
139
- }
140
- /** `feltkit compose reconcile`: report, never change. */
141
- export async function reconcileCommand(projectDir, json) {
142
- const report = await reconcile(projectDir);
143
- if (json) {
144
- line(JSON.stringify(report, null, 2));
145
- return report.ok ? 0 : 1;
146
- }
147
- if (report.ok) {
148
- line(`${symbols.ok} CURRENT: the generated foundation is what the recorded composition produces with this FeltKit, and ${report.application.file} consumes it.`);
149
- }
150
- else {
151
- line(`${report.state} (${report.findings.length} finding${report.findings.length === 1 ? "" : "s"})`);
152
- report.findings.forEach(printFinding);
153
- }
154
- const r = report.recorded;
155
- if (r.profile)
156
- line(c.dim(` Recorded: ${r.profile.id} v${r.profile.version}; ${r.capabilities.map((x) => `${x.id}@${x.version}`).join(", ")}; ${r.generator}; FeltKit ${r.sdk}; composition ${r.composition?.slice(0, 19)}…`));
157
- line(c.dim(` Installed: ${report.installed.generator}; FeltKit ${report.installed.sdk}`));
158
- const a = report.application;
159
- if (a.status === "analyzed") {
160
- const counts = Object.values(a.consumption ?? {}).reduce((n, k) => ({ ...n, [k]: (n[k] ?? 0) + 1 }), {});
161
- line(c.dim(` ${a.file}: imports the foundation: ${a.imports ? "yes" : "no"}; paths ${Object.entries(counts).map(([k, n]) => `${n} ${k}`).join(", ")}${a.additions?.length ? `; application additions: ${a.additions.join(", ")}` : ""}`));
162
- }
163
- else
164
- line(c.dim(` ${a.file}: not analyzed (${a.reason})`));
165
- line(c.dim(" Nothing was written: reconciliation only reports."));
166
- return report.ok ? 0 : 1;
167
- }
168
- const MARK = { DETERMINISTIC: symbols.ok, REVIEW_REQUIRED: "?", BLOCKED: symbols.fail, UNSUPPORTED: symbols.fail };
169
- function printOperation(o) {
170
- line(`${MARK[o.classification]} ${o.id} ${c.dim(`[${o.classification}, ${o.boundary}]`)}`);
171
- if (o.current !== undefined || o.proposed !== undefined)
172
- line(` ${o.current ?? "—"} → ${o.proposed ?? "—"}`);
173
- line(c.dim(` ${o.reason}`));
174
- if (o.decision)
175
- line(` ${o.classification === "REVIEW_REQUIRED" ? "decide" : "blocked"}: ${o.decision}`);
176
- if (o.dependsOn.length)
177
- line(c.dim(` after ${o.dependsOn.join(", ")}`));
178
- }
179
- /** `feltkit compose plan`: show what would change, never change it. */
180
- export async function planCommand(projectDir, options) {
181
- const plan = await planComposition(projectDir, {
182
- ...(options.profile !== undefined ? { profile: options.profile } : {}),
183
- include: options.include,
184
- exclude: options.exclude,
185
- params: parseParams(options.params),
186
- });
187
- const failed = plan.status === "BLOCKED" || plan.status === "UNSUPPORTED";
188
- if (options.json) {
189
- line(JSON.stringify(plan, null, 2));
190
- return failed ? 1 : 0;
191
- }
192
- line(`${plan.status} ${c.dim(`plan ${plan.id.slice(0, 19)}… · target ${plan.target.source}: ${plan.target.inputs.profile}${plan.target.inputs.include.length ? ` + ${plan.target.inputs.include.join(", ")}` : ""}`)}`);
193
- if (plan.status === "NO_CHANGE")
194
- line(`${symbols.ok} The recorded composition is what the installed definitions produce; nothing would change.`);
195
- const byId = new Map(plan.operations.map((o) => [o.id, o]));
196
- for (const id of plan.order)
197
- printOperation(byId.get(id));
198
- if (plan.affected.files.length)
199
- line(c.dim(` Files: ${plan.affected.files.join(", ")}`));
200
- if (plan.affected.paths.length)
201
- line(c.dim(` Declaration paths: ${plan.affected.paths.join(", ")}`));
202
- if (plan.decisions.length)
203
- line(` ${plan.decisions.length} decision(s) before this can be applied.`);
204
- if (plan.blockers.length)
205
- line(` ${plan.blockers.length} blocker(s).`);
206
- if (plan.unsupported.length)
207
- line(` ${plan.unsupported.length} unsupported target change(s).`);
208
- line(c.dim(" Nothing was written: a plan only shows the change. `feltkit compose --profile … --param …` applies one."));
209
- return failed ? 1 : 0;
210
- }
211
- /** `feltkit compose apply`: execute exactly one approved plan, and show the evidence. */
212
- export async function applyCommand(projectDir, options) {
213
- const result = await executePlan(projectDir, {
214
- ...(options.profile !== undefined ? { profile: options.profile } : {}),
215
- include: options.include,
216
- exclude: options.exclude,
217
- params: parseParams(options.params),
218
- ...(options.approve !== undefined ? { approve: options.approve } : {}),
219
- });
220
- if (options.json) {
221
- line(JSON.stringify(result, null, 2));
222
- return result.ok ? 0 : 1;
223
- }
224
- line(`${result.ok ? symbols.ok : symbols.fail} ${result.code} ${c.dim(result.plan.id ? `plan ${result.plan.id.slice(0, 19)}…` : "")}`);
225
- line(` ${result.message}`);
226
- for (const r of result.operations.refused)
227
- line(c.dim(` refused ${r.id}: ${r.reason}`));
228
- for (const [path, f] of Object.entries(result.files))
229
- if (f.written || f.before !== f.after)
230
- line(` ${f.written ? "written" : "changed"} ${path}: ${f.before?.slice(0, 19) ?? "absent"}… → ${f.after?.slice(0, 19) ?? "absent"}…`);
231
- if (result.operations.executed.length)
232
- line(c.dim(` executed ${result.operations.executed.length} operation(s): ${result.operations.executed.join(", ")}`));
233
- if (result.postconditions.length)
234
- line(c.dim(` verified: ${result.postconditions.join("; ")}`));
235
- for (const e of result.evidence)
236
- line(c.dim(` · ${e}`));
237
- if (result.transaction.outcome === "interrupted" || result.code === "POSTCONDITION_FAILED")
238
- line(` Journal: ${result.transaction.journal}`);
239
- return result.ok ? 0 : 1;
240
- }
241
- // ── Recovery inspection (reads only) ─────────────────────────────────────────
242
- /** `feltkit compose recover --inspect`: explain an interrupted transaction; change nothing. */
243
- export async function recoverCommand(projectDir, json) {
244
- const report = await inspectRecovery(projectDir);
245
- if (json) {
246
- line(JSON.stringify(report, null, 2));
247
- return report.ok ? 0 : 1;
248
- }
249
- line(`${report.ok ? symbols.ok : symbols.fail} ${report.state}${report.journal.present ? c.dim(` journal ${report.journal.path} (${report.journal.valid ? `phase ${report.journal.phase}, plan ${report.journal.plan?.slice(0, 19)}…` : "invalid"})`) : c.dim(" no journal")}`);
250
- for (const p of report.journal.problems)
251
- line(` journal: ${p}`);
252
- for (const f of report.files) {
253
- line(` ${f.class.padEnd(10)} ${f.path}${f.committed ? c.dim(" (journaled as replaced)") : ""}`);
254
- line(c.dim(` ${f.reason}`));
255
- line(c.dim(` prior ${f.prior ?? "absent"} · expected ${f.expected} · observed ${f.observed ?? "absent"}`));
256
- if (f.priorSources.length || f.expectedSources.length)
257
- line(c.dim(` prior bytes: ${f.priorSources.join(", ") || "no verified source"} · expected bytes: ${f.expectedSources.join(", ") || "no verified source"}`));
258
- }
259
- for (const s of report.staged)
260
- line(c.dim(` staged temporary ${s.path} (${s.sha256 ?? "unreadable"}${s.matches ? `, for ${s.matches}` : ""}): not an output`));
261
- for (const cand of report.candidates)
262
- line(` ${cand.state} state: ${cand.complete ? "complete" : cand.restorable ? `restorable (${cand.differing.map((d) => d.path).join(", ")} differ)` : `not restorable from verified sources (${cand.differing.filter((d) => !d.sources.length).map((d) => d.path).join(", ")} have none)`}`);
263
- if (report.verification.integrity !== null)
264
- line(c.dim(` as the files are: \`feltkit compose --check\` ${report.verification.integrity ? "passes" : `fails (${report.verification.integrityProblems.join(", ")})`}${report.verification.reconciliation ? `; reconciliation ${report.verification.reconciliation}` : ""}`));
265
- for (const g of report.evidenceGaps)
266
- line(` evidence gap: ${g}`);
267
- if (report.actions.length) {
268
- line(" What to do:");
269
- report.actions.forEach((a, i) => line(` ${i + 1}. ${a}`));
270
- }
271
- line(c.dim(` This inspection will not: ${report.willNot.join("; ")}.`));
272
- return report.ok ? 0 : 1;
273
- }
274
- //# sourceMappingURL=compose.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compose.js","sourceRoot":"","sources":["../../src/cli/compose.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,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