@feltdb/feltkit 0.3.24 → 0.3.26

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 (55) hide show
  1. package/dist/app.d.ts +116 -0
  2. package/dist/app.js +73 -1
  3. package/dist/app.js.map +1 -1
  4. package/dist/appboundry/build.d.ts +1 -1
  5. package/dist/appboundry/build.js +18 -4
  6. package/dist/appboundry/build.js.map +1 -1
  7. package/dist/appboundry/guest.d.ts +11 -0
  8. package/dist/appboundry/guest.js +20 -0
  9. package/dist/appboundry/guest.js.map +1 -1
  10. package/dist/cli/main.js +59 -2
  11. package/dist/cli/main.js.map +1 -1
  12. package/dist/dashboard/assets/{index-BXTNQAg1.css → index-BehzsQOa.css} +1 -1
  13. package/dist/dashboard/assets/{index-BEjtLLYq.js → index-Clsfddp8.js} +9 -9
  14. package/dist/dashboard/index.html +2 -2
  15. package/dist/docs.d.ts +1 -1
  16. package/dist/docs.js +1 -0
  17. package/dist/docs.js.map +1 -1
  18. package/dist/index.d.ts +1 -1
  19. package/dist/measure/index.d.ts +117 -0
  20. package/dist/measure/index.js +479 -0
  21. package/dist/measure/index.js.map +1 -0
  22. package/dist/platform/deployments.d.ts +1 -1
  23. package/dist/runtime/application-authority.d.ts +54 -0
  24. package/dist/runtime/application-authority.js +55 -0
  25. package/dist/runtime/application-authority.js.map +1 -0
  26. package/dist/runtime/authboundry.d.ts +25 -13
  27. package/dist/runtime/authboundry.js +15 -7
  28. package/dist/runtime/authboundry.js.map +1 -1
  29. package/dist/runtime/browser-inference.d.ts +2 -2
  30. package/dist/runtime/browser-inference.js +2 -2
  31. package/dist/runtime/context.d.ts +51 -0
  32. package/dist/runtime/runtime.js +56 -10
  33. package/dist/runtime/runtime.js.map +1 -1
  34. package/dist/runtime/services.d.ts +34 -0
  35. package/dist/runtime/services.js +58 -1
  36. package/dist/runtime/services.js.map +1 -1
  37. package/dist/runtime/transactions.d.ts +9 -2
  38. package/dist/runtime/transactions.js +14 -4
  39. package/dist/runtime/transactions.js.map +1 -1
  40. package/dist/server/admin.js +20 -2
  41. package/dist/server/admin.js.map +1 -1
  42. package/dist/server/index.js +21 -1
  43. package/dist/server/index.js.map +1 -1
  44. package/dist/server/project.d.ts +2 -0
  45. package/dist/server/project.js +9 -5
  46. package/dist/server/project.js.map +1 -1
  47. package/docs/GUARANTEES.md +10 -0
  48. package/docs/MEASURE.md +144 -0
  49. package/docs/README.md +3 -2
  50. package/docs/TRANSACTIONS.md +46 -0
  51. package/docs/UPSTREAM-GAPS.md +1 -1
  52. package/package.json +6 -6
  53. package/skills/.claude-plugin/marketplace.json +1 -1
  54. package/skills/.claude-plugin/plugin.json +1 -1
  55. package/skills/feltkit-build/SKILL.md +14 -2
@@ -9,8 +9,8 @@
9
9
  <link rel="apple-touch-icon" href="/_feltkit/apple-touch-icon.png" />
10
10
  <title>FeltKit</title>
11
11
  <script>(function(){try{var v=window.localStorage.getItem("stack-ui.theme");if(v==="light"||v==="dark")document.documentElement.setAttribute("data-stack-theme",v);}catch(e){}})();</script>
12
- <script type="module" crossorigin src="/_feltkit/assets/index-BEjtLLYq.js"></script>
13
- <link rel="stylesheet" crossorigin href="/_feltkit/assets/index-BXTNQAg1.css">
12
+ <script type="module" crossorigin src="/_feltkit/assets/index-Clsfddp8.js"></script>
13
+ <link rel="stylesheet" crossorigin href="/_feltkit/assets/index-BehzsQOa.css">
14
14
  </head>
