@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
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The v1 capability catalog: only what the Collaborative Workspace foundation uses and FeltKit
|
|
3
|
-
* implements today (the repository's capability catalog document describes each entry). Each entry selects existing `feltkit({...})`
|
|
4
|
-
* options; `evidence` names the SDK code and the tests that prove them. Defaults are the SDK's own,
|
|
5
|
-
* and a contribution sets only what differs from them, so a composed declaration reads like a
|
|
6
|
-
* handwritten one.
|
|
7
|
-
*
|
|
8
|
-
* Parameter checks are about the parameter's shape only. Rules between options stay where they are
|
|
9
|
-
* enforced today, in `feltkit({...})` (app.ts); the resolver runs them on every result.
|
|
10
|
-
*/
|
|
11
|
-
import { claimSpecProblem } from "../runtime/claims.js";
|
|
12
|
-
const isName = (v) => typeof v === "string" && /^[a-z][a-z0-9_-]{0,63}$/.test(v);
|
|
13
|
-
const name = (description, defaultValue) => ({
|
|
14
|
-
description,
|
|
15
|
-
...(defaultValue === undefined ? {} : { default: defaultValue }),
|
|
16
|
-
check: (v) => (isName(v) ? null : `must be a lowercase name (letters, digits, "-", "_"), got ${JSON.stringify(v)}`),
|
|
17
|
-
});
|
|
18
|
-
const flag = (description, defaultValue) => ({
|
|
19
|
-
description,
|
|
20
|
-
default: defaultValue,
|
|
21
|
-
check: (v) => (typeof v === "boolean" ? null : `must be true or false, got ${JSON.stringify(v)}`),
|
|
22
|
-
});
|
|
23
|
-
const names = (description, defaultValue, { nonEmpty = false } = {}) => ({
|
|
24
|
-
description,
|
|
25
|
-
default: defaultValue,
|
|
26
|
-
check: (v) => {
|
|
27
|
-
if (!Array.isArray(v) || v.some((x) => !isName(x)))
|
|
28
|
-
return `must be a list of lowercase names, got ${JSON.stringify(v)}`;
|
|
29
|
-
if (nonEmpty && v.length === 0)
|
|
30
|
-
return "must name at least one";
|
|
31
|
-
if (new Set(v).size !== v.length)
|
|
32
|
-
return "must not repeat a name";
|
|
33
|
-
return null;
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
const textList = (description) => ({
|
|
37
|
-
description,
|
|
38
|
-
default: [],
|
|
39
|
-
check: (v) => (Array.isArray(v) && v.every((x) => typeof x === "string" && x.trim() !== "") ? null : `must be a list of non-empty strings, got ${JSON.stringify(v)}`),
|
|
40
|
-
});
|
|
41
|
-
const accounts = {
|
|
42
|
-
id: "identity.accounts",
|
|
43
|
-
version: 1,
|
|
44
|
-
purpose: "People sign up and sign in with an e-mail address (password, and optionally an e-mailed sign-in link); sessions are FeltKit's.",
|
|
45
|
-
parameters: {
|
|
46
|
-
baseRole: name("The role every account holds: grants nothing until the person joins a workspace.", "person"),
|
|
47
|
-
signUp: flag("Open sign-up.", true),
|
|
48
|
-
password: flag("Password sign-in.", true),
|
|
49
|
-
magicLink: flag("E-mailed sign-in link with a code (needs emailFrom).", false),
|
|
50
|
-
emailFrom: {
|
|
51
|
-
description: "Sender of account e-mail (verification, sign-in links, invitations), delivered through Mailerport.",
|
|
52
|
-
default: null,
|
|
53
|
-
check: (v) => (v === null || (typeof v === "string" && /^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/.test(v)) ? null : `must be an e-mail address, got ${JSON.stringify(v)}`),
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
requires: [],
|
|
57
|
-
conflicts: [],
|
|
58
|
-
contribute: (p) => ({
|
|
59
|
-
roles: { [p.baseRole]: [] },
|
|
60
|
-
auth: {
|
|
61
|
-
accounts: {
|
|
62
|
-
roles: [p.baseRole],
|
|
63
|
-
...(p.signUp ? {} : { signUp: false }),
|
|
64
|
-
...(p.password ? {} : { password: false }),
|
|
65
|
-
...(p.magicLink ? { magicLink: true } : {}),
|
|
66
|
-
...(p.emailFrom ? { email: { from: p.emailFrom } } : {}),
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
}),
|
|
70
|
-
evidence: { sdk: ["packages/sdk/src/runtime/accounts.ts", "packages/sdk/src/runtime/challenges.ts", "packages/sdk/src/runtime/sessions.ts"], tests: ["packages/sdk/test/accounts.test.ts", "packages/sdk/test/challenges.test.ts", "examples/teams/tests/foundation.test.ts"] },
|
|
71
|
-
ownership: "declaration",
|
|
72
|
-
};
|
|
73
|
-
const tenancy = {
|
|
74
|
-
id: "workspace.tenancy",
|
|
75
|
-
version: 1,
|
|
76
|
-
purpose: "Workspaces: people and agents are members with a role; a session works in one workspace, checked against the live membership on every call; workspace data is scoped to it.",
|
|
77
|
-
parameters: {
|
|
78
|
-
noun: name("What the app calls a workspace (messages and built-in screens).", "workspace"),
|
|
79
|
-
roles: names("Member roles, highest first. The first is the workspace's top role.", ["owner", "admin", "member", "guest"], { nonEmpty: true }),
|
|
80
|
-
managers: names("Roles that manage members (invite, change roles, remove) without owning the workspace.", ["admin"]),
|
|
81
|
-
claims: {
|
|
82
|
-
description: 'Typed claims each membership carries beside its role, set only through the server: claim specs as plain data ({ plan: { type: "enum", values: ["free", "pro"] } }; types enum, string, boolean, number, integer; optional default), which the composition record holds; or schemas (s.enum([...])), which only feltkit/app.ts can hold.',
|
|
83
|
-
default: {},
|
|
84
|
-
check: (v) => {
|
|
85
|
-
if (v === null || typeof v !== "object" || Array.isArray(v))
|
|
86
|
-
return 'must map claim names to claim specs ({ type: "enum", values: [...] }) or schemas';
|
|
87
|
-
for (const [name, declaration] of Object.entries(v)) {
|
|
88
|
-
const problem = claimSpecProblem(name, declaration);
|
|
89
|
-
if (problem)
|
|
90
|
-
return `${name}: ${problem}`;
|
|
91
|
-
}
|
|
92
|
-
return null;
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
create: { description: 'Who may create a workspace: "anyone" signed in, or "none" through the API.', default: "anyone", check: (v) => (v === "anyone" || v === "none" ? null : `must be "anyone" or "none", got ${JSON.stringify(v)}`) },
|
|
96
|
-
},
|
|
97
|
-
validate: (p) => [
|
|
98
|
-
...p.managers.filter((m) => !p.roles.includes(m)).map((m) => ({ parameter: "managers", problem: `names "${m}", which is not one of roles (${p.roles.join(", ")})` })),
|
|
99
|
-
...(p.managers.includes(p.roles[0]) ? [{ parameter: "managers", problem: `names "${p.roles[0]}", the top role, which already holds every tenant permission` }] : []),
|
|
100
|
-
],
|
|
101
|
-
requires: [],
|
|
102
|
-
conflicts: [],
|
|
103
|
-
contribute: (p, context) => {
|
|
104
|
-
const [top] = p.roles;
|
|
105
|
-
const roles = {};
|
|
106
|
-
for (const role of p.roles)
|
|
107
|
-
roles[role] = role === top ? ["tenant.*"] : p.managers.includes(role) ? ["tenant.members.manage"] : [];
|
|
108
|
-
return {
|
|
109
|
-
roles,
|
|
110
|
-
auth: {
|
|
111
|
-
tenant: {
|
|
112
|
-
name: p.noun,
|
|
113
|
-
roles: [...p.roles],
|
|
114
|
-
...(Object.keys(p.claims).length ? { claims: { ...p.claims } } : {}),
|
|
115
|
-
...(p.create === "anyone" ? {} : { create: p.create }),
|
|
116
|
-
// Invitations are on unless turned off (app.ts TenantOptions): without workspace.invitations they are off.
|
|
117
|
-
...(context.has("workspace.invitations") ? {} : { invitations: false }),
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
};
|
|
121
|
-
},
|
|
122
|
-
evidence: { sdk: ["packages/sdk/src/runtime/tenancy.ts", "packages/sdk/src/runtime/tenant-scope.ts"], tests: ["packages/sdk/test/tenancy.test.ts", "packages/sdk/test/data-isolation.test.ts", "examples/teams/tests/foundation.test.ts"] },
|
|
123
|
-
ownership: "declaration",
|
|
124
|
-
};
|
|
125
|
-
const invitations = {
|
|
126
|
-
id: "workspace.invitations",
|
|
127
|
-
version: 1,
|
|
128
|
-
purpose: "Members who manage members invite people by e-mail address with a role; only that verified address accepts, once.",
|
|
129
|
-
parameters: {
|
|
130
|
-
ttlDays: { description: "How long an invitation is valid (FeltKit allows up to 30 days).", default: 7, check: (v) => (Number.isInteger(v) && v >= 1 && v <= 30 ? null : `must be a whole number of days from 1 to 30, got ${JSON.stringify(v)}`) },
|
|
131
|
-
},
|
|
132
|
-
requires: ["workspace.tenancy"],
|
|
133
|
-
conflicts: [],
|
|
134
|
-
contribute: (p) => (p.ttlDays === 7 ? {} : { auth: { tenant: { invitations: { ttlMs: p.ttlDays * 86_400_000 } } } }),
|
|
135
|
-
evidence: { sdk: ["packages/sdk/src/runtime/tenancy.ts (invite, accept)"], tests: ["packages/sdk/test/tenancy.test.ts", "examples/teams/tests/foundation.test.ts"] },
|
|
136
|
-
ownership: "declaration",
|
|
137
|
-
};
|
|
138
|
-
const agentMembership = {
|
|
139
|
-
id: "agents.membership",
|
|
140
|
-
version: 1,
|
|
141
|
-
purpose: "Agents join workspaces directly (no invitation) with a member role that grants nothing by itself; their permissions come from their declared roles. The agent itself (app.agent) is application code.",
|
|
142
|
-
parameters: { role: name("The workspace role agents hold.", "agent") },
|
|
143
|
-
requires: ["workspace.tenancy"],
|
|
144
|
-
conflicts: [],
|
|
145
|
-
contribute: (p) => ({ roles: { [p.role]: [] }, auth: { tenant: { roles: [p.role] } } }),
|
|
146
|
-
evidence: { sdk: ["packages/sdk/src/runtime/tenancy.ts (addPrincipal: agents and services join directly)", "packages/sdk/src/app.ts (app.agent)"], tests: ["packages/sdk/test/agent-lifecycle.test.ts", "packages/sdk/test/tenancy.test.ts"] },
|
|
147
|
-
ownership: "declaration",
|
|
148
|
-
};
|
|
149
|
-
const operator = {
|
|
150
|
-
id: "ops.operator",
|
|
151
|
-
version: 1,
|
|
152
|
-
purpose: "An operator role for production Studio: models, credentials, configuration, API keys, webhooks, jobs, schedules and FeltKit operations, separate from workspace roles.",
|
|
153
|
-
parameters: { role: name("The operator role.", "operator") },
|
|
154
|
-
requires: [],
|
|
155
|
-
conflicts: [],
|
|
156
|
-
contribute: (p) => ({ roles: { [p.role]: ["intelligence.*", "credential.*", "configuration.*", "apikeys.*", "webhooks.*", "jobs.*", "schedules.*", "feltkit.operations.*"] } }),
|
|
157
|
-
evidence: { sdk: ["packages/sdk/src/server/admin.ts", "packages/sdk/src/runtime/services.ts"], tests: ["packages/sdk/test/production-ops.test.ts"] },
|
|
158
|
-
ownership: "declaration",
|
|
159
|
-
};
|
|
160
|
-
const files = {
|
|
161
|
-
id: "services.files",
|
|
162
|
-
version: 1,
|
|
163
|
-
purpose: "File storage (AppPort Services files): upload links, downloads, content in the application's FeltDB. Who may read a file stays application policy.",
|
|
164
|
-
parameters: { maxBytes: { description: "Largest file (FeltKit's default is 1 MiB).", default: null, check: (v) => (v === null || (Number.isInteger(v) && v > 0) ? null : `must be a positive whole number of bytes, got ${JSON.stringify(v)}`) } },
|
|
165
|
-
requires: [],
|
|
166
|
-
conflicts: [],
|
|
167
|
-
contribute: (p) => ({ services: { files: p.maxBytes === null ? true : { maxBytes: p.maxBytes } } }),
|
|
168
|
-
evidence: { sdk: ["packages/sdk/src/runtime/services.ts", "packages/sdk/src/runtime/content.ts"], tests: ["packages/sdk/test/services.test.ts"] },
|
|
169
|
-
ownership: "declaration",
|
|
170
|
-
};
|
|
171
|
-
const notifications = {
|
|
172
|
-
id: "services.notifications",
|
|
173
|
-
version: 1,
|
|
174
|
-
purpose: "Per-principal notifications (AppPort Services), sent after a mutation commits (ctx.afterCommit.notifications).",
|
|
175
|
-
parameters: { types: textList("Notification types the application sends (offered in Studio).") },
|
|
176
|
-
requires: [],
|
|
177
|
-
conflicts: [],
|
|
178
|
-
contribute: (p) => ({ services: { notifications: p.types.length ? { types: [...p.types] } : true } }),
|
|
179
|
-
evidence: { sdk: ["packages/sdk/src/runtime/services.ts", "packages/sdk/src/runtime/outbox.ts"], tests: ["packages/sdk/test/outbox.test.ts", "packages/sdk/test/services.test.ts"] },
|
|
180
|
-
ownership: "declaration",
|
|
181
|
-
};
|
|
182
|
-
const jobs = {
|
|
183
|
-
id: "services.jobs",
|
|
184
|
-
version: 1,
|
|
185
|
-
purpose: "Background jobs (AppPort Services): a job type runs a FeltKit function as the enqueuer.",
|
|
186
|
-
parameters: {
|
|
187
|
-
handlers: {
|
|
188
|
-
description: 'Job type → "<module>:<function>".',
|
|
189
|
-
default: {},
|
|
190
|
-
check: (v) => (v !== null && typeof v === "object" && !Array.isArray(v) && Object.values(v).every((f) => typeof f === "string" && /^[A-Za-z0-9_/-]+:[A-Za-z0-9_]+$/.test(f)) ? null : 'must map job types to "<module>:<function>"'),
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
requires: [],
|
|
194
|
-
conflicts: [],
|
|
195
|
-
contribute: (p) => ({ services: { jobs: Object.keys(p.handlers).length ? { handlers: { ...p.handlers } } : true } }),
|
|
196
|
-
evidence: { sdk: ["packages/sdk/src/runtime/services.ts"], tests: ["packages/sdk/test/services.test.ts"] },
|
|
197
|
-
ownership: "declaration",
|
|
198
|
-
};
|
|
199
|
-
const schedules = {
|
|
200
|
-
id: "services.schedules",
|
|
201
|
-
version: 1,
|
|
202
|
-
purpose: "Recurring jobs (AppPort Services schedules).",
|
|
203
|
-
parameters: {},
|
|
204
|
-
requires: ["services.jobs"],
|
|
205
|
-
conflicts: [],
|
|
206
|
-
contribute: () => ({ services: { schedules: true } }),
|
|
207
|
-
evidence: { sdk: ["packages/sdk/src/runtime/services.ts", "packages/sdk/src/runtime/services-rules.ts (needs services.jobs, enforced by feltkit({...}))"], tests: ["packages/sdk/test/declaration-rules.test.ts"] },
|
|
208
|
-
ownership: "declaration",
|
|
209
|
-
};
|
|
210
|
-
/**
|
|
211
|
-
* Each entry above is checked as `Capability<P>` for its own parameters. Holding them in one map
|
|
212
|
-
* erases `P` (a function of `P` is not a function of any parameters); this is the only place it happens.
|
|
213
|
-
*/
|
|
214
|
-
const entry = (capability) => Object.freeze(capability);
|
|
215
|
-
/** The catalog, by id. Frozen: resolution never changes it. */
|
|
216
|
-
export const CATALOG = new Map([entry(accounts), entry(tenancy), entry(invitations), entry(agentMembership), entry(operator), entry(files), entry(notifications), entry(jobs), entry(schedules)].map((c) => [c.id, c]));
|
|
217
|
-
//# sourceMappingURL=catalog.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/composition/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,gBAAgB,EAAyB,MAAM,sBAAsB,CAAC;AAG/E,MAAM,MAAM,GAAG,CAAC,CAAU,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,yBAAyB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC1F,MAAM,IAAI,GAAG,CAAC,WAAmB,EAAE,YAAqB,EAAyB,EAAE,CAAC,CAAC;IACnF,WAAW;IACX,GAAG,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;IAChE,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,6DAA6D,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;CACpH,CAAC,CAAC;AACH,MAAM,IAAI,GAAG,CAAC,WAAmB,EAAE,YAAqB,EAA0B,EAAE,CAAC,CAAC;IACpF,WAAW;IACX,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,8BAA8B,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;CAClG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AAE;IACnN,SAAS,EAAE,aAAa;CACzB,CAAC;AAEF;;;GAGG;AACH,MAAM,KAAK,GAAG,CAAoC,UAAyB,EAAc,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAA0B,CAAC;AAE/I,+DAA+D;AAC/D,MAAM,CAAC,MAAM,OAAO,GAA0C,IAAI,GAAG,CACnE,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,eAAe,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CACxL,CAAC"}
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The capability contract. A capability is a named, versioned selection
|
|
3
|
-
* of what FeltKit already offers: it contributes a fragment of the application's `feltkit({...})`
|
|
4
|
-
* declaration and nothing else. Every type here is derived from the public `FeltKitOptions`, so a
|
|
5
|
-
* contribution that names an option the SDK does not have does not compile.
|
|
6
|
-
*
|
|
7
|
-
* This module has no runtime code: the catalog (catalog.ts) holds data and pure functions, and the
|
|
8
|
-
* resolver (resolve.ts) combines them.
|
|
9
|
-
*/
|
|
10
|
-
import type { FeltKitOptions } from "../index.js";
|
|
11
|
-
type Auth = NonNullable<FeltKitOptions["auth"]>;
|
|
12
|
-
type Accounts = NonNullable<Auth["accounts"]>;
|
|
13
|
-
type Tenant = NonNullable<Auth["tenant"]>;
|
|
14
|
-
type Services = NonNullable<FeltKitOptions["services"]>;
|
|
15
|
-
/**
|
|
16
|
-
* What a capability may contribute: the declaration's data options, never a function (an `authorize`
|
|
17
|
-
* hook, an `authenticate` hook or a decision runtime is application code, not composition data).
|
|
18
|
-
* Fragments are partial; the resolver merges them and the result is checked by `feltkit({...})`.
|
|
19
|
-
*/
|
|
20
|
-
export interface FoundationOptions {
|
|
21
|
-
roles?: Record<string, string[]>;
|
|
22
|
-
auth?: {
|
|
23
|
-
accounts?: Partial<Accounts>;
|
|
24
|
-
tenant?: Partial<Tenant>;
|
|
25
|
-
};
|
|
26
|
-
services?: Partial<Services>;
|
|
27
|
-
}
|
|
28
|
-
/** Capability ids in the v1 catalog. A closed union: an unknown id does not compile in catalog or profile code. */
|
|
29
|
-
export type CapabilityId = "identity.accounts" | "workspace.tenancy" | "workspace.invitations" | "agents.membership" | "ops.operator" | "services.files" | "services.notifications" | "services.jobs" | "services.schedules";
|
|
30
|
-
/** A parameter the capability accepts: its JSON-able default (absent means required) and a check. */
|
|
31
|
-
export interface ParameterSpec<T> {
|
|
32
|
-
readonly description: string;
|
|
33
|
-
/** Present: the parameter is optional and takes this value. Absent: required. */
|
|
34
|
-
readonly default?: T;
|
|
35
|
-
/** Returns a problem (what is wrong and what to give instead) or null. */
|
|
36
|
-
readonly check: (value: unknown) => string | null;
|
|
37
|
-
}
|
|
38
|
-
/** What a contribution may read: the resolved parameters of the capabilities selected, and which are selected. */
|
|
39
|
-
export interface ResolutionContext {
|
|
40
|
-
has(id: CapabilityId): boolean;
|
|
41
|
-
params(id: CapabilityId): Readonly<Record<string, unknown>>;
|
|
42
|
-
}
|
|
43
|
-
export interface Capability<P extends Record<string, unknown> = Record<string, unknown>> {
|
|
44
|
-
readonly id: CapabilityId;
|
|
45
|
-
/** Contract major: what the capability guarantees. A change to what it contributes for the same parameters is a new version. */
|
|
46
|
-
readonly version: 1;
|
|
47
|
-
readonly purpose: string;
|
|
48
|
-
readonly parameters: {
|
|
49
|
-
readonly [K in keyof P]-?: ParameterSpec<P[K]>;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Consistency between this capability's own parameters (a rule no declaration option can carry, e.g.
|
|
53
|
-
* the manager roles must be workspace roles). Rules between declaration options stay in feltkit({...}).
|
|
54
|
-
*/
|
|
55
|
-
readonly validate?: (params: Readonly<P>) => ReadonlyArray<{
|
|
56
|
-
parameter: keyof P & string;
|
|
57
|
-
problem: string;
|
|
58
|
-
}>;
|
|
59
|
-
/** Hard dependencies: resolution fails when one is not selected (it is never added silently). */
|
|
60
|
-
readonly requires: readonly CapabilityId[];
|
|
61
|
-
/** Capabilities it cannot be combined with. */
|
|
62
|
-
readonly conflicts: readonly CapabilityId[];
|
|
63
|
-
/**
|
|
64
|
-
* The declaration fragment, a pure function of the parameters. Only values that differ from the
|
|
65
|
-
* SDK's own defaults are set, so a composed declaration reads like a handwritten one.
|
|
66
|
-
*/
|
|
67
|
-
readonly contribute: (params: Readonly<P>, context: ResolutionContext) => FoundationOptions;
|
|
68
|
-
/** Where the SDK implements it and which tests prove it (repository paths). */
|
|
69
|
-
readonly evidence: {
|
|
70
|
-
readonly sdk: readonly string[];
|
|
71
|
-
readonly tests: readonly string[];
|
|
72
|
-
};
|
|
73
|
-
/** Composition owns the contributed declaration; application behavior stays the application's. */
|
|
74
|
-
readonly ownership: "declaration";
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Guarantees the platform enforces for every application, whatever the profile, so a caller may require
|
|
78
|
-
* them (`requireEnforced`) and every result records them. Each names where the SDK enforces it.
|
|
79
|
-
*/
|
|
80
|
-
export declare const ENFORCED_GUARANTEES: ReadonlyArray<{
|
|
81
|
-
readonly id: string;
|
|
82
|
-
readonly guarantee: string;
|
|
83
|
-
readonly enforcedBy: string;
|
|
84
|
-
}>;
|
|
85
|
-
/** A guarantee a profile needs that the platform cannot enforce from the declaration. */
|
|
86
|
-
export interface Limitation {
|
|
87
|
-
readonly id: string;
|
|
88
|
-
readonly requirement: string;
|
|
89
|
-
/** How it is upheld today. */
|
|
90
|
-
readonly enforcedBy: "application-tests" | "application-code";
|
|
91
|
-
readonly evidence: readonly string[];
|
|
92
|
-
/** The smallest platform change that would let FeltKit enforce it. */
|
|
93
|
-
readonly platformChange: string;
|
|
94
|
-
}
|
|
95
|
-
/** Profile ids. A closed union: a profile is a reviewed definition in profiles.ts, never free text. */
|
|
96
|
-
export type ProfileId = "collaborative-workspace" | "individual-accounts";
|
|
97
|
-
export interface Profile {
|
|
98
|
-
readonly id: ProfileId;
|
|
99
|
-
readonly version: 1;
|
|
100
|
-
readonly purpose: string;
|
|
101
|
-
/** Always selected. */
|
|
102
|
-
readonly required: readonly CapabilityId[];
|
|
103
|
-
/** Selected only when the caller includes them. */
|
|
104
|
-
readonly optional: readonly CapabilityId[];
|
|
105
|
-
/** Parameter defaults the profile sets on top of each capability's own. */
|
|
106
|
-
readonly defaults: Partial<Record<CapabilityId, Readonly<Record<string, unknown>>>>;
|
|
107
|
-
/** Parameters the caller must give for this profile, even where the capability has a default. */
|
|
108
|
-
readonly requireParameters: Partial<Record<CapabilityId, readonly string[]>>;
|
|
109
|
-
/** What the profile requires that FeltKit cannot enforce: always reported with the result. */
|
|
110
|
-
readonly limitations: readonly Limitation[];
|
|
111
|
-
}
|
|
112
|
-
/** What the caller asks for. Plain data: the same input gives the same result. */
|
|
113
|
-
export interface CompositionRequest {
|
|
114
|
-
readonly profile: string;
|
|
115
|
-
/** The application's name (`feltkit({ name })`), used to run the SDK's declaration checks. */
|
|
116
|
-
readonly name: string;
|
|
117
|
-
/** Optional capabilities of the profile to include. */
|
|
118
|
-
readonly include?: readonly string[];
|
|
119
|
-
/** Parameters per capability. */
|
|
120
|
-
readonly params?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
121
|
-
/**
|
|
122
|
-
* Guarantees the caller requires to be enforced by the platform. One the platform cannot enforce is an
|
|
123
|
-
* error (UNSUPPORTED_REQUIREMENT), never silently accepted.
|
|
124
|
-
*/
|
|
125
|
-
readonly requireEnforced?: readonly string[];
|
|
126
|
-
}
|
|
127
|
-
export type CompositionErrorCode = "UNKNOWN_PROFILE" | "UNKNOWN_CAPABILITY" | "NOT_IN_PROFILE" | "MISSING_DEPENDENCY" | "CONFLICT" | "UNKNOWN_PARAMETER" | "MISSING_PARAMETER" | "INVALID_PARAMETER" | "UNSUPPORTED_OPTION" | "DECLARATION_INVALID" | "UNSUPPORTED_REQUIREMENT";
|
|
128
|
-
export interface CompositionError {
|
|
129
|
-
readonly code: CompositionErrorCode;
|
|
130
|
-
readonly message: string;
|
|
131
|
-
/** What to do about it. */
|
|
132
|
-
readonly hint: string;
|
|
133
|
-
readonly capability?: string;
|
|
134
|
-
readonly parameter?: string;
|
|
135
|
-
/** Declaration path, for CONFLICT and UNSUPPORTED_OPTION. */
|
|
136
|
-
readonly path?: string;
|
|
137
|
-
}
|
|
138
|
-
export interface ResolvedCapability {
|
|
139
|
-
readonly id: CapabilityId;
|
|
140
|
-
readonly version: number;
|
|
141
|
-
readonly params: Readonly<Record<string, unknown>>;
|
|
142
|
-
}
|
|
143
|
-
export interface ResolvedComposition {
|
|
144
|
-
readonly profile: {
|
|
145
|
-
readonly id: string;
|
|
146
|
-
readonly version: number;
|
|
147
|
-
};
|
|
148
|
-
/** In resolution order: dependencies first, then by id. */
|
|
149
|
-
readonly capabilities: readonly ResolvedCapability[];
|
|
150
|
-
/** The foundation declaration, to spread into `feltkit({ name, ...options })` with the application's own roles merged in. */
|
|
151
|
-
readonly options: FoundationOptions;
|
|
152
|
-
/** Which capabilities set each declaration path (several, for a list or a role two capabilities extend). */
|
|
153
|
-
readonly provenance: Readonly<Record<string, readonly CapabilityId[]>>;
|
|
154
|
-
readonly limitations: readonly Limitation[];
|
|
155
|
-
/** Platform-enforced guarantees (ENFORCED_GUARANTEES), by id: what the application need not uphold itself. */
|
|
156
|
-
readonly enforced: readonly string[];
|
|
157
|
-
}
|
|
158
|
-
export type CompositionResult = {
|
|
159
|
-
readonly ok: true;
|
|
160
|
-
readonly value: ResolvedComposition;
|
|
161
|
-
} | {
|
|
162
|
-
readonly ok: false;
|
|
163
|
-
readonly errors: readonly CompositionError[];
|
|
164
|
-
};
|
|
165
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Guarantees the platform enforces for every application, whatever the profile, so a caller may require
|
|
3
|
-
* them (`requireEnforced`) and every result records them. Each names where the SDK enforces it.
|
|
4
|
-
*/
|
|
5
|
-
export const ENFORCED_GUARANTEES = Object.freeze([
|
|
6
|
-
{
|
|
7
|
-
id: "authorization.deny-by-default",
|
|
8
|
-
guarantee: 'Every function, event and agent names its access (a permission, "authenticated" or "public"); a declaration without one is refused, and a caller holding no permission is refused on every interface. Being signed in grants nothing.',
|
|
9
|
-
enforcedBy: "packages/sdk/src/app.ts checkAccess (declaration time); packages/sdk/src/runtime/authority.ts Authority.authorize (every call, every transport)",
|
|
10
|
-
},
|
|
11
|
-
]);
|
|
12
|
-
//# sourceMappingURL=contract.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src/composition/contract.ts"],"names":[],"mappings":"AAmFA;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAoG,MAAM,CAAC,MAAM,CAAC;IAChJ;QACE,EAAE,EAAE,+BAA+B;QACnC,SAAS,EAAE,uOAAuO;QAClP,UAAU,EAAE,iJAAiJ;KAC9J;CACF,CAAC,CAAC"}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { PLAN_FORMAT, PLAN_RULES, type CompositionPlan, type Operation, type PlanOptions, type PlanRequest } from "./plan.js";
|
|
2
|
-
import { RECONCILIATION_FORMAT, type ReconciliationState } from "./reconcile.js";
|
|
3
|
-
export declare const EXECUTION_FORMAT = "feltkit.composition-execution/1";
|
|
4
|
-
export declare const ENGINE = "feltkit-compose-apply/1";
|
|
5
|
-
export declare const JOURNAL_FORMAT = "feltkit.composition-journal/1";
|
|
6
|
-
/** Where a transaction's journal lives: under the project's own state directory, never among application files. */
|
|
7
|
-
export declare const JOURNAL_DIR = ".feltkit/composition";
|
|
8
|
-
export declare const JOURNAL_PATH = ".feltkit/composition/transaction.json";
|
|
9
|
-
export type ExecutionCode = "APPLIED" | "NO_CHANGE" | "ALREADY_CURRENT" | "PLAN_MISMATCH" | "STALE_STATE" | "APPROVAL_REQUIRED" | "REVIEW_REQUIRED" | "BLOCKED" | "UNSUPPORTED_OPERATION" | "OWNERSHIP_VIOLATION" | "EXECUTION_FAILED" | "POSTCONDITION_FAILED" | "RECOVERY_REQUIRED";
|
|
10
|
-
/** Operation types this slice executes. Everything else is refused before any write. */
|
|
11
|
-
export declare const EXECUTABLE: ReadonlySet<Operation["type"]>;
|
|
12
|
-
export interface FileOutcome {
|
|
13
|
-
readonly before: string | null;
|
|
14
|
-
readonly after: string | null;
|
|
15
|
-
readonly expected: string | null;
|
|
16
|
-
/** Written by this execution. */
|
|
17
|
-
readonly written: boolean;
|
|
18
|
-
}
|
|
19
|
-
export interface Journal {
|
|
20
|
-
readonly format: typeof JOURNAL_FORMAT;
|
|
21
|
-
/** sha256 of the plan id and the prior hashes: one transaction, one identity. */
|
|
22
|
-
readonly transaction: string;
|
|
23
|
-
readonly plan: string;
|
|
24
|
-
readonly engine: string;
|
|
25
|
-
readonly phase: "staged" | "committing" | "committed" | "verified";
|
|
26
|
-
readonly files: Readonly<Record<string, {
|
|
27
|
-
prior: string | null;
|
|
28
|
-
expected: string;
|
|
29
|
-
}>>;
|
|
30
|
-
/** Paths already renamed into place, in commit order. */
|
|
31
|
-
readonly committed: readonly string[];
|
|
32
|
-
/** Why the transaction stopped, when it did. */
|
|
33
|
-
readonly failure?: string;
|
|
34
|
-
}
|
|
35
|
-
export interface ExecutionResult {
|
|
36
|
-
readonly format: typeof EXECUTION_FORMAT;
|
|
37
|
-
readonly engine: typeof ENGINE;
|
|
38
|
-
readonly code: ExecutionCode;
|
|
39
|
-
readonly ok: boolean;
|
|
40
|
-
readonly message: string;
|
|
41
|
-
readonly approved: string | null;
|
|
42
|
-
readonly plan: {
|
|
43
|
-
readonly id: string | null;
|
|
44
|
-
readonly format: typeof PLAN_FORMAT;
|
|
45
|
-
readonly rules: typeof PLAN_RULES;
|
|
46
|
-
readonly status: CompositionPlan["status"] | null;
|
|
47
|
-
};
|
|
48
|
-
readonly current: {
|
|
49
|
-
readonly composition: string | null;
|
|
50
|
-
readonly inputs: string | null;
|
|
51
|
-
};
|
|
52
|
-
readonly target: {
|
|
53
|
-
readonly composition: string | null;
|
|
54
|
-
readonly inputs: string | null;
|
|
55
|
-
};
|
|
56
|
-
readonly files: Readonly<Record<string, FileOutcome>>;
|
|
57
|
-
readonly operations: {
|
|
58
|
-
readonly executed: readonly string[];
|
|
59
|
-
readonly skipped: ReadonlyArray<{
|
|
60
|
-
id: string;
|
|
61
|
-
reason: string;
|
|
62
|
-
}>;
|
|
63
|
-
readonly refused: ReadonlyArray<{
|
|
64
|
-
id: string;
|
|
65
|
-
reason: string;
|
|
66
|
-
}>;
|
|
67
|
-
};
|
|
68
|
-
readonly preconditions: readonly string[];
|
|
69
|
-
readonly postconditions: readonly string[];
|
|
70
|
-
readonly reconciliation: {
|
|
71
|
-
readonly format: typeof RECONCILIATION_FORMAT;
|
|
72
|
-
readonly state: ReconciliationState | null;
|
|
73
|
-
readonly findings: readonly string[];
|
|
74
|
-
};
|
|
75
|
-
readonly transaction: {
|
|
76
|
-
readonly id: string | null;
|
|
77
|
-
readonly journal: string;
|
|
78
|
-
readonly outcome: "none" | "aborted-before-write" | "committed" | "interrupted";
|
|
79
|
-
};
|
|
80
|
-
/** Facts behind the code: hashes, ids, finding codes. */
|
|
81
|
-
readonly evidence: readonly string[];
|
|
82
|
-
}
|
|
83
|
-
export interface ExecuteOptions extends PlanOptions {
|
|
84
|
-
/** Test hooks at the write protocol's boundaries. A throw stops the transaction there. */
|
|
85
|
-
hooks?: {
|
|
86
|
-
/** After the plan is recomputed, before freshness is verified. */
|
|
87
|
-
afterPlan?: () => void;
|
|
88
|
-
/** After the journal exists (phase staged), before any file is staged. */
|
|
89
|
-
afterJournal?: () => void;
|
|
90
|
-
afterStage?: (path: string) => void;
|
|
91
|
-
beforeCommit?: (path: string, committed: readonly string[]) => void;
|
|
92
|
-
afterCommit?: (path: string, committed: readonly string[]) => void;
|
|
93
|
-
/** After the journal says committed, before postconditions are verified. */
|
|
94
|
-
beforeVerify?: () => void;
|
|
95
|
-
/** After the journal says verified, before it is removed. */
|
|
96
|
-
beforeJournalRemoval?: () => void;
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
export interface ExecuteRequest extends PlanRequest {
|
|
100
|
-
/** The exact plan id being approved (`feltkit compose plan` prints it). Absent: APPROVAL_REQUIRED. */
|
|
101
|
-
readonly approve?: string;
|
|
102
|
-
}
|
|
103
|
-
/** A staged temporary file: `<file>.<pid>.<8 hex of the transaction>.tmp`, beside its target. */
|
|
104
|
-
export declare const STAGED_TEMPORARY: RegExp;
|
|
105
|
-
/**
|
|
106
|
-
* Execute the plan for `request` in `projectDir`, if `request.approve` is its exact id and every
|
|
107
|
-
* operation is executable. Writes only the generator-owned files, and only after every precondition
|
|
108
|
-
* holds; verifies everything afterwards.
|
|
109
|
-
*/
|
|
110
|
-
export declare function executePlan(projectDir: string, request: ExecuteRequest, options?: ExecuteOptions): Promise<ExecutionResult>;
|