@feltdb/feltkit 0.3.22 → 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 (143) 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 -1197
  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 -1170
  109. package/dist/cli/domain.js.map +0 -1
  110. package/dist/cli/screens.d.ts +0 -25
  111. package/dist/cli/screens.js +0 -282
  112. package/dist/cli/screens.js.map +0 -1
  113. package/dist/cli/shell.d.ts +0 -7
  114. package/dist/cli/shell.js +0 -63
  115. package/dist/cli/shell.js.map +0 -1
  116. package/dist/composition/catalog.d.ts +0 -3
  117. package/dist/composition/catalog.js +0 -217
  118. package/dist/composition/catalog.js.map +0 -1
  119. package/dist/composition/contract.d.ts +0 -165
  120. package/dist/composition/contract.js +0 -12
  121. package/dist/composition/contract.js.map +0 -1
  122. package/dist/composition/execute.d.ts +0 -110
  123. package/dist/composition/execute.js +0 -350
  124. package/dist/composition/execute.js.map +0 -1
  125. package/dist/composition/generate.d.ts +0 -105
  126. package/dist/composition/generate.js +0 -274
  127. package/dist/composition/generate.js.map +0 -1
  128. package/dist/composition/plan.d.ts +0 -131
  129. package/dist/composition/plan.js +0 -558
  130. package/dist/composition/plan.js.map +0 -1
  131. package/dist/composition/profiles.d.ts +0 -20
  132. package/dist/composition/profiles.js +0 -81
  133. package/dist/composition/profiles.js.map +0 -1
  134. package/dist/composition/reconcile.d.ts +0 -153
  135. package/dist/composition/reconcile.js +0 -282
  136. package/dist/composition/reconcile.js.map +0 -1
  137. package/dist/composition/recover.d.ts +0 -89
  138. package/dist/composition/recover.js +0 -407
  139. package/dist/composition/recover.js.map +0 -1
  140. package/dist/composition/resolve.d.ts +0 -2
  141. package/dist/composition/resolve.js +0 -208
  142. package/dist/composition/resolve.js.map +0 -1
  143. package/dist/dashboard/assets/index-BrC1AtZ1.js +0 -15