15
15
  <body>
16
16
  <div id="root"></div>
package/dist/docs.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export declare const PACKAGE_NAME = "@feltdb/feltkit";
2
2
  /** The documents shipped in the package, with what each one answers. Order = reading order. */
3
- export declare const SHIPPED_DOCS: readonly [readonly ["ARCHITECTURE.md", "How FeltKit is put together: one FeltDB instance, AppPort, AppPort Services"], readonly ["GUARANTEES.md", "What FeltKit guarantees, and its known limitations"], readonly ["TRANSACTIONS.md", "Mutations, ctx.db.sequence and ctx.afterCommit: the transaction contract"], readonly ["SECURITY.md", "Authorization, sessions, credentials, and production Studio"], readonly ["AUTH.md", "Accounts, sessions, workspaces (tenancy), invitations, and the React sign-in and workspace screens"], readonly ["EXTENSION-HOSTS.md", "Running the app in a browser extension: ownership, token storage, session end, lifecycle, gaps"], readonly ["AGENT-OPERATIONS.md", "Agents: MCP, tasks, proposals, approvals, and evidence"], readonly ["GENERATION.md", "Model generation in an application: actions, streaming, tools as proposals, in-app approvals, caller context"], readonly ["RESOLVER.md", "Model references: change the model a deployed app uses through Resolver, without a redeploy"], readonly ["PATH-TO-PRODUCTION.md", "From a local app to production: deploy targets and what you must provide"], readonly ["BACKUP.md", "Backing up and restoring an environment's state"], readonly ["COMPONENTS.md", "Runtime components: a gateway or worker that runs with the application, as a declared principal"], readonly ["APPBOUNDRY.md", "The AppBoundry artifact, deploying through AppBoundry, and the self-hosted runtime"], readonly ["APPBOUNDRY-DEPLOY-CONTRACT.md", "The deployment contract FeltKit expects from AppBoundry (proposed)"], readonly ["WHY-FELTKIT.md", "Design choices, compared with Convex"], readonly ["UPSTREAM-GAPS.md", "Known gaps in FeltDB, AppPort and AppPort Services, and their status"]];
3
+ export declare const SHIPPED_DOCS: readonly [readonly ["ARCHITECTURE.md", "How FeltKit is put together: one FeltDB instance, AppPort, AppPort Services"], readonly ["GUARANTEES.md", "What FeltKit guarantees, and its known limitations"], readonly ["TRANSACTIONS.md", "Mutations, ctx.db.sequence and ctx.afterCommit: the transaction contract"], readonly ["SECURITY.md", "Authorization, sessions, credentials, and production Studio"], readonly ["AUTH.md", "Accounts, sessions, workspaces (tenancy), invitations, and the React sign-in and workspace screens"], readonly ["EXTENSION-HOSTS.md", "Running the app in a browser extension: ownership, token storage, session end, lifecycle, gaps"], readonly ["AGENT-OPERATIONS.md", "Agents: MCP, tasks, proposals, approvals, and evidence"], readonly ["GENERATION.md", "Model generation in an application: actions, streaming, tools as proposals, in-app approvals, caller context"], readonly ["RESOLVER.md", "Model references: change the model a deployed app uses through Resolver, without a redeploy"], readonly ["PATH-TO-PRODUCTION.md", "From a local app to production: deploy targets and what you must provide"], readonly ["BACKUP.md", "Backing up and restoring an environment's state"], readonly ["COMPONENTS.md", "Runtime components: a gateway or worker that runs with the application, as a declared principal"], readonly ["APPBOUNDRY.md", "The AppBoundry artifact, deploying through AppBoundry, and the self-hosted runtime"], readonly ["APPBOUNDRY-DEPLOY-CONTRACT.md", "The deployment contract FeltKit expects from AppBoundry (proposed)"], readonly ["WHY-FELTKIT.md", "Design choices, compared with Convex"], readonly ["UPSTREAM-GAPS.md", "Known gaps in FeltDB, AppPort and AppPort Services, and their status"], readonly ["MEASURE.md", "feltkit measure: what an application is made of, its provenance, platform use and app-built infrastructure"]];
4
4
  export type DocName = (typeof SHIPPED_DOCS)[number][0];
