@feltdb/feltkit 0.3.22 → 0.3.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.d.ts +17 -3
- package/dist/app.js +10 -0
- package/dist/app.js.map +1 -1
- package/dist/appboundry/build.js +4 -0
- package/dist/appboundry/build.js.map +1 -1
- package/dist/authorize.d.ts +1 -1
- package/dist/cli/deploy-appboundry.d.ts +26 -0
- package/dist/cli/deploy-appboundry.js +1 -1
- package/dist/cli/deploy-appboundry.js.map +1 -1
- package/dist/cli/main.js +17 -153
- package/dist/cli/main.js.map +1 -1
- package/dist/client/index.d.ts +83 -4
- package/dist/client/index.js +204 -10
- package/dist/client/index.js.map +1 -1
- package/dist/dashboard/assets/index-BEjtLLYq.js +15 -0
- package/dist/dashboard/index.html +1 -1
- package/dist/docs.d.ts +1 -1
- package/dist/docs.js +2 -0
- package/dist/docs.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js.map +1 -1
- package/dist/platform/approvals.d.ts +102 -0
- package/dist/platform/approvals.js +155 -0
- package/dist/platform/approvals.js.map +1 -0
- package/dist/platform/artifacts.d.ts +126 -0
- package/dist/platform/artifacts.js +251 -0
- package/dist/platform/artifacts.js.map +1 -0
- package/dist/platform/blobs.d.ts +25 -0
- package/dist/platform/blobs.js +78 -0
- package/dist/platform/blobs.js.map +1 -0
- package/dist/platform/diff.d.ts +23 -0
- package/dist/platform/diff.js +107 -0
- package/dist/platform/diff.js.map +1 -0
- package/dist/platform/exec.d.ts +182 -0
- package/dist/platform/exec.js +575 -0
- package/dist/platform/exec.js.map +1 -0
- package/dist/platform/managed.d.ts +43 -0
- package/dist/platform/managed.js +137 -0
- package/dist/platform/managed.js.map +1 -0
- package/dist/platform/operations.d.ts +30 -13
- package/dist/platform/operations.js +8 -17
- package/dist/platform/operations.js.map +1 -1
- package/dist/platform/permissions.d.ts +15 -0
- package/dist/platform/permissions.js +16 -0
- package/dist/platform/permissions.js.map +1 -0
- package/dist/platform/platform.d.ts +51 -0
- package/dist/platform/platform.js +105 -6
- package/dist/platform/platform.js.map +1 -1
- package/dist/platform/releases.d.ts +150 -0
- package/dist/platform/releases.js +467 -0
- package/dist/platform/releases.js.map +1 -0
- package/dist/platform/review.d.ts +10 -0
- package/dist/platform/review.js +109 -0
- package/dist/platform/review.js.map +1 -0
- package/dist/platform/server.js +7 -0
- package/dist/platform/server.js.map +1 -1
- package/dist/platform/source.d.ts +2 -0
- package/dist/platform/source.js +1 -1
- package/dist/platform/source.js.map +1 -1
- package/dist/platform/workspace-operations.d.ts +2 -0
- package/dist/platform/workspace-operations.js +605 -0
- package/dist/platform/workspace-operations.js.map +1 -0
- package/dist/platform/workspaces.d.ts +211 -0
- package/dist/platform/workspaces.js +435 -0
- package/dist/platform/workspaces.js.map +1 -0
- package/dist/react/index.d.ts +29 -1
- package/dist/react/index.js +50 -0
- package/dist/react/index.js.map +1 -1
- package/dist/runtime/activity.d.ts +1 -1
- package/dist/runtime/agent.d.ts +216 -2
- package/dist/runtime/agent.js +333 -7
- package/dist/runtime/agent.js.map +1 -1
- package/dist/runtime/approval-rules.d.ts +16 -0
- package/dist/runtime/approval-rules.js +37 -0
- package/dist/runtime/approval-rules.js.map +1 -0
- package/dist/runtime/authboundry.d.ts +53 -0
- package/dist/runtime/authboundry.js +82 -0
- package/dist/runtime/authboundry.js.map +1 -0
- package/dist/runtime/authority.d.ts +18 -1
- package/dist/runtime/authority.js +26 -1
- package/dist/runtime/authority.js.map +1 -1
- package/dist/runtime/browser-inference.d.ts +52 -0
- package/dist/runtime/browser-inference.js +53 -0
- package/dist/runtime/browser-inference.js.map +1 -0
- package/dist/runtime/context.d.ts +110 -0
- package/dist/runtime/decisions.d.ts +23 -0
- package/dist/runtime/decisions.js +54 -0
- package/dist/runtime/decisions.js.map +1 -1
- package/dist/runtime/generation.d.ts +94 -0
- package/dist/runtime/generation.js +295 -0
- package/dist/runtime/generation.js.map +1 -0
- package/dist/runtime/runtime.d.ts +10 -2
- package/dist/runtime/runtime.js +125 -1
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/server/admin.d.ts +9 -1
- package/dist/server/admin.js +84 -2
- package/dist/server/admin.js.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +208 -11
- package/dist/server/index.js.map +1 -1
- package/dist/server/tenancy.js +1 -1
- package/dist/server/tenancy.js.map +1 -1
- package/dist/testing/index.d.ts +11 -0
- package/dist/testing/index.js +7 -3
- package/dist/testing/index.js.map +1 -1
- package/docs/AUTH.md +3 -2
- package/docs/EXTENSION-HOSTS.md +52 -0
- package/docs/GENERATION.md +136 -0
- package/docs/README.md +4 -2
- package/package.json +6 -8
- package/skills/.claude-plugin/marketplace.json +1 -1
- package/skills/.claude-plugin/plugin.json +1 -1
- package/dist/cli/compose.d.ts +0 -31
- package/dist/cli/compose.js +0 -274
- package/dist/cli/compose.js.map +0 -1
- package/dist/cli/create.d.ts +0 -219
- package/dist/cli/create.js +0 -1197
- package/dist/cli/create.js.map +0 -1
- package/dist/cli/domain.d.ts +0 -174
- package/dist/cli/domain.js +0 -1170
- package/dist/cli/domain.js.map +0 -1
- package/dist/cli/screens.d.ts +0 -25
- package/dist/cli/screens.js +0 -282
- package/dist/cli/screens.js.map +0 -1
- package/dist/cli/shell.d.ts +0 -7
- package/dist/cli/shell.js +0 -63
- package/dist/cli/shell.js.map +0 -1
- package/dist/composition/catalog.d.ts +0 -3
- package/dist/composition/catalog.js +0 -217
- package/dist/composition/catalog.js.map +0 -1
- package/dist/composition/contract.d.ts +0 -165
- package/dist/composition/contract.js +0 -12
- package/dist/composition/contract.js.map +0 -1
- package/dist/composition/execute.d.ts +0 -110
- package/dist/composition/execute.js +0 -350
- package/dist/composition/execute.js.map +0 -1
- package/dist/composition/generate.d.ts +0 -105
- package/dist/composition/generate.js +0 -274
- package/dist/composition/generate.js.map +0 -1
- package/dist/composition/plan.d.ts +0 -131
- package/dist/composition/plan.js +0 -558
- package/dist/composition/plan.js.map +0 -1
- package/dist/composition/profiles.d.ts +0 -20
- package/dist/composition/profiles.js +0 -81
- package/dist/composition/profiles.js.map +0 -1
- package/dist/composition/reconcile.d.ts +0 -153
- package/dist/composition/reconcile.js +0 -282
- package/dist/composition/reconcile.js.map +0 -1
- package/dist/composition/recover.d.ts +0 -89
- package/dist/composition/recover.js +0 -407
- package/dist/composition/recover.js.map +0 -1
- package/dist/composition/resolve.d.ts +0 -2
- package/dist/composition/resolve.js +0 -208
- package/dist/composition/resolve.js.map +0 -1
- package/dist/dashboard/assets/index-BrC1AtZ1.js +0 -15
package/dist/cli/main.js
CHANGED
|
@@ -30,8 +30,6 @@ import { createInterface } from "node:readline/promises";
|
|
|
30
30
|
import { createInterface as createLineReader } from "node:readline";
|
|
31
31
|
import { Readable } from "node:stream";
|
|
32
32
|
import { feltdbContract, formatContract } from "../runtime/contract.js";
|
|
33
|
-
import { applyCommand, compose, planCommand, reconcileCommand, recoverCommand } from "./compose.js";
|
|
34
|
-
import { createCommand } from "./create.js";
|
|
35
33
|
import { checkSkills, installSkills, shippedSkills, skillsTarget } from "./skills.js";
|
|
36
34
|
import { c, line, printInspect, symbols } from "./output.js";
|
|
37
35
|
import { PACKAGE_PAGE, SHIPPED_DOCS, docFile, docUrl } from "../docs.js";
|
|
@@ -83,7 +81,7 @@ const HELP = `${c.bold("feltkit")} ${c.dim(SDK_VERSION)} — one application, on
|
|
|
83
81
|
${c.bold("Usage")} feltkit <command> [options]
|
|
84
82
|
|
|
85
83
|
${c.bold("Commands")}
|
|
86
|
-
create
|
|
84
|
+
create <dir> Create a working application from a starter (tasks by default; --template managed)
|
|
87
85
|
dev Run the development environment: backend, frontend, dashboard, hot reload
|
|
88
86
|
build Bundle the backend, build the frontend, and verify the result
|
|
89
87
|
start Run the production build (environment: production)
|
|
@@ -108,7 +106,6 @@ ${c.bold("Commands")}
|
|
|
108
106
|
config <action> Export or import non-secret configuration between environments
|
|
109
107
|
codegen Regenerate feltkit/_generated/api.ts
|
|
110
108
|
contract Write the FeltDB application contract (for Managed FeltDB)
|
|
111
|
-
compose Generate the application's foundation from a profile; --check, reconcile, plan, apply, recover --inspect
|
|
112
109
|
doctor Check the project and installation for problems
|
|
113
110
|
skills <action> Install, update, or check the FeltKit skills for coding agents
|
|
114
111
|
docs [<name>] List FeltKit's documentation (shipped in the package), or print one document
|
|
@@ -141,92 +138,11 @@ export function helpFor(command, action) {
|
|
|
141
138
|
return own.length ? own.map((b) => b.join("\n")).join("\n") : text;
|
|
142
139
|
}
|
|
143
140
|
const COMMAND_HELP = {
|
|
144
|
-
create: "feltkit create
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"
|
|
149
|
-
" workspaces and invitations are included, roles, ownership and scope per entity, generated vs. your files,\n" +
|
|
150
|
-
" the foundation's limitations), lets you change any section, and writes only after you confirm: the shell, your\n" +
|
|
151
|
-
" feltkit/app.ts, and the generated foundation (feltkit/_foundation/declaration.ts, feltkit.composition.json,\n" +
|
|
152
|
-
" feltkit.composition.lock.json) through `feltkit compose`. Inside an existing application it never writes:\n" +
|
|
153
|
-
" it reconciles, plans the addition you choose, and prints the exact `feltkit compose apply --approve` command.\n" +
|
|
154
|
-
"feltkit create <dir> --yes [--data-belongs-to workspaces|individuals] [--param identity.accounts.emailFrom=<sender>] [--name <n>]\n" +
|
|
155
|
-
" [--description <d>] [--kind <k>] [--participant <p>]… [--include <capability>]… [--param <c>.<p>=<v>]… [--role <r>]… [--manager <r>]…\n" +
|
|
156
|
-
" [--entity <name>[:workspace|shared|personal][:description]]…\n" +
|
|
157
|
-
" [--field <entity>.<name>:string|number|boolean|enum(a|b)[?]]… [--ref <entity>.<field>-><entity>[?]]… [--owned <entity>]… [--public <entity>]… [--attach <entity>]…\n" +
|
|
158
|
-
" [--unique <entity>.<f1>,<f2>]… [--claim <name>:string|number|integer|boolean|enum(a|b)[=default]]… [--require <entity>:<claim>=<value>[|<value>]]…\n" +
|
|
159
|
-
" [--workflow <w>]… [--dry-run] [--json]\n" +
|
|
160
|
-
" The same, without questions (for scripts and non-interactive terminals). --data-belongs-to states the requirement\n" +
|
|
161
|
-
" that selects the foundation (default: the kind's; `personal` means individuals); with workspaces the sender is\n" +
|
|
162
|
-
" required and roles are the workspace's; with individuals --role/--manager declare the application's roles and\n" +
|
|
163
|
-
" entities default to personal. --claim declares typed membership claims (workspaces only; recorded in the\n" +
|
|
164
|
-
" composition, set per member through the server, never by a request); --require makes every function of a\n" +
|
|
165
|
-
" workspace-scoped entity demand one. --dry-run shows the composition and writes nothing. --interactive answers the\n" +
|
|
166
|
-
" questions over a pipe.\n" +
|
|
167
|
-
"feltkit create <dir> --template tasks|managed [--name <n>]\n" +
|
|
168
|
-
" A starter instead of a composition: the task manager, or the Managed FeltDB inventory API.",
|
|
169
|
-
docs: "feltkit docs List the documentation shipped with this install\n" +
|
|
170
|
-
"feltkit docs <name> Print one document (e.g. feltkit docs guarantees)\n" +
|
|
171
|
-
" Offline: the files are in node_modules/@feltdb/feltkit/docs. --json lists name, file and public URL.",
|
|
172
|
-
backup: "feltkit backup create [--env development] [--out <file>]\n" +
|
|
173
|
-
"feltkit backup verify <file>\n" +
|
|
174
|
-
"feltkit backup list [--dir .feltkit/backups]\n" +
|
|
175
|
-
"feltkit backup restore <file> --env <env>\n" +
|
|
176
|
-
" One application's state (feltkit.backup/1; `feltkit docs backup`): its contract, migration history, records,\n" +
|
|
177
|
-
" AppPort Services records and outbox; never sessions. `create` reads a running development server through\n" +
|
|
178
|
-
" its admin API (calls pause while it reads), else the stopped environment directly. `restore` writes only\n" +
|
|
179
|
-
" into a new, empty environment, after verifying the whole backup; an interrupted restore is refused at start.\n" +
|
|
180
|
-
" Local FeltDB state only: a FeltDB server's backups are `feltdb-server backup`.",
|
|
181
|
-
outbox: "feltkit outbox list [--state pending|performing|done|failed] [--env development] [--json]\n" +
|
|
182
|
-
"feltkit outbox retry <id> [--env development]\n" +
|
|
183
|
-
" After-commit effects (ctx.afterCommit) are recorded with the mutation and performed after it commits:\n" +
|
|
184
|
-
" done, or failed with the error. A failed effect is never retried on its own; `retry` moves it back to\n" +
|
|
185
|
-
" pending (attempts and last error kept) and performs it again as its caller. Delivery is at least once.",
|
|
186
|
-
dev: "feltkit dev [--port 3000] [--host 127.0.0.1] [--no-frontend]\n Development environment: state in .feltkit/development/state.",
|
|
187
|
-
build: "feltkit build [--target appboundry] [--out <dir>]\n Writes .feltkit/build/functions.mjs and dist/client, then loads the bundle to verify it.\n --target appboundry also compiles <name>.app: manifest.json, module.wasm (imports nothing) and the\n frontend, which AppBoundry (@appport/appboundry 1.3.0 or later) runs without this project, Node tooling, or FeltKit. Test the artifact itself\n with createArtifactTestApp(<name>.app) from @feltdb/feltkit/testing. Without --target, lists what would\n block the AppBoundry target.",
|
|
188
|
-
start: "feltkit start [--port $PORT] [--host 0.0.0.0] [--env production] [--no-migrate]\n Uses FELTDB_URL + FELTDB_TOKEN when set, else FELTKIT_STATE_DIR or .feltkit/production/state.\n Installs the schema feltkit/ declares when FeltDB accepts it (with pending app.migration()s), and refuses\n to start when it would strand or violate stored records. --no-migrate (or FELTKIT_MIGRATE=manual): refuse\n to start on any schema change until `feltkit migrate` applies it.",
|
|
189
|
-
migrate: "feltkit migrate [--env development] [--dry-run] [--yes] [--json]\n Compares the schema your collections declare with the one installed in the environment's FeltDB,\n runs pending app.migration()s on a copy, checks every resulting record, and shows the plan. Then\n (after you confirm, or with --yes) applies it as one FeltDB transaction: the migrations' writes and the\n new schema together, or nothing. History: `feltkit migrate --history`. A FeltDB server or Managed\n FeltDB enforces the contract published to it instead (`feltkit contract`).",
|
|
190
|
-
test: "feltkit test [files…]\n Runs node --test on tests/**/*.test.ts with FELTKIT_ENV=test.",
|
|
191
|
-
inspect: "feltkit inspect [--json] [--env development]\n Reads from the running server when there is one; otherwise opens the environment directly.",
|
|
192
|
-
contract: "feltkit contract [--out feltdb.contract.json] [--check]\n" +
|
|
193
|
-
" Writes the FeltDB application contract: this application's collections, FeltKit's own records, and FeltDB's\n" +
|
|
194
|
-
" agent state. Managed FeltDB stores only what the promoted contract declares; publish it with\n" +
|
|
195
|
-
" `feltdb publish --contract feltdb.contract.json`. --check exits 1 when the file is out of date.",
|
|
196
|
-
compose: "feltkit compose --profile <profile> [--include <capability>]… [--param <capability>.<parameter>=<value>]…\n" +
|
|
197
|
-
" Resolves the profile and writes three generator-owned files: feltkit/_foundation/declaration.ts (the\n" +
|
|
198
|
-
" `foundation` that feltkit/app.ts spreads into feltkit({...})), feltkit.composition.json (the record) and\n" +
|
|
199
|
-
" feltkit.composition.lock.json (the lock). A value is JSON when it parses (true, 7, [\"a\"]), else a string.\n" +
|
|
200
|
-
" It never touches feltkit/app.ts and refuses to overwrite a generated file changed by hand.\n" +
|
|
201
|
-
"feltkit compose\n" +
|
|
202
|
-
" Regenerates from the recorded composition (after a FeltKit upgrade); writes only files that change.\n" +
|
|
203
|
-
"feltkit compose --check [--json]\n" +
|
|
204
|
-
" Exits 1 when a generated file was edited, the state is incomplete, or the profile, a capability or the\n" +
|
|
205
|
-
" generator changed since the files were written. It changes nothing.\n" +
|
|
206
|
-
"feltkit compose reconcile [--json]\n" +
|
|
207
|
-
" Explains how the recorded foundation relates to this FeltKit and to the application: CURRENT,\n" +
|
|
208
|
-
" GENERATION_STALE, DEFINITION_CHANGED, GENERATED_FILE_MODIFIED or _MISSING, RECORD_MISSING, LOCK_MISSING,\n" +
|
|
209
|
-
" INCOMPLETE, INCOMPATIBLE, FOUNDATION_NOT_CONSUMED, REVIEW_REQUIRED, NOT_COMPOSED. Loads the application\n" +
|
|
210
|
-
" the way `feltkit build` does to see what it consumes. Exits 1 unless CURRENT. Writes nothing.\n" +
|
|
211
|
-
"feltkit compose plan [--profile <p>] [--include <c>]… [--exclude <c>]… [--param <c>.<param>=<value>]… [--json]\n" +
|
|
212
|
-
" Plans the change from the recorded composition to a target: with no flags, the target the installed\n" +
|
|
213
|
-
" definitions imply for the recorded inputs (labelled implied); with flags, the recorded inputs with those\n" +
|
|
214
|
-
" changes. Prints the operations (DETERMINISTIC, REVIEW_REQUIRED, BLOCKED, UNSUPPORTED), their order,\n" +
|
|
215
|
-
" affected files and paths, decisions and blockers. Exits 1 when BLOCKED or UNSUPPORTED. Executes and\n" +
|
|
216
|
-
" writes nothing.\n" +
|
|
217
|
-
"feltkit compose apply [same target flags] --approve <plan id> [--json]\n" +
|
|
218
|
-
" Executes exactly the plan whose id is approved: the plan is recomputed for the target and must have\n" +
|
|
219
|
-
" that id, every operation must be deterministic and in the executable slice (parameter changes,\n" +
|
|
220
|
-
" capability additions and updates, regeneration), and the files must be what the plan saw. Writes only\n" +
|
|
221
|
-
" feltkit/_foundation/declaration.ts, feltkit.composition.json and feltkit.composition.lock.json, through a\n" +
|
|
222
|
-
" journaled staged write, then verifies integrity and reconciliation (CURRENT). Refuses, before any write,\n" +
|
|
223
|
-
" a plan needing a decision, a blocked or unsupported one, a changed state, or a missing approval.\n" +
|
|
224
|
-
"feltkit compose recover --inspect [--json]\n" +
|
|
225
|
-
" Reads an interrupted execution's journal (.feltkit/composition/transaction.json) as untrusted input, compares\n" +
|
|
226
|
-
" each journaled file with its recorded prior and expected hashes, classifies every file (PRIOR, EXPECTED,\n" +
|
|
227
|
-
" MISSING, UNEXPECTED, UNREADABLE, UNVERIFIABLE) and the transaction, says which consistent state can be\n" +
|
|
228
|
-
" restored from which verified source, and what to do. Exits 1 whenever a journal exists. Changes nothing:\n" +
|
|
229
|
-
" it never restores, deletes, regenerates or removes the journal.",
|
|
141
|
+
create: "feltkit create <dir> [--template tasks|managed] [--name <n>]\n" +
|
|
142
|
+
" A complete, working application you can run, read and change the same minute: `cd <dir> && npm install &&\n" +
|
|
143
|
+
" npm run dev`. tasks (the default) is a task manager with projects, tasks, notes, file attachments,\n" +
|
|
144
|
+
" notifications delivered by a background job, search and an activity feed, roles, an agent and its own tests;\n" +
|
|
145
|
+
" managed is an inventory API against Managed FeltDB. This is what `npm create feltkit` runs.",
|
|
230
146
|
deploy: "feltkit deploy [--target appboundry|container|hosted|self-hosted|vercel|cloudflare|fly|appboundry-self-hosted] [--portal <url>] [--host <id>] [--data volume|managed|self-hosted] [--instances <n>] [--out <dir>] [--yes]\n" +
|
|
231
147
|
" Builds, verifies the build boots, and writes .feltkit/deploy for how you run it:\n" +
|
|
232
148
|
" container everything in one container: the app and its FeltDB state on a volume (default)\n" +
|
|
@@ -323,7 +239,7 @@ const COMMAND_HELP = {
|
|
|
323
239
|
" Invokes one as the workspace owner, through the same AppPort application agents use over /appport and /mcp\n" +
|
|
324
240
|
" (via the running `feltkit platform serve` for that root, else in process). `project` is relative to --root\n" +
|
|
325
241
|
" (default: the current directory). Every invocation is recorded with its decision id. Exit code 1 when refused or failed.",
|
|
326
|
-
platform: "feltkit platform serve [--root <dir>] [--port <n>] [--host 127.0.0.1]\n" +
|
|
242
|
+
platform: "feltkit platform serve [--root <dir>] [--port <n>] [--host 127.0.0.1] [--reconcile]\n" +
|
|
327
243
|
" Serves the platform's capabilities over AppPort (/appport, /appport/manifest) and MCP (/mcp) for the projects\n" +
|
|
328
244
|
" under --root. Every request carries a platform session; it is checked on every call, so a revoked one stops at\n" +
|
|
329
245
|
" its next request. MCP lists only the tools the session's profile grants.\n" +
|
|
@@ -501,39 +417,10 @@ export async function main(argv = process.argv.slice(2), deps = {}) {
|
|
|
501
417
|
const envName = String(flags.env ?? (command === "start" ? "production" : "development"));
|
|
502
418
|
switch (command) {
|
|
503
419
|
case "create": {
|
|
504
|
-
//
|
|
505
|
-
if (!flags.template && !flags.managed) {
|
|
506
|
-
const list = (values) => (values ?? []).flatMap((v) => v.split(",")).map((v) => v.trim()).filter(Boolean);
|
|
507
|
-
return createCommand({
|
|
508
|
-
...(positional[0] ? { dir: positional[0] } : {}),
|
|
509
|
-
...(typeof flags.name === "string" ? { name: flags.name } : {}),
|
|
510
|
-
...(typeof flags.description === "string" ? { description: flags.description } : {}),
|
|
511
|
-
...(typeof flags.kind === "string" ? { kind: flags.kind } : {}),
|
|
512
|
-
...(typeof flags["data-belongs-to"] === "string" ? { tenancy: flags["data-belongs-to"] } : {}),
|
|
513
|
-
participants: list(lists.participant),
|
|
514
|
-
roles: list(lists.role),
|
|
515
|
-
managers: list(lists.manager),
|
|
516
|
-
include: list(lists.include),
|
|
517
|
-
params: lists.param ?? [],
|
|
518
|
-
entities: lists.entity ?? [],
|
|
519
|
-
fields: lists.field ?? [],
|
|
520
|
-
refs: lists.ref ?? [],
|
|
521
|
-
owned: list(lists.owned),
|
|
522
|
-
public: list(lists.public),
|
|
523
|
-
attach: list(lists.attach),
|
|
524
|
-
claims: lists.claim ?? [],
|
|
525
|
-
require: lists.require ?? [],
|
|
526
|
-
unique: lists.unique ?? [],
|
|
527
|
-
workflows: lists.workflow ?? [],
|
|
528
|
-
yes: flags.yes === true,
|
|
529
|
-
interactive: flags.interactive === true,
|
|
530
|
-
dryRun: flags["dry-run"] === true,
|
|
531
|
-
json,
|
|
532
|
-
});
|
|
533
|
-
}
|
|
420
|
+
// `feltkit create my-app` scaffolds a complete, working application. There is one route and it is this one.
|
|
534
421
|
const dir = positional[0];
|
|
535
422
|
if (!dir)
|
|
536
|
-
throw new FeltKitError("INVALID_ARGUMENT", "Tell me where to create the app: feltkit create my-app
|
|
423
|
+
throw new FeltKitError("INVALID_ARGUMENT", "Tell me where to create the app: feltkit create my-app");
|
|
537
424
|
let result;
|
|
538
425
|
try {
|
|
539
426
|
const template = flags.managed ? "managed" : String(flags.template ?? "tasks");
|
|
@@ -575,37 +462,6 @@ export async function main(argv = process.argv.slice(2), deps = {}) {
|
|
|
575
462
|
line(c.dim("Publish it to Managed FeltDB with `npx feltdb publish --contract " + (flags.out ?? "feltdb.contract.json") + " --yes`."));
|
|
576
463
|
return 0;
|
|
577
464
|
}
|
|
578
|
-
case "compose": {
|
|
579
|
-
if (positional[0] === "reconcile")
|
|
580
|
-
return reconcileCommand(projectDir, json);
|
|
581
|
-
if (positional[0] === "recover") {
|
|
582
|
-
if (flags.inspect !== true)
|
|
583
|
-
throw new FeltKitError("INVALID_ARGUMENT", "feltkit compose recover only inspects in this version: feltkit compose recover --inspect [--json]", { hint: "Recovery itself is a person's: the inspection says which files to restore from which verified source, and when the journal may be removed." });
|
|
584
|
-
return recoverCommand(projectDir, json);
|
|
585
|
-
}
|
|
586
|
-
if (positional[0] === "plan" || positional[0] === "apply") {
|
|
587
|
-
const list = (values) => (values ?? []).flatMap((v) => v.split(",")).map((v) => v.trim()).filter(Boolean);
|
|
588
|
-
const target = {
|
|
589
|
-
...(typeof flags.profile === "string" ? { profile: flags.profile } : {}),
|
|
590
|
-
include: list(lists.include),
|
|
591
|
-
exclude: list(lists.exclude),
|
|
592
|
-
params: lists.param ?? [],
|
|
593
|
-
json,
|
|
594
|
-
};
|
|
595
|
-
if (positional[0] === "apply")
|
|
596
|
-
return applyCommand(projectDir, { ...target, ...(typeof flags.approve === "string" ? { approve: flags.approve } : {}) });
|
|
597
|
-
return planCommand(projectDir, target);
|
|
598
|
-
}
|
|
599
|
-
if (positional[0])
|
|
600
|
-
throw new FeltKitError("INVALID_ARGUMENT", `feltkit compose has no "${positional[0]}" action.`, { hint: "feltkit compose [--profile … --param …] | feltkit compose --check | feltkit compose reconcile | feltkit compose plan [--profile … --include … --exclude … --param …] | feltkit compose apply … --approve <plan id> | feltkit compose recover --inspect" });
|
|
601
|
-
return compose(projectDir, {
|
|
602
|
-
check: flags.check === true,
|
|
603
|
-
...(typeof flags.profile === "string" ? { profile: flags.profile } : {}),
|
|
604
|
-
include: (lists.include ?? []).flatMap((v) => v.split(",")).map((v) => v.trim()).filter(Boolean),
|
|
605
|
-
params: lists.param ?? [],
|
|
606
|
-
json,
|
|
607
|
-
});
|
|
608
|
-
}
|
|
609
465
|
case "docs": {
|
|
610
466
|
const wanted = positional[0]?.toUpperCase().replace(/\.MD$/, "");
|
|
611
467
|
if (!wanted) {
|
|
@@ -1703,6 +1559,14 @@ export async function main(argv = process.argv.slice(2), deps = {}) {
|
|
|
1703
1559
|
line(` AppPort ${served.url}/appport ${c.dim(`(manifest ${served.url}/appport/manifest)`)}`);
|
|
1704
1560
|
line(` MCP ${served.url}/mcp`);
|
|
1705
1561
|
line(c.dim("Every request needs a platform session: `feltkit platform session create --id <agent> --profile inspect|develop`."));
|
|
1562
|
+
// --reconcile: after a machine restart, start again what should be running (release.reconcile for each environment).
|
|
1563
|
+
if (flags.reconcile) {
|
|
1564
|
+
const caller = { principal: { id: "feltkit:reconciler", type: "service", roles: [] }, decisionId: "reconcile-on-start", requestId: `reconcile_${Date.now()}` };
|
|
1565
|
+
for (const env of await platform.releases.environments()) {
|
|
1566
|
+
const r = await platform.releases.reconcile(env.application, env.environment, caller).catch((error) => ({ action: "failed", reason: error.message }));
|
|
1567
|
+
line(` ${r.action === "restarted" ? symbols.ok : r.action === "failed" ? symbols.fail : symbols.info} reconcile ${env.application}/${env.environment}: ${r.action} (${r.reason})`);
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1706
1570
|
await waitForShutdown(async () => {
|
|
1707
1571
|
await served.close();
|
|
1708
1572
|
await platform.close();
|