@@ -1,219 +0,0 @@
1
- import type { CapabilityId } from "../composition/contract.js";
2
- import { DECLARATION_PATH, LOCK_PATH, RECORD_PATH, type GenerateResult } from "../composition/generate.js";
3
- import type { Profile } from "../composition/contract.js";
4
- import { type Entity, type Tenancy } from "./domain.js";
5
- export type { Entity, Tenancy } from "./domain.js";
6
- export type AppKind = "business" | "portal" | "collaboration" | "marketplace" | "operations" | "personal" | "custom";
7
- export type Participant = "customers" | "staff" | "administrators" | "partners" | "collaborators" | "agents";
8
- /** `workspaces`: the kind's data belongs to organizations people join (the default answer); `individuals`: to each person. */
9
- export declare const APP_KINDS: ReadonlyArray<{
10
- value: AppKind;
11
- label: string;
12
- hint: string;
13
- tenancy: Tenancy;
14
- }>;
15
- /** `needs`: a participant that exists only with workspaces (membership, invitation into one). */
16
- export declare const PARTICIPANTS: ReadonlyArray<{
17
- value: Participant;
18
- label: string;
19
- hint: string;
20
- needs?: Tenancy;
21
- }>;
22
- /** The two foundations, as the requirement a developer states. The profile follows from the answer; nothing else selects it. */
23
- export declare const TENANCIES: ReadonlyArray<{
24
- value: Tenancy;
25
- label: string;
26
- hint: string;
27
- profile: Profile;
28
- }>;
29
- /** A catalog capability, explained for a developer who does not know the platform. Every id is a real catalog entry. */
30
- export interface CapabilityGuide {
31
- readonly id: CapabilityId;
32
- readonly label: string;
33
- readonly provides: string;
34
- readonly addresses: string;
35
- readonly constraints: string;
36
- readonly applicationOwned: string;
37
- /** Offered only when it fits the participants chosen; always offered when absent. */
38
- readonly offeredFor?: readonly Participant[];
39
- }
40
- export declare const CAPABILITY_GUIDE: readonly CapabilityGuide[];
41
- /** Needs people ask for that no catalog capability composes today. Each line is what the SDK offers instead, verified in source. */
42
- export declare const NOT_COMPOSABLE: ReadonlyArray<{
43
- id: string;
44
- label: string;
45
- status: string;
46
- }>;
47
- export interface Answers {
48
- dir: string;
49
- name: string;
50
- description: string;
51
- kind: AppKind;
52
- participants: Participant[];
53
- /** Optional capabilities the developer selected (profile-required ones are never listed here). */
54
- include: CapabilityId[];
55
- params: Record<string, Record<string, unknown>>;
56
- entities: Entity[];
57
- workflows: string[];
58
- /** Needs selected from NOT_COMPOSABLE: recorded as application-owned work, never as capabilities. */
59
- notComposable: string[];
60
- /** Permissions the agent role holds (application-owned; only with agents.membership). */
61
- agentPermissions: string[];
62
- /** Whether the application's data belongs to organizations people join. Decides the profile. */
63
- tenancy: Tenancy;
64
- /** With individuals: the application's roles beyond the base one, highest first (application-owned, declared in feltkit/app.ts). */
65
- roles: string[];
66
- /** With individuals: which of `roles` may change anyone's shared records. */
67
- managers: string[];
68
- }
69
- /** The profile the answers select: a function of the stated requirement, not of a flag. */
70
- export declare function profileFor(a: Pick<Answers, "tenancy">): Profile;
71
- export interface Choice {
72
- readonly value: string;
73
- readonly label: string;
74
- readonly hint?: string;
75
- /** Always selected; shown, not askable. */
76
- readonly locked?: boolean;
77
- }
78
- /** How the composer talks to the developer. The terminal implementation is below; tests script one. */
79
- export interface Prompter {
80
- say(text: string): void;
81
- text(prompt: string, options?: {
82
- default?: string;
83
- required?: boolean;
84
- validate?: (value: string) => string | null;
85
- }): Promise<string>;
86
- choose(prompt: string, choices: readonly Choice[], options?: {
87
- default?: string;
88
- }): Promise<string>;
89
- multi(prompt: string, choices: readonly Choice[], options?: {
90
- default?: readonly string[];
91
- }): Promise<string[]>;
92
- confirm(prompt: string, defaultValue: boolean): Promise<boolean>;
93
- }
94
- export declare class Cancelled extends Error {
95
- constructor();
96
- }
97
- /**
98
- * The terminal prompter: numbered choices, comma-separated multiple choices, y/n; an empty required
99
- * answer asks again; "q" cancels; end of input cancels. Lines are queued as they arrive, so answers
100
- * piped in all at once (a script, a test) are not lost between questions.
101
- */
102
- export declare function terminalPrompter(input?: NodeJS.ReadableStream, output?: NodeJS.WritableStream): Prompter & {
103
- close(): void;
104
- };
105
- /** "a" or "an" for a word the developer chose: the workspace noun is theirs, so "a acme" is their word, mis-articled. */
106
- export declare const article: (word: string) => string;
107
- export declare function defaultAnswers(dir: string, name: string): Answers;
108
- type Section = "basics" | "kind" | "participants" | "capabilities" | "details" | "data";
109
- /**
110
- * Ask, section by section, adapting to earlier answers. Returns the answers, or throws Cancelled.
111
- * `sections` limits a pass to what the developer wants to change (the review loop).
112
- */
113
- /**
114
- * Asks what the composition needs.
115
- *
116
- * `brief` is the first pass: it asks what shapes the application — its name, its kind, who the data belongs to, who
117
- * uses it, which capabilities, the one account setting that has no default, and the entities — and leaves every
118
- * other setting at the value it would have suggested anyway. The review then offers them, section by section, to
119
- * anyone who wants them, and a re-ask is never brief.
120
- *
121
- * The first pass used to put around twenty questions between a developer and an application, most of them
122
- * configuration with a perfectly good default: what a workspace is called, the role list, who manages members, who
123
- * may create one, typed claims, a file size limit, notification type names, workflows, and a list of things that
124
- * are not composable at all and are only recorded as text. Each one read as a decision that had to be made before
125
- * anything could exist. They are decisions better made against something that does.
126
- */
127
- export declare function interview(io: Prompter, start: Answers, sections?: readonly Section[], { brief }?: {
128
- brief?: boolean;
129
- }): Promise<Answers>;
130
- /** The composition request the answers translate to: the inputs `feltkit compose` records. */
131
- export declare function compositionInputs(a: Answers): {
132
- profile: string;
133
- include: string[];
134
- params: Record<string, Record<string, unknown>>;
135
- };
136
- export interface Preview {
137
- readonly profile: Profile;
138
- readonly inputs: ReturnType<typeof compositionInputs>;
139
- readonly result: GenerateResult;
140
- readonly explicit: readonly CapabilityId[];
141
- readonly implied: ReadonlyArray<{
142
- id: CapabilityId;
143
- because: string;
144
- }>;
145
- readonly entities: readonly Entity[];
146
- readonly roles: Readonly<Record<string, readonly string[]>>;
147
- readonly notComposable: ReadonlyArray<{
148
- label: string;
149
- status: string;
150
- }>;
151
- readonly applicationOwned: readonly string[];
152
- }
153
- /** What the composition would be: the resolver's own output, plus what the application adds and what stays its own. */
154
- export declare function preview(a: Answers): Preview;
155
- /**
156
- * Who may do what with an entity, operation by operation, from the resolved roles (what the application's roles will
157
- * really grant) and the generated functions' rules: the roles holding each permission, "anyone" for a public read, and
158
- * the ownership or scope rule the function applies after the permission. A description of generated behavior, proven by
159
- * the generated tests; the permission check itself is the runtime's.
160
- */
161
- export declare function authorizationLines(a: Answers, p: Preview, e: Entity): string[];
162
- export declare function renderPreview(a: Answers, p: Preview): string[];
163
- export interface Created {
164
- readonly dir: string;
165
- readonly files: readonly string[];
166
- readonly composition: string | null;
167
- readonly integrity: boolean;
168
- readonly reconciliation: string | null;
169
- readonly next: readonly string[];
170
- }
171
- /** feltkit/app.ts for the answers: application-owned, written once, never touched by composition again. */
172
- export declare function renderAppModule(a: Answers, p: Preview): string;
173
- /** Scaffold the shell, write the application-owned app.ts, compose the foundation with `feltkit compose`, verify. */
174
- export declare function createApplication(a: Answers, p: Preview): Promise<Created>;
175
- export interface CreateOptions {
176
- dir?: string;
177
- name?: string;
178
- description?: string;
179
- kind?: string;
180
- participants: string[];
181
- include: string[];
182
- params: string[];
183
- /** `workspaces` or `individuals`: who the data belongs to (the requirement that selects the foundation). Default: the kind's. */
184
- tenancy?: string;
185
- /** With individuals: application roles beyond the base one, highest first. */
186
- roles: string[];
187
- /** With individuals: which of `roles` manage shared data. */
188
- managers: string[];
189
- /** `name[:workspace|shared|personal][:description]` */
190
- entities: string[];
191
- /** `entity.field:type[?]` (see domain.ts parseFields) */
192
- fields: string[];
193
- /** `entity.field->target[?]` */
194
- refs: string[];
195
- /** Entities owned by their creator. */
196
- owned: string[];
197
- /** Shared entities anyone may read without signing in (list and get public). */
198
- public: string[];
199
- /** Entities whose records carry file attachments (implies services.files). */
200
- attach: string[];
201
- /** Membership claims, `name:type[=default]` (workspaces only; see domain.ts parseClaims). */
202
- claims?: string[];
203
- /** `entity:claim=value[|value]`: the entity's functions require the membership claim. */
204
- require?: string[];
205
- /** `entity.f1,f2` */
206
- unique: string[];
207
- workflows: string[];
208
- yes: boolean;
209
- interactive: boolean;
210
- dryRun: boolean;
211
- json: boolean;
212
- /** Replaceable in tests. */
213
- prompter?: Prompter;
214
- stdinIsTTY?: boolean;
215
- }
216
- /** Answers from flags alone (the machine-usable form); what is missing is named. */
217
- export declare function answersFromOptions(o: CreateOptions): Answers;
218
- export declare function createCommand(o: CreateOptions): Promise<number>;
219
- export { DECLARATION_PATH, LOCK_PATH, RECORD_PATH };