5
5
  /** The shipped file on disk (inside node_modules/@feltdb/feltkit in a project). */
6
6
  export declare function docFile(name: DocName): string;
package/dist/docs.js CHANGED
@@ -30,6 +30,7 @@ export const SHIPPED_DOCS = [
30
30
  ["APPBOUNDRY-DEPLOY-CONTRACT.md", "The deployment contract FeltKit expects from AppBoundry (proposed)"],
31
31
  ["WHY-FELTKIT.md", "Design choices, compared with Convex"],
32
32
  ["UPSTREAM-GAPS.md", "Known gaps in FeltDB, AppPort and AppPort Services, and their status"],
33
+ ["MEASURE.md", "feltkit measure: what an application is made of, its provenance, platform use and app-built infrastructure"],
33
34
  ];
34
35
  /** The shipped file on disk (inside node_modules/@feltdb/feltkit in a project). */
35
36
  export function docFile(name) {
package/dist/docs.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"docs.js","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,CAAC,MAAM,YAAY,GAAG,iBAAiB,CAAC;AAC9C,MAAM,OAAO,GAAW,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,I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AC,kBAAkB,EAAE,sEAAsE,CAAC;IAC5F,CAAC,YAAY,EAAE,4GAA4G,CAAC;CACpH,CAAC;AAIX,mFAAmF;AACnF,MAAM,UAAU,OAAO,CAAC,IAAa;IACnC,OAAO,aAAa,CAAC,IAAI,GAAG,CAAC,WAAW,IAAI,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,MAAM,CAAC,IAAc;IACnC,OAAO,gCAAgC,YAAY,IAAI,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAC1G,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,MAAM,CAAC,IAAa;IAClC,OAAO,gBAAgB,YAAY,SAAS,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;AACvE,CAAC;AAED,gFAAgF;AAChF,MAAM,CAAC,MAAM,YAAY,GAAG,iCAAiC,YAAY,EAAE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -21,7 +21,7 @@ export { CLAIM_TYPES, claimSpecProblem, claimSchema, isClaimSpec } from "./runti
21
21
  export type { DatabaseReader, DatabaseWriter, FindOptions, QueryRequest, QueryPage, WhereClause, OrderBy, SearchRequest } from "./runtime/data.js";
22
22
  export type { AuthContext, Principal, PrincipalType } from "./runtime/authority.js";
23
23
  export type { AuthorizeHook, AuthorizeRequest, AuthorizeResult } from "./authorize.js";
24
- export type { EventDefinition } from "./app.js";
24
+ export type { EventDefinition, AuditEvent, AuditTrail } from "./app.js";
25
25
  export type { EventsWriter } from "./runtime/context.js";
26
26
  export type { FileInfo, FilesReader, FilesWriter, UploadInput, NotificationInfo, NotificationsReader, NotificationsWriter, SendNotificationInput, JobsWriter, WebhooksWriter, ConfigurationReader, ConfigurationWriter } from "./runtime/services.js";
27
27
  export type { ModelReferenceOption, ModelResolution } from "./runtime/decisions.js";
@@ -0,0 +1,117 @@
1
+ export declare const MEASURE_SCHEMA = "feltkit.measure/1";
2
+ export declare const MEASURE_CONFIG = "feltkit.measure.json";
3
+ export declare const SCAFFOLD_MANIFEST = "feltkit.scaffold.json";
4
+ /** The classes. `excluded` is counted but is not code (docs, images, lockfiles). */
5
+ export declare const CLASSES: readonly ["domain", "experience", "infrastructure", "generated", "configuration", "tests", "third-party", "platform", "excluded", "unclassified"];
6
+ export type MeasureClass = (typeof CLASSES)[number];
7
+ export declare const CLASS_MEANING: Record<MeasureClass, string>;
8
+ /** Classes the application's own team writes and maintains (tests are reported beside them). */
9
+ export declare const AUTHORED: MeasureClass[];
10
+ export interface MeasureDeclaration {
11
+ /** A path or glob relative to the project (`*` within a segment, `**` across segments). */
12
+ path: string;
13
+ class: MeasureClass;
14
+ reason: string;
15
+ }
16
+ export interface MeasureConfig {
17
+ classify?: MeasureDeclaration[];
18
+ /** Where the scaffold manifest is (default feltkit.scaffold.json). */
19
+ scaffold?: string;
20
+ /** Where `--write` keeps the report and `--check` compares it (default none). */
21
+ report?: string;
22
+ /** Acknowledged infrastructure findings: `<finding id>:<file>` → why it stays. */
23
+ acknowledged?: Record<string, string>;
24
+ }
25
+ export interface MeasuredFile {
26
+ path: string;
27
+ class: MeasureClass;
28
+ basis: string;
29
+ lines: number;
30
+ scaffold?: "unmodified" | "modified";
31
+ }
32
+ export interface Finding {
33
+ id: string;
34
+ title: string;
35
+ file: string;
36
+ line: number;
37
+ evidence: string;
38
+ /** The platform capability that does this, or null when the platform has none yet (a gap candidate). */
39
+ platform: string | null;
40
+ acknowledged?: string;
41
+ }
42
+ export interface Check {
43
+ name: string;
44
+ ok: boolean;
45
+ detail: string;
46
+ fix?: string;
47
+ }
48
+ export interface MeasureReport {
49
+ schema: typeof MEASURE_SCHEMA;
50
+ app: {
51
+ name: string | null;
52
+ feltkit: string | null;
53
+ installed: string | null;
54
+ };
55
+ method: {
56
+ files: string;
57
+ lines: string;
58
+ consumption: string;
59
+ findings: string;
60
+ };
61
+ provenance: {
62
+ scaffold: null | {
63
+ manifest: string;
64
+ generator: string;
65
+ version: string;
66
+ template: string;
67
+ files: number;
68
+ unmodified: number;
69
+ modified: number;
70
+ missing: number;
71
+ };
72
+ generated: {
73
+ file: string;
74
+ current: boolean;
75
+ } | null;
76
+ skills: Array<{
77
+ name: string;
78
+ installedBy: string | null;
79
+ current: boolean | null;
80
+ }>;
81
+ };
82
+ totals: Record<MeasureClass, {
83
+ files: number;
84
+ lines: number;
85
+ }>;
86
+ authored: {
87
+ files: number;
88
+ lines: number;
89
+ };
90
+ definitions: {
91
+ app: Record<string, number>;
92
+ collections: string[];
93
+ };
94
+ consumption: Array<{
95
+ api: string;
96
+ callSites: number;
97
+ files: number;
98
+ }>;
99
+ findings: Finding[];
100
+ checks: Check[];
101
+ files: MeasuredFile[];
102
+ }
103
+ /** The files the repository is made of: tracked plus untracked-not-ignored (git), or a walk. */
104
+ export declare function projectFiles(projectDir: string): string[];
105
+ /** Lines that are code: not blank and not only a comment. JSON/YAML/TOML count non-blank lines. */
106
+ export declare function codeLines(path: string, text: string): number;
107
+ /** `*` matches within a path segment, `**` across segments. */
108
+ export declare function globToRegExp(glob: string): RegExp;
109
+ /** Measure the application at projectDir. `shippedSkills` is the platform's current skill set, if known. */
110
+ export declare function measure(projectDir: string, options?: {
111
+ shippedSkillsDir?: string | null;
112
+ reportFile?: string;
113
+ }): MeasureReport;
114
+ export declare function measureMarkdown(r: MeasureReport): string;
115
+ /** A side-by-side table of several reports (a cross-application comparison). */
116
+ export declare function compareMarkdown(reports: MeasureReport[]): string;
117
+ export declare function relativeTo(projectDir: string, file: string): string;