@north-light/cli 0.3.549 → 0.3.551

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 (161) hide show
  1. package/dist/api/contract.d.ts +1 -1
  2. package/dist/api/contract.js +1 -1
  3. package/dist/api/dto/custom-objects.d.ts +1 -1
  4. package/dist/api/dto/docs.d.ts +12 -0
  5. package/dist/api/dto/objects.d.ts +17 -1
  6. package/dist/api/dto/objects.js +1 -1
  7. package/dist/api/dto/permissions.d.ts +76 -0
  8. package/dist/api/dto/permissions.js +1 -0
  9. package/dist/api/index.d.ts +3 -2
  10. package/dist/api/index.js +1 -1
  11. package/dist/api/routes.d.ts +4 -0
  12. package/dist/api/routes.js +1 -1
  13. package/dist/builtin-memory/crouter-concepts/documents.md +1 -1
  14. package/dist/builtin-memory/crouter-concepts/scopes-and-trust.md +2 -2
  15. package/dist/builtin-memory/crouter-sdk/release-notes.md +11 -0
  16. package/dist/builtin-memory/internal/INDEX.md +2 -1
  17. package/dist/builtin-memory/internal/agent-shaping.md +1 -1
  18. package/dist/builtin-memory/internal/storage-tiers.md +1 -1
  19. package/dist/builtin-memory/northlight-apps/guides/files-and-documents.md +3 -3
  20. package/dist/builtin-memory/northlight-apps/guides/many-users.md +1 -1
  21. package/dist/builtin-memory/northlight-apps/guides/test-your-app.md +1 -1
  22. package/dist/clients/attach/viewer.js +9 -9
  23. package/dist/commands/canvas/list.js +2 -2
  24. package/dist/commands/canvas/share.d.ts +2 -0
  25. package/dist/commands/canvas/share.js +2 -0
  26. package/dist/commands/canvas.js +1 -1
  27. package/dist/commands/doc/edit.js +1 -1
  28. package/dist/commands/doc/shared.js +1 -1
  29. package/dist/commands/doc/write.js +1 -1
  30. package/dist/commands/sys/sync-skills.js +2 -2
  31. package/dist/core/canvas/canvas.js +20 -20
  32. package/dist/core/canvas/db.js +4 -4
  33. package/dist/core/canvas/export-sqlite.js +2 -2
  34. package/dist/core/canvas/import-sqlite.js +5 -5
  35. package/dist/core/canvas/outcome-actions.js +3 -3
  36. package/dist/core/canvas/person.js +11 -9
  37. package/dist/core/canvas/schema-pg.sql +49 -5
  38. package/dist/core/environments.js +1 -1
  39. package/dist/core/feed/feed.js +1 -1
  40. package/dist/core/grants/mirror.d.ts +9 -1
  41. package/dist/core/grants/mirror.js +2 -2
  42. package/dist/core/grants/sync.js +1 -1
  43. package/dist/core/graph/access.d.ts +8 -49
  44. package/dist/core/graph/access.js +4 -7
  45. package/dist/core/graph/custom.d.ts +5 -2
  46. package/dist/core/graph/custom.js +9 -9
  47. package/dist/core/graph/deletion.js +5 -4
  48. package/dist/core/graph/documents.d.ts +12 -3
  49. package/dist/core/graph/documents.js +13 -7
  50. package/dist/core/graph/edges.js +3 -3
  51. package/dist/core/graph/events.js +12 -8
  52. package/dist/core/graph/kinds/document.js +4 -4
  53. package/dist/core/graph/kinds/kind.js +1 -1
  54. package/dist/core/graph/kinds/node.js +5 -5
  55. package/dist/core/graph/names.d.ts +16 -1
  56. package/dist/core/graph/names.js +11 -3
  57. package/dist/core/graph/objects.d.ts +19 -2
  58. package/dist/core/graph/objects.js +16 -10
  59. package/dist/core/graph/package-docs.js +5 -5
  60. package/dist/core/graph/package-files.js +2 -2
  61. package/dist/core/graph/reader.js +3 -3
  62. package/dist/core/graph/repo-sync/exchange.js +2 -2
  63. package/dist/core/graph/rules.d.ts +7 -5
  64. package/dist/core/graph/rules.js +3 -3
  65. package/dist/core/graph/types.d.ts +12 -1
  66. package/dist/core/graph/types.js +1 -1
  67. package/dist/core/graph/watches.d.ts +1 -1
  68. package/dist/core/graph/watches.js +9 -8
  69. package/dist/core/peer/envelope.d.ts +1 -1
  70. package/dist/core/peer/envelope.js +1 -1
  71. package/dist/core/peer/stubs.d.ts +1 -1
  72. package/dist/core/peer/stubs.js +1 -1
  73. package/dist/core/permissions/boot.d.ts +17 -0
  74. package/dist/core/permissions/boot.js +18 -0
  75. package/dist/core/permissions/builtin.d.ts +8 -0
  76. package/dist/core/permissions/builtin.js +20 -0
  77. package/dist/core/permissions/ceiling.d.ts +57 -0
  78. package/dist/core/permissions/ceiling.js +22 -0
  79. package/dist/core/permissions/compile.d.ts +14 -0
  80. package/dist/core/permissions/compile.js +1 -0
  81. package/dist/core/permissions/errors.d.ts +7 -0
  82. package/dist/core/permissions/errors.js +1 -0
  83. package/dist/core/permissions/evaluator.d.ts +28 -0
  84. package/dist/core/permissions/evaluator.js +6 -0
  85. package/dist/core/permissions/facts.d.ts +56 -0
  86. package/dist/core/permissions/facts.js +2 -0
  87. package/dist/core/permissions/schema-parser.d.ts +29 -0
  88. package/dist/core/permissions/schema-parser.js +2 -0
  89. package/dist/core/permissions/schemas.d.ts +21 -0
  90. package/dist/core/permissions/schemas.js +2 -0
  91. package/dist/core/permissions/sql.d.ts +16 -0
  92. package/dist/core/permissions/sql.js +1 -0
  93. package/dist/core/runtime/broker/frame-client.d.ts +1 -1
  94. package/dist/core/runtime/broker/frame-client.js +1 -1
  95. package/dist/core/runtime/broker/frame-dispatch.d.ts +1 -1
  96. package/dist/core/runtime/broker/frame-dispatch.js +1 -1
  97. package/dist/core/runtime/broker/frame-read.d.ts +4 -3
  98. package/dist/core/runtime/broker/frame-read.js +1 -1
  99. package/dist/core/runtime/broker-protocol.d.ts +1 -1
  100. package/dist/core/runtime/host.js +3 -3
  101. package/dist/core/runtime/placement.js +1 -1
  102. package/dist/core/runtime/roadmap.js +1 -1
  103. package/dist/core/substrate/delivery/corpus.d.ts +2 -2
  104. package/dist/core/substrate/delivery/corpus.js +3 -3
  105. package/dist/core/substrate/delivery/deliver.js +2 -2
  106. package/dist/core/substrate/delivery/render-event.js +6 -6
  107. package/dist/core/substrate/subject-fields.d.ts +2 -0
  108. package/dist/core/substrate/subject.js +1 -1
  109. package/dist/daemon/api/app-listener.js +12 -12
  110. package/dist/daemon/api/bridge.d.ts +1 -1
  111. package/dist/daemon/api/bridge.js +4 -4
  112. package/dist/daemon/api/handlers/attach.d.ts +4 -1
  113. package/dist/daemon/api/handlers/attach.js +1 -1
  114. package/dist/daemon/api/handlers/canvas.js +5 -5
  115. package/dist/daemon/api/handlers/check.d.ts +2 -0
  116. package/dist/daemon/api/handlers/check.js +1 -0
  117. package/dist/daemon/api/handlers/custom-objects.js +2 -2
  118. package/dist/daemon/api/handlers/docs.js +1 -1
  119. package/dist/daemon/api/handlers/files.js +1 -1
  120. package/dist/daemon/api/handlers/memory.js +7 -6
  121. package/dist/daemon/api/handlers/nodes.js +1 -1
  122. package/dist/daemon/api/handlers/objects.js +3 -3
  123. package/dist/daemon/api/handlers/relations.d.ts +2 -0
  124. package/dist/daemon/api/handlers/relations.js +1 -0
  125. package/dist/daemon/api/handlers/schemas.d.ts +12 -0
  126. package/dist/daemon/api/handlers/schemas.js +1 -0
  127. package/dist/daemon/api/handlers/shares.d.ts +2 -0
  128. package/dist/daemon/api/handlers/shares.js +1 -0
  129. package/dist/daemon/api/operations.js +1 -1
  130. package/dist/daemon/api/router.d.ts +10 -6
  131. package/dist/daemon/api/router.js +1 -1
  132. package/dist/daemon/api/server.js +1 -1
  133. package/dist/daemon/crtrd.js +12 -12
  134. package/dist/daemon/reconcilers/delivery-lane.js +2 -2
  135. package/dist/doc-editor/editor.css +1 -1
  136. package/dist/doc-editor/editor.js +16 -16
  137. package/dist/migrations/004-canvas-documents/fields.d.ts +1 -1
  138. package/dist/migrations/004-canvas-documents/fields.js +2 -2
  139. package/docs/apps/guides/files-and-documents.md +3 -3
  140. package/docs/apps/guides/many-users.md +1 -1
  141. package/docs/apps/guides/test-your-app.md +1 -1
  142. package/docs/cli/documents-and-preferences.md +1 -1
  143. package/docs/concepts/documents.md +1 -1
  144. package/docs/concepts/scopes-and-trust.md +2 -2
  145. package/docs/sdk/release-notes.md +11 -0
  146. package/package.json +2 -2
  147. package/packages/crouter-identity/dist/index.js +14 -1
  148. package/packages/crouter-identity/package.json +1 -1
  149. package/runtime.lock.json +13 -13
  150. package/dist/core/graph/spaces/app.d.ts +0 -3
  151. package/dist/core/graph/spaces/app.js +0 -1
  152. package/dist/core/graph/spaces/index.d.ts +0 -18
  153. package/dist/core/graph/spaces/index.js +0 -1
  154. package/dist/core/graph/spaces/own-memory.d.ts +0 -18
  155. package/dist/core/graph/spaces/own-memory.js +0 -1
  156. package/dist/core/graph/spaces/person.d.ts +0 -5
  157. package/dist/core/graph/spaces/person.js +0 -3
  158. package/dist/core/graph/spaces/repo.d.ts +0 -14
  159. package/dist/core/graph/spaces/repo.js +0 -1
  160. package/dist/core/runs/confinement.d.ts +0 -25
  161. package/dist/core/runs/confinement.js +0 -2
@@ -1,5 +1,5 @@
1
1
  /** The contract level this build serves and requires. Written by `scripts/contract.mjs release`; never edit by hand. */
2
- export declare const CONTRACT_LEVEL = "1.30";
2
+ export declare const CONTRACT_LEVEL = "1.31";
3
3
  /** Request header naming the one contract level the caller needs, e.g. `1.3`. Optional: absent means no check. */
4
4
  export declare const REQUIRED_CONTRACT_HEADER = "Crouter-Required-Contract";
5
5
  /** Response header listing the contract levels the server serves, comma-separated, one per major, e.g. `1.3`. */
@@ -1 +1 @@
1
- var c=Object.defineProperty;var e=(r,t)=>c(r,"name",{value:t,configurable:!0});const f="1.30",i="Crouter-Required-Contract",p="Crouter-Contract";function l(r){const t=/^(\d+)\.(\d+)$/.exec(r.trim());return t===null?null:{major:Number(t[1]),minor:Number(t[2])}}e(l,"parseContractLevel");function a(r){return r==null?[]:r.split(",").map(t=>l(t)).filter(t=>t!==null)}e(a,"parseServedContracts");function s(r,t){const n=l(r);return n===null?!1:(typeof t=="string"||t===null||t===void 0?a(t):t).some(u=>u.major===n.major&&u.minor>=n.minor)}e(s,"contractSatisfies");function C(r,t,n={}){if(r===void 0)return null;if(l(r)===null)return{status:400,code:"invalid_request",param:i,message:`${i} must be a contract level like 1.0.`};if(s(r,t))return null;const o=r.trim();return{status:426,code:"runtime_version_unsupported",message:t===null||a(t).length===0?`The runtime did not name its contract level; the caller requires contract ${o} or later. Roll the runtime forward.`:`The runtime serves contract ${t}; the caller requires contract ${o} or later within the same major. Roll the runtime forward, or pin an SDK whose crouterContract the runtime serves.`,details:{sdk_version:(n.legacyMinimum??"").trim(),runtime_version:n.runtimeVersion??null,required_contract:o,runtime_contract:t}}}e(C,"contractRefusal");export{p as CONTRACT_HEADER,f as CONTRACT_LEVEL,i as REQUIRED_CONTRACT_HEADER,C as contractRefusal,s as contractSatisfies,l as parseContractLevel,a as parseServedContracts};
1
+ var c=Object.defineProperty;var e=(r,t)=>c(r,"name",{value:t,configurable:!0});const f="1.31",i="Crouter-Required-Contract",p="Crouter-Contract";function l(r){const t=/^(\d+)\.(\d+)$/.exec(r.trim());return t===null?null:{major:Number(t[1]),minor:Number(t[2])}}e(l,"parseContractLevel");function a(r){return r==null?[]:r.split(",").map(t=>l(t)).filter(t=>t!==null)}e(a,"parseServedContracts");function s(r,t){const n=l(r);return n===null?!1:(typeof t=="string"||t===null||t===void 0?a(t):t).some(u=>u.major===n.major&&u.minor>=n.minor)}e(s,"contractSatisfies");function C(r,t,n={}){if(r===void 0)return null;if(l(r)===null)return{status:400,code:"invalid_request",param:i,message:`${i} must be a contract level like 1.0.`};if(s(r,t))return null;const o=r.trim();return{status:426,code:"runtime_version_unsupported",message:t===null||a(t).length===0?`The runtime did not name its contract level; the caller requires contract ${o} or later. Roll the runtime forward.`:`The runtime serves contract ${t}; the caller requires contract ${o} or later within the same major. Roll the runtime forward, or pin an SDK whose crouterContract the runtime serves.`,details:{sdk_version:(n.legacyMinimum??"").trim(),runtime_version:n.runtimeVersion??null,required_contract:o,runtime_contract:t}}}e(C,"contractRefusal");export{p as CONTRACT_HEADER,f as CONTRACT_LEVEL,i as REQUIRED_CONTRACT_HEADER,C as contractRefusal,s as contractSatisfies,l as parseContractLevel,a as parseServedContracts};
@@ -19,7 +19,7 @@ export interface RegisterCustomObjectRequestDTO {
19
19
  events?: Record<string, CustomEventSpecDTO>;
20
20
  receiver?: CustomReceiverDTO;
21
21
  rotate_token?: boolean;
22
- /** Who can read the instance: `public` (default), `friends` or `private`. Setting it on an existing instance changes it. */
22
+ /** Who can read the instance: `public` (default) or `private`. Setting it on an existing instance changes it. */
23
23
  privacy?: PrivacyName;
24
24
  }
25
25
  export interface RegisterCustomObjectResponseDTO {
@@ -27,9 +27,17 @@ export interface DocWriteRequest {
27
27
  unlisted?: boolean;
28
28
  lint_ignore?: string[];
29
29
  extensions?: Record<string, Record<string, unknown>>;
30
+ /** The app type the document is an instance of (`firstlight/memory`), in the calling app's own namespace. The app's schema then governs who reads it. */
31
+ schema_type?: string;
32
+ /** Facts written in the same transaction as the document, with resource `<schema_type>:<new object id>`. Subject: `user:<id>`, `<type>:<id>` or `<type>:<id>#<relation>`. */
33
+ relations?: DocRelationDTO[];
30
34
  /** The caller's cwd, for `--owner repo` resolution. */
31
35
  cwd?: string;
32
36
  }
37
+ export interface DocRelationDTO {
38
+ relation: string;
39
+ subject: string;
40
+ }
33
41
  /** `name` is canonical: `<owner-handle>/<name>`. */
34
42
  /** `unresolved_links`: names that match nothing in the writer's view. `remote_links`: names whose
35
43
  * first segment is no owner on this runtime — on another runtime, or misspelled. */
@@ -99,6 +107,10 @@ export interface DocRevisionDTO {
99
107
  verbatim: boolean;
100
108
  created_at: string;
101
109
  parents: string[];
110
+ /** The app that made the revision (`app:firstlight`), or null. */
111
+ acting_app: string | null;
112
+ /** The person the revision was made for (`user:<id>`), or null. */
113
+ acting_for: string | null;
102
114
  }
103
115
  export interface DocHistoryDTO {
104
116
  object: ObjectDTO;
@@ -1,4 +1,4 @@
1
- export declare const PRIVACY_LEVELS_DTO: readonly ["public", "friends", "private"];
1
+ export declare const PRIVACY_LEVELS_DTO: readonly ["public", "private"];
2
2
  export type PrivacyName = typeof PRIVACY_LEVELS_DTO[number];
3
3
  export type OwnerTypeName = 'person' | 'app' | 'repo' | 'profile' | 'node' | 'document' | 'job';
4
4
  export interface ObjectOwnerDTO {
@@ -34,6 +34,8 @@ export interface ObjectDTO {
34
34
  preview: string;
35
35
  created_at: string;
36
36
  deleted_at: string | null;
37
+ /** The app type a document is an instance of (`firstlight/memory`); null for a document governed by `crtr/object`. Present on documents. */
38
+ schema_type?: string | null;
37
39
  /** Present on an instance of a custom kind. */
38
40
  kind_decl?: ObjectKindDeclDTO;
39
41
  }
@@ -141,6 +143,12 @@ export interface ObjectListRequest {
141
143
  cursor?: string;
142
144
  /** List only this machine (`runtime:<id>`), paging through its cursor. `self` lists only this machine without labels. */
143
145
  machine?: string;
146
+ /** Documents whose `extensions` hold these top-level fields (equality), e.g. `{ firstlight: { workspace_id: 'w1', state: 'active' } }`. Applied inside the permission-filtered query, before `limit`. */
147
+ extensions?: Record<string, Record<string, unknown>>;
148
+ /** Documents that are instances of this app type (`firstlight/memory`). */
149
+ schema_type?: string;
150
+ /** Only objects the caller reaches through a share and not through its own tree. */
151
+ shared?: boolean;
144
152
  }
145
153
  export interface ObjectListItemDTO extends ObjectDTO {
146
154
  /** The machine of your account that homes the row; set on a merged or `--machine` listing. */
@@ -148,6 +156,10 @@ export interface ObjectListItemDTO extends ObjectDTO {
148
156
  summary?: string | null;
149
157
  /** A document's rule count. */
150
158
  rules?: number;
159
+ /** A document's `extensions`, as stored. Present on document items. */
160
+ extensions?: Record<string, Record<string, unknown>>;
161
+ /** A document's app type, or null. Present on document items. */
162
+ schema_type?: string | null;
151
163
  }
152
164
  export type MachineListState = 'ok' | 'unreachable' | 'too_old';
153
165
  /** How one machine answered a merged listing; `more` says its first page was not all of it (page it with `--machine`). */
@@ -172,7 +184,11 @@ export interface ObjectSearchRequest {
172
184
  kind?: string;
173
185
  owner?: string;
174
186
  limit?: number;
187
+ /** As on `ObjectListRequest`: applied inside the query in every search mode (name, `body`, `grep`). */
188
+ extensions?: Record<string, Record<string, unknown>>;
189
+ schema_type?: string;
175
190
  }
191
+ /** `object` is an `ObjectListItemDTO`, so a document hit carries its `extensions` and `schema_type` there. */
176
192
  export interface ObjectSearchHitDTO {
177
193
  object: ObjectListItemDTO;
178
194
  matches?: Array<{
@@ -1 +1 @@
1
- const e=["public","friends","private"];export{e as PRIVACY_LEVELS_DTO};
1
+ const p=["public","private"];export{p as PRIVACY_LEVELS_DTO};
@@ -0,0 +1,76 @@
1
+ /** `POST /v1/schemas`: register or update the calling app's permission schema (SpiceDB syntax). */
2
+ export interface SchemaRegisterRequest {
3
+ namespace: string;
4
+ source: string;
5
+ }
6
+ export interface SchemaRegisterDTO {
7
+ namespace: string;
8
+ version: number;
9
+ changed: boolean;
10
+ }
11
+ /** One relation fact. `resource` is `<type>:<id>` within the caller's namespace; `subject` is `user:<id>`, `<type>:<id>` or `<type>:<id>#<relation>`. */
12
+ export interface FactDTO {
13
+ resource: string;
14
+ relation: string;
15
+ subject: string;
16
+ }
17
+ /** `POST /v1/relations`: idempotent writes and deletes of facts. */
18
+ export interface RelationsWriteRequest {
19
+ write?: FactDTO[];
20
+ delete?: FactDTO[];
21
+ }
22
+ /** `PUT /v1/relations`: the facts `(resource, relation, *)` become exactly `subjects`. */
23
+ export interface RelationsReplaceRequest {
24
+ resource: string;
25
+ relation: string;
26
+ subjects: string[];
27
+ }
28
+ export interface RelationsChangedDTO {
29
+ written: number;
30
+ deleted: number;
31
+ }
32
+ /** `GET /v1/relations?resource=<type>:<id>`. */
33
+ export interface RelationsListDTO {
34
+ items: FactDTO[];
35
+ }
36
+ /** `POST /v1/check`: may `subject` do `permission` on `resource` (`<type>:<id>`, or a crouter object id with `read|edit|message|use`). */
37
+ export interface CheckRequest {
38
+ subject: string;
39
+ permission: string;
40
+ resource: string;
41
+ }
42
+ export interface CheckDTO {
43
+ allowed: boolean;
44
+ }
45
+ /** The CLI verbs of a share and the relation each writes on a `crtr/object`. */
46
+ export declare const SHARE_VERBS: readonly ["read", "edit", "message", "use"];
47
+ export type ShareVerb = typeof SHARE_VERBS[number];
48
+ /** `POST /v1/objects/:ref/shares`: share the object. `subject` is `user:<id>`, `team:<id>` or `user:*` (everyone). */
49
+ export interface ShareRequest {
50
+ verb: ShareVerb;
51
+ subject: string;
52
+ }
53
+ /** `DELETE /v1/objects/:ref/shares?verb=&subject=`: revoke it. Same pair as the request. */
54
+ export interface ShareRevokeQuery {
55
+ verb: ShareVerb;
56
+ subject: string;
57
+ }
58
+ /** The object and fact a share call acted on; `changed` is false when the fact already held (or was already absent). */
59
+ export interface ShareChangedDTO {
60
+ id: string;
61
+ name: string;
62
+ relation: string;
63
+ subject: string;
64
+ changed: boolean;
65
+ }
66
+ /** `GET /v1/objects/:ref/shares`: who the object is shared with, for those who may share it. */
67
+ export interface ShareListDTO {
68
+ id: string;
69
+ name: string;
70
+ items: Array<{
71
+ verb: ShareVerb;
72
+ subject: string;
73
+ written_by: string;
74
+ created_at: string;
75
+ }>;
76
+ }
@@ -0,0 +1 @@
1
+ const e=["read","edit","message","use"];export{e as SHARE_VERBS};
@@ -49,5 +49,6 @@ export * from './dto/chat-inventory.js';
49
49
  export * from './dto/analytics.js';
50
50
  export * from './dto/custom-objects.js';
51
51
  export * from './dto/plugins.js';
52
- export type { DeliveryRuleDTO, DocEditRequest, DocEditedDTO, DocKindName, DocUnsetField, DocWriteRequest, DocWrittenDTO, DocLinkReportDTO, DocStaleDTO, RuleDeliverName, RuleOnName, } from './dto/docs.js';
53
- export type { DocumentReadData, ObjectDTO, ObjectReadDTO, WatchRequest, WatchResultDTO, UnwatchQuery, UnwatchResultDTO } from './dto/objects.js';
52
+ export * from './dto/permissions.js';
53
+ export type { DeliveryRuleDTO, DocDeletedDTO, DocHistoryDTO, DocRelationDTO, DocRevisionDTO, DocEditRequest, DocEditedDTO, DocKindName, DocUnsetField, DocWriteRequest, DocWrittenDTO, DocLinkReportDTO, DocStaleDTO, RuleDeliverName, RuleOnName, } from './dto/docs.js';
54
+ export type { DocumentReadData, ObjectDTO, ObjectListDTO, ObjectListItemDTO, ObjectListRequest, ObjectSearchDTO, ObjectSearchHitDTO, ObjectSearchRequest, ObjectReadDTO, WatchRequest, WatchResultDTO, UnwatchQuery, UnwatchResultDTO } from './dto/objects.js';
package/dist/api/index.js CHANGED
@@ -1 +1 @@
1
- import{CrtrClient as e,deadlineExceeded as t,MAX_TIMER_MS as m,sleepWithin as p,waitForDaemonAvailability as f}from"./client.js";import{APIError as E,ApiError as R,isErrorBody as _}from"./errors.js";import{errorCodes as i}from"./error-codes.js";import{API_VERSION as s,routes as n}from"./routes.js";import{RUNTIME_VERSION_HEADER as C,MINIMUM_RUNTIME_VERSION_HEADER as I,compareReleaseVersions as N,minimumRuntimeRefusal as O}from"./runtime-version.js";import{CONTRACT_HEADER as d,CONTRACT_LEVEL as S,REQUIRED_CONTRACT_HEADER as c,contractRefusal as L,contractSatisfies as M,parseContractLevel as u,parseServedContracts as D}from"./contract.js";import{LONG_POLL_MAX_WAIT_SECONDS as H,LONG_POLL_ROUTES as U,longPollHoldSeconds as V,longPollRoute as v,requestedWait as W}from"./long-poll.js";export*from"../shared/generated-context.js";export*from"./dto/common.js";export*from"./dto/health.js";export*from"./dto/limits.js";export*from"./dto/grants.js";export*from"./dto/usage.js";export*from"./dto/nodes.js";export*from"./dto/node-outcomes.js";export*from"./dto/node-events.js";export*from"./dto/run-events.js";export*from"./dto/broker-signals.js";export*from"./dto/bash-jobs.js";export*from"./dto/messages.js";export*from"./dto/reports.js";export*from"./dto/structured-requests.js";export*from"./dto/lifecycle.js";export*from"./dto/subscriptions.js";export*from"./dto/focus.js";export*from"./dto/crons.js";export*from"./dto/config.js";export*from"./dto/attach.js";export*from"./dto/broker.js";export*from"./dto/profiles.js";export*from"./dto/modelauth.js";export*from"./dto/model-config.js";export*from"./dto/canvas.js";export*from"./dto/worktree.js";export*from"./dto/human.js";export*from"./dto/files.js";export*from"./dto/bash.js";export*from"./dto/inbox.js";export*from"./dto/human-requests.js";export*from"./dto/reviews.js";export*from"./dto/review-comments.js";export*from"./dto/chat-inventory.js";export*from"./dto/analytics.js";export*from"./dto/custom-objects.js";export*from"./dto/plugins.js";export{E as APIError,s as API_VERSION,R as ApiError,d as CONTRACT_HEADER,S as CONTRACT_LEVEL,e as CrtrClient,H as LONG_POLL_MAX_WAIT_SECONDS,U as LONG_POLL_ROUTES,m as MAX_TIMER_MS,I as MINIMUM_RUNTIME_VERSION_HEADER,c as REQUIRED_CONTRACT_HEADER,C as RUNTIME_VERSION_HEADER,N as compareReleaseVersions,L as contractRefusal,M as contractSatisfies,t as deadlineExceeded,i as errorCodes,_ as isErrorBody,V as longPollHoldSeconds,v as longPollRoute,O as minimumRuntimeRefusal,u as parseContractLevel,D as parseServedContracts,W as requestedWait,n as routes,p as sleepWithin,f as waitForDaemonAvailability};
1
+ import{CrtrClient as e,deadlineExceeded as t,MAX_TIMER_MS as m,sleepWithin as p,waitForDaemonAvailability as f}from"./client.js";import{APIError as E,ApiError as R,isErrorBody as _}from"./errors.js";import{errorCodes as i}from"./error-codes.js";import{API_VERSION as s,routes as n}from"./routes.js";import{RUNTIME_VERSION_HEADER as C,MINIMUM_RUNTIME_VERSION_HEADER as I,compareReleaseVersions as N,minimumRuntimeRefusal as O}from"./runtime-version.js";import{CONTRACT_HEADER as d,CONTRACT_LEVEL as S,REQUIRED_CONTRACT_HEADER as c,contractRefusal as L,contractSatisfies as M,parseContractLevel as u,parseServedContracts as D}from"./contract.js";import{LONG_POLL_MAX_WAIT_SECONDS as H,LONG_POLL_ROUTES as U,longPollHoldSeconds as V,longPollRoute as v,requestedWait as W}from"./long-poll.js";export*from"../shared/generated-context.js";export*from"./dto/common.js";export*from"./dto/health.js";export*from"./dto/limits.js";export*from"./dto/grants.js";export*from"./dto/usage.js";export*from"./dto/nodes.js";export*from"./dto/node-outcomes.js";export*from"./dto/node-events.js";export*from"./dto/run-events.js";export*from"./dto/broker-signals.js";export*from"./dto/bash-jobs.js";export*from"./dto/messages.js";export*from"./dto/reports.js";export*from"./dto/structured-requests.js";export*from"./dto/lifecycle.js";export*from"./dto/subscriptions.js";export*from"./dto/focus.js";export*from"./dto/crons.js";export*from"./dto/config.js";export*from"./dto/attach.js";export*from"./dto/broker.js";export*from"./dto/profiles.js";export*from"./dto/modelauth.js";export*from"./dto/model-config.js";export*from"./dto/canvas.js";export*from"./dto/worktree.js";export*from"./dto/human.js";export*from"./dto/files.js";export*from"./dto/bash.js";export*from"./dto/inbox.js";export*from"./dto/human-requests.js";export*from"./dto/reviews.js";export*from"./dto/review-comments.js";export*from"./dto/chat-inventory.js";export*from"./dto/analytics.js";export*from"./dto/custom-objects.js";export*from"./dto/plugins.js";export*from"./dto/permissions.js";export{E as APIError,s as API_VERSION,R as ApiError,d as CONTRACT_HEADER,S as CONTRACT_LEVEL,e as CrtrClient,H as LONG_POLL_MAX_WAIT_SECONDS,U as LONG_POLL_ROUTES,m as MAX_TIMER_MS,I as MINIMUM_RUNTIME_VERSION_HEADER,c as REQUIRED_CONTRACT_HEADER,C as RUNTIME_VERSION_HEADER,N as compareReleaseVersions,L as contractRefusal,M as contractSatisfies,t as deadlineExceeded,i as errorCodes,_ as isErrorBody,V as longPollHoldSeconds,v as longPollRoute,O as minimumRuntimeRefusal,u as parseContractLevel,D as parseServedContracts,W as requestedWait,n as routes,p as sleepWithin,f as waitForDaemonAvailability};
@@ -157,12 +157,16 @@ export declare const routes: {
157
157
  readonly customObjectEvents: (ref: string) => string;
158
158
  readonly customObjectDeliveries: (ref: string) => string;
159
159
  readonly customObjectAck: (ref: string) => string;
160
+ readonly objectShares: (ref: string) => string;
160
161
  readonly objectEdges: (ref: string) => string;
161
162
  readonly docs: () => string;
162
163
  readonly doc: (ref: string) => string;
163
164
  readonly docMove: (ref: string) => string;
164
165
  readonly docHistory: (ref: string) => string;
165
166
  readonly docsLint: () => string;
167
+ readonly schemas: () => string;
168
+ readonly relations: () => string;
169
+ readonly check: () => string;
166
170
  readonly pluginAppToken: (name: string) => string;
167
171
  readonly pluginCallHeaders: (name: string) => string;
168
172
  readonly documentsBrowserAccess: () => string;
@@ -1 +1 @@
1
- var s=Object.defineProperty;var o=(e,n)=>s(e,"name",{value:n,configurable:!0});const t="v1",r="/v1",a={healthz:o(()=>"/healthz","healthz"),ready:o(()=>"/v1/ready","ready"),status:o(()=>"/v1/status","status"),due:o(()=>"/v1/due","due"),daemonRestart:o(()=>"/v1/daemon/restart","daemonRestart"),daemonMigrate:o(()=>"/v1/daemon/migrate","daemonMigrate"),daemonAdmit:o(()=>"/v1/daemon/admit","daemonAdmit"),nodes:o(()=>"/v1/nodes","nodes"),reviveAll:o(()=>"/v1/nodes/revive-all","reviveAll"),node:o(e=>`/v1/nodes/${e}`,"node"),nodeMemoryReads:o(e=>`/v1/nodes/${e}/memory-reads`,"nodeMemoryReads"),nodeOutcome:o(e=>`/v1/nodes/${e}/outcome`,"nodeOutcome"),nodeOutcomeDelivery:o(e=>`/v1/nodes/${e}/outcome-delivery`,"nodeOutcomeDelivery"),nodeEvents:o(e=>`/v1/nodes/${e}/events`,"nodeEvents"),nodeSnapshot:o(e=>`/v1/nodes/${e}/snapshot`,"nodeSnapshot"),nodeSubject:o(e=>`/v1/nodes/${e}/subject`,"nodeSubject"),nodeSession:o(e=>`/v1/nodes/${e}/session`,"nodeSession"),nodeChatInventory:o(e=>`/v1/nodes/${e}/chat-inventory`,"nodeChatInventory"),prospectiveChatInventory:o(()=>"/v1/prospective-chat-inventory","prospectiveChatInventory"),nodeTranscript:o(e=>`/v1/nodes/${e}/transcript`,"nodeTranscript"),nodeContext:o(e=>`/v1/nodes/${e}/context`,"nodeContext"),nodeReports:o(e=>`/v1/nodes/${e}/reports`,"nodeReports"),nodeResult:o(e=>`/v1/nodes/${e}/result`,"nodeResult"),nodeJobs:o(e=>`/v1/nodes/${e}/jobs`,"nodeJobs"),nodeJob:o((e,n)=>`/v1/nodes/${e}/jobs/${n}`,"nodeJob"),nodeJobBackground:o((e,n)=>`/v1/nodes/${e}/jobs/${n}/background`,"nodeJobBackground"),nodeDelivery:o(e=>`/v1/nodes/${e}/delivery`,"nodeDelivery"),deliveryDryRun:o(()=>"/v1/delivery/dry-run","deliveryDryRun"),deliveryRetry:o(e=>`/v1/deliveries/${encodeURIComponent(e)}/retry`,"deliveryRetry"),nodeMessages:o(e=>`/v1/nodes/${e}/messages`,"nodeMessages"),nodeInterrupt:o(e=>`/v1/nodes/${e}/interrupt`,"nodeInterrupt"),nodeFork:o(e=>`/v1/nodes/${e}/fork`,"nodeFork"),nodeRevive:o(e=>`/v1/nodes/${e}/revive`,"nodeRevive"),nodeRelaunchRoot:o(e=>`/v1/nodes/${e}/relaunch-root`,"nodeRelaunchRoot"),nodeBrokerSessionBound:o(e=>`/v1/nodes/${e}/broker/session-bound`,"nodeBrokerSessionBound"),nodeBrokerSettle:o(e=>`/v1/nodes/${e}/broker/settle`,"nodeBrokerSettle"),nodeBrokerParkComplete:o(e=>`/v1/nodes/${e}/broker/park-complete`,"nodeBrokerParkComplete"),nodeBrokerParkActivity:o(e=>`/v1/nodes/${e}/broker/park-activity`,"nodeBrokerParkActivity"),nodeBrokerTelemetry:o(e=>`/v1/nodes/${e}/broker/telemetry`,"nodeBrokerTelemetry"),nodeLog:o(e=>`/v1/nodes/${e}/records/log`,"nodeLog"),nodeTelemetry:o(e=>`/v1/nodes/${e}/records/telemetry`,"nodeTelemetry"),nodeRecap:o(e=>`/v1/nodes/${e}/records/recap`,"nodeRecap"),nodeInboxReport:o(e=>`/v1/nodes/${e}/records/inbox`,"nodeInboxReport"),nodePassiveMessage:o(e=>`/v1/nodes/${e}/records/passive`,"nodePassiveMessage"),nodePushedFinal:o(e=>`/v1/nodes/${e}/records/pushed-final`,"nodePushedFinal"),nodeMailClaim:o(e=>`/v1/nodes/${e}/mail/claim`,"nodeMailClaim"),nodeMailAcknowledge:o(e=>`/v1/nodes/${e}/mail/acknowledge`,"nodeMailAcknowledge"),nodeBrokerModel:o(e=>`/v1/nodes/${e}/broker/model`,"nodeBrokerModel"),nodeBrokerExtensionState:o(e=>`/v1/nodes/${e}/broker/extension-state`,"nodeBrokerExtensionState"),nodeBrokerSignals:o(e=>`/v1/nodes/${e}/broker/signals`,"nodeBrokerSignals"),nodeBrokerGeneratedName:o(e=>`/v1/nodes/${e}/broker/generated-name`,"nodeBrokerGeneratedName"),nodeBrokerPersonaAck:o(e=>`/v1/nodes/${e}/broker/persona-ack`,"nodeBrokerPersonaAck"),brokerTurn:o(e=>`/v1/broker/${e}/turn`,"brokerTurn"),brokerProviderRetry:o(e=>`/v1/broker/${e}/provider-retry`,"brokerProviderRetry"),brokerFault:o(e=>`/v1/broker/${e}/fault`,"brokerFault"),brokerRecovery:o(e=>`/v1/broker/${e}/recovery`,"brokerRecovery"),nodeFault:o(e=>`/v1/nodes/${e}/fault`,"nodeFault"),nodeClose:o(e=>`/v1/nodes/${e}/close`,"nodeClose"),nodeRead:o(e=>`/v1/nodes/${e}/read`,"nodeRead"),nodeRecycle:o(e=>`/v1/nodes/${e}/recycle`,"nodeRecycle"),nodeDemote:o(e=>`/v1/nodes/${e}/demote`,"nodeDemote"),nodePromote:o(e=>`/v1/nodes/${e}/promote`,"nodePromote"),nodeYield:o(e=>`/v1/nodes/${e}/yield`,"nodeYield"),nodeWait:o(e=>`/v1/nodes/${e}/wait`,"nodeWait"),nodeConfig:o(e=>`/v1/nodes/${e}/config`,"nodeConfig"),kinds:o(()=>"/v1/kinds","kinds"),nodeWorktreeClose:o(e=>`/v1/nodes/${e}/worktree/close`,"nodeWorktreeClose"),nodeWorktreeAbandon:o(e=>`/v1/nodes/${e}/worktree/abandon`,"nodeWorktreeAbandon"),quarantinedWorktrees:o(()=>"/v1/worktrees/quarantined","quarantinedWorktrees"),spaces:o(()=>"/v1/spaces","spaces"),limits:o(()=>"/v1/limits","limits"),limitsApp:o(e=>`/v1/limits/apps/${encodeURIComponent(e)}`,"limitsApp"),nodeAttach:o(e=>`/v1/nodes/${e}/attach`,"nodeAttach"),focuses:o(()=>"/v1/focuses","focuses"),focusByNode:o(()=>"/v1/focuses/by-node","focusByNode"),focusByPane:o(()=>"/v1/focuses/by-pane","focusByPane"),focus:o(e=>`/v1/focuses/${e}`,"focus"),nodeSubscriptions:o(e=>`/v1/nodes/${e}/subscriptions`,"nodeSubscriptions"),nodeSubscription:o((e,n)=>`/v1/nodes/${e}/subscriptions/${n}`,"nodeSubscription"),crons:o(()=>"/v1/crons","crons"),cron:o(e=>`/v1/crons/${e}`,"cron"),cronPause:o(e=>`/v1/crons/${e}/pause`,"cronPause"),cronResume:o(e=>`/v1/crons/${e}/resume`,"cronResume"),cronRun:o(e=>`/v1/crons/${e}/run`,"cronRun"),cronsPoke:o(()=>"/v1/crons/poke","cronsPoke"),canvasAttention:o(()=>"/v1/canvas/attention","canvasAttention"),canvasAttentionCounts:o(()=>"/v1/canvas/attention/counts","canvasAttentionCounts"),canvasHistorySearch:o(()=>"/v1/canvas/history/search","canvasHistorySearch"),canvasHistoryGrep:o(()=>"/v1/canvas/history/grep","canvasHistoryGrep"),canvasHistoryRead:o(()=>"/v1/canvas/history/read","canvasHistoryRead"),canvasHistoryStats:o(()=>"/v1/canvas/history/stats","canvasHistoryStats"),canvasSnapshot:o(()=>"/v1/canvas/snapshot","canvasSnapshot"),canvasLiveRoots:o(()=>"/v1/canvas/live-roots","canvasLiveRoots"),canvasRoster:o(()=>"/v1/canvas/roster","canvasRoster"),canvasBrowse:o(()=>"/v1/canvas/browse","canvasBrowse"),canvasAnalytics:o(()=>"/v1/canvas/analytics","canvasAnalytics"),canvasGraph:o(()=>"/v1/canvas/graph","canvasGraph"),canvasPrune:o(()=>"/v1/canvas/prune","canvasPrune"),humanReviews:o(()=>"/v1/human/reviews","humanReviews"),humanReview:o(e=>`/v1/human/reviews/${e}`,"humanReview"),humanReviewSubmit:o(e=>`/v1/human/reviews/${e}/submit`,"humanReviewSubmit"),humanReviewCancel:o(e=>`/v1/human/reviews/${e}/cancel`,"humanReviewCancel"),humanReviewDocument:o(e=>`/v1/human/reviews/${e}/document`,"humanReviewDocument"),humanReviewComments:o(e=>`/v1/human/reviews/${e}/comments`,"humanReviewComments"),humanReviewCommentEvents:o(e=>`/v1/human/reviews/${e}/comment-events`,"humanReviewCommentEvents"),humanReviewCommentRanges:o(e=>`/v1/human/reviews/${e}/comment-ranges`,"humanReviewCommentRanges"),humanComment:o(e=>`/v1/human/comments/${e}`,"humanComment"),humanCommentEdit:o(e=>`/v1/human/comments/${e}/edit`,"humanCommentEdit"),humanCommentResolve:o(e=>`/v1/human/comments/${e}/resolve`,"humanCommentResolve"),humanCommentReopen:o(e=>`/v1/human/comments/${e}/reopen`,"humanCommentReopen"),humanCommentDelete:o(e=>`/v1/human/comments/${e}/delete`,"humanCommentDelete"),humanCommentFork:o(e=>`/v1/human/comments/${e}/fork`,"humanCommentFork"),humanInbox:o(()=>"/v1/human/inbox","humanInbox"),humanInboxTicket:o(e=>`/v1/human/inbox/${e}`,"humanInboxTicket"),humanInboxRespond:o(e=>`/v1/human/inbox/${e}/respond`,"humanInboxRespond"),humanInboxProgress:o(e=>`/v1/human/inbox/${e}/progress`,"humanInboxProgress"),humanInboxResponse:o(e=>`/v1/human/inbox/${e}/response`,"humanInboxResponse"),humanInboxCancel:o(e=>`/v1/human/inbox/${e}/cancel`,"humanInboxCancel"),humanInboxFeedbackResolve:o((e,n)=>`/v1/human/inbox/${e}/feedback-comments/${n}/resolve`,"humanInboxFeedbackResolve"),humanRequests:o(()=>"/v1/human/requests","humanRequests"),humanComponents:o(()=>"/v1/human/components","humanComponents"),humanRequest:o(e=>`/v1/human/requests/${e}`,"humanRequest"),humanRequestReplace:o(e=>`/v1/human/requests/${e}/replace`,"humanRequestReplace"),humanRequestRespond:o(e=>`/v1/human/requests/${e}/respond`,"humanRequestRespond"),humanRequestDismiss:o(e=>`/v1/human/requests/${e}/dismiss`,"humanRequestDismiss"),humanRequestCancel:o(e=>`/v1/human/requests/${e}/cancel`,"humanRequestCancel"),profiles:o(()=>"/v1/profiles","profiles"),profile:o(e=>`/v1/profiles/${e}`,"profile"),profilePause:o(e=>`/v1/profiles/${e}/pause`,"profilePause"),profileResume:o(e=>`/v1/profiles/${e}/resume`,"profileResume"),profileMetadata:o(e=>`/v1/profiles/${e}/metadata`,"profileMetadata"),appEnv:o(()=>"/v1/apps/self/env","appEnv"),appEnvVar:o(e=>`/v1/apps/self/env/${encodeURIComponent(e)}`,"appEnvVar"),profileEnv:o(e=>`/v1/profiles/${e}/env`,"profileEnv"),profileEnvVar:o((e,n)=>`/v1/profiles/${e}/env/${n}`,"profileEnvVar"),modelAuths:o(()=>"/v1/model-auth","modelAuths"),modelAuthReadiness:o(()=>"/v1/model-auth/readiness","modelAuthReadiness"),modelAuth:o(e=>`/v1/model-auth/${e}`,"modelAuth"),modelAuthFlows:o(()=>"/v1/model-auth/flows","modelAuthFlows"),modelAuthFlow:o(e=>`/v1/model-auth/flows/${encodeURIComponent(e)}`,"modelAuthFlow"),modelAuthFlowComplete:o(e=>`/v1/model-auth/flows/${encodeURIComponent(e)}/complete`,"modelAuthFlowComplete"),modelAuthFlowCancel:o(e=>`/v1/model-auth/flows/${encodeURIComponent(e)}/cancel`,"modelAuthFlowCancel"),filePeek:o(()=>"/v1/files/peek","filePeek"),fileWrite:o(()=>"/v1/files/write","fileWrite"),fileList:o(()=>"/v1/files/list","fileList"),bash:o(()=>"/v1/bash","bash"),objects:o(()=>"/v1/objects","objects"),object:o(e=>`/v1/objects/${encodeURIComponent(e)}`,"object"),objectsSearch:o(()=>"/v1/objects/search","objectsSearch"),objectWatch:o(e=>`/v1/objects/${encodeURIComponent(e)}/watch`,"objectWatch"),customObjects:o(()=>"/v1/custom-objects","customObjects"),customObject:o(e=>`/v1/custom-objects/${encodeURIComponent(e)}`,"customObject"),customObjectEvents:o(e=>`/v1/custom-objects/${encodeURIComponent(e)}/events`,"customObjectEvents"),customObjectDeliveries:o(e=>`/v1/custom-objects/${encodeURIComponent(e)}/deliveries`,"customObjectDeliveries"),customObjectAck:o(e=>`/v1/custom-objects/${encodeURIComponent(e)}/deliveries/ack`,"customObjectAck"),objectEdges:o(e=>`/v1/objects/${encodeURIComponent(e)}/edges`,"objectEdges"),docs:o(()=>"/v1/docs","docs"),doc:o(e=>`/v1/docs/${encodeURIComponent(e)}`,"doc"),docMove:o(e=>`/v1/docs/${encodeURIComponent(e)}/move`,"docMove"),docHistory:o(e=>`/v1/docs/${encodeURIComponent(e)}/history`,"docHistory"),docsLint:o(()=>"/v1/docs/lint","docsLint"),pluginAppToken:o(e=>`/v1/plugins/${encodeURIComponent(e)}/app-token`,"pluginAppToken"),pluginCallHeaders:o(e=>`/v1/plugins/${encodeURIComponent(e)}/call-headers`,"pluginCallHeaders"),documentsBrowserAccess:o(()=>"/v1/documents/browser-access","documentsBrowserAccess"),documentsReconcilePackages:o(()=>"/v1/documents/reconcile-packages","documentsReconcilePackages")};export{t as API_VERSION,a as routes};
1
+ var s=Object.defineProperty;var o=(e,n)=>s(e,"name",{value:n,configurable:!0});const t="v1",r="/v1",a={healthz:o(()=>"/healthz","healthz"),ready:o(()=>"/v1/ready","ready"),status:o(()=>"/v1/status","status"),due:o(()=>"/v1/due","due"),daemonRestart:o(()=>"/v1/daemon/restart","daemonRestart"),daemonMigrate:o(()=>"/v1/daemon/migrate","daemonMigrate"),daemonAdmit:o(()=>"/v1/daemon/admit","daemonAdmit"),nodes:o(()=>"/v1/nodes","nodes"),reviveAll:o(()=>"/v1/nodes/revive-all","reviveAll"),node:o(e=>`/v1/nodes/${e}`,"node"),nodeMemoryReads:o(e=>`/v1/nodes/${e}/memory-reads`,"nodeMemoryReads"),nodeOutcome:o(e=>`/v1/nodes/${e}/outcome`,"nodeOutcome"),nodeOutcomeDelivery:o(e=>`/v1/nodes/${e}/outcome-delivery`,"nodeOutcomeDelivery"),nodeEvents:o(e=>`/v1/nodes/${e}/events`,"nodeEvents"),nodeSnapshot:o(e=>`/v1/nodes/${e}/snapshot`,"nodeSnapshot"),nodeSubject:o(e=>`/v1/nodes/${e}/subject`,"nodeSubject"),nodeSession:o(e=>`/v1/nodes/${e}/session`,"nodeSession"),nodeChatInventory:o(e=>`/v1/nodes/${e}/chat-inventory`,"nodeChatInventory"),prospectiveChatInventory:o(()=>"/v1/prospective-chat-inventory","prospectiveChatInventory"),nodeTranscript:o(e=>`/v1/nodes/${e}/transcript`,"nodeTranscript"),nodeContext:o(e=>`/v1/nodes/${e}/context`,"nodeContext"),nodeReports:o(e=>`/v1/nodes/${e}/reports`,"nodeReports"),nodeResult:o(e=>`/v1/nodes/${e}/result`,"nodeResult"),nodeJobs:o(e=>`/v1/nodes/${e}/jobs`,"nodeJobs"),nodeJob:o((e,n)=>`/v1/nodes/${e}/jobs/${n}`,"nodeJob"),nodeJobBackground:o((e,n)=>`/v1/nodes/${e}/jobs/${n}/background`,"nodeJobBackground"),nodeDelivery:o(e=>`/v1/nodes/${e}/delivery`,"nodeDelivery"),deliveryDryRun:o(()=>"/v1/delivery/dry-run","deliveryDryRun"),deliveryRetry:o(e=>`/v1/deliveries/${encodeURIComponent(e)}/retry`,"deliveryRetry"),nodeMessages:o(e=>`/v1/nodes/${e}/messages`,"nodeMessages"),nodeInterrupt:o(e=>`/v1/nodes/${e}/interrupt`,"nodeInterrupt"),nodeFork:o(e=>`/v1/nodes/${e}/fork`,"nodeFork"),nodeRevive:o(e=>`/v1/nodes/${e}/revive`,"nodeRevive"),nodeRelaunchRoot:o(e=>`/v1/nodes/${e}/relaunch-root`,"nodeRelaunchRoot"),nodeBrokerSessionBound:o(e=>`/v1/nodes/${e}/broker/session-bound`,"nodeBrokerSessionBound"),nodeBrokerSettle:o(e=>`/v1/nodes/${e}/broker/settle`,"nodeBrokerSettle"),nodeBrokerParkComplete:o(e=>`/v1/nodes/${e}/broker/park-complete`,"nodeBrokerParkComplete"),nodeBrokerParkActivity:o(e=>`/v1/nodes/${e}/broker/park-activity`,"nodeBrokerParkActivity"),nodeBrokerTelemetry:o(e=>`/v1/nodes/${e}/broker/telemetry`,"nodeBrokerTelemetry"),nodeLog:o(e=>`/v1/nodes/${e}/records/log`,"nodeLog"),nodeTelemetry:o(e=>`/v1/nodes/${e}/records/telemetry`,"nodeTelemetry"),nodeRecap:o(e=>`/v1/nodes/${e}/records/recap`,"nodeRecap"),nodeInboxReport:o(e=>`/v1/nodes/${e}/records/inbox`,"nodeInboxReport"),nodePassiveMessage:o(e=>`/v1/nodes/${e}/records/passive`,"nodePassiveMessage"),nodePushedFinal:o(e=>`/v1/nodes/${e}/records/pushed-final`,"nodePushedFinal"),nodeMailClaim:o(e=>`/v1/nodes/${e}/mail/claim`,"nodeMailClaim"),nodeMailAcknowledge:o(e=>`/v1/nodes/${e}/mail/acknowledge`,"nodeMailAcknowledge"),nodeBrokerModel:o(e=>`/v1/nodes/${e}/broker/model`,"nodeBrokerModel"),nodeBrokerExtensionState:o(e=>`/v1/nodes/${e}/broker/extension-state`,"nodeBrokerExtensionState"),nodeBrokerSignals:o(e=>`/v1/nodes/${e}/broker/signals`,"nodeBrokerSignals"),nodeBrokerGeneratedName:o(e=>`/v1/nodes/${e}/broker/generated-name`,"nodeBrokerGeneratedName"),nodeBrokerPersonaAck:o(e=>`/v1/nodes/${e}/broker/persona-ack`,"nodeBrokerPersonaAck"),brokerTurn:o(e=>`/v1/broker/${e}/turn`,"brokerTurn"),brokerProviderRetry:o(e=>`/v1/broker/${e}/provider-retry`,"brokerProviderRetry"),brokerFault:o(e=>`/v1/broker/${e}/fault`,"brokerFault"),brokerRecovery:o(e=>`/v1/broker/${e}/recovery`,"brokerRecovery"),nodeFault:o(e=>`/v1/nodes/${e}/fault`,"nodeFault"),nodeClose:o(e=>`/v1/nodes/${e}/close`,"nodeClose"),nodeRead:o(e=>`/v1/nodes/${e}/read`,"nodeRead"),nodeRecycle:o(e=>`/v1/nodes/${e}/recycle`,"nodeRecycle"),nodeDemote:o(e=>`/v1/nodes/${e}/demote`,"nodeDemote"),nodePromote:o(e=>`/v1/nodes/${e}/promote`,"nodePromote"),nodeYield:o(e=>`/v1/nodes/${e}/yield`,"nodeYield"),nodeWait:o(e=>`/v1/nodes/${e}/wait`,"nodeWait"),nodeConfig:o(e=>`/v1/nodes/${e}/config`,"nodeConfig"),kinds:o(()=>"/v1/kinds","kinds"),nodeWorktreeClose:o(e=>`/v1/nodes/${e}/worktree/close`,"nodeWorktreeClose"),nodeWorktreeAbandon:o(e=>`/v1/nodes/${e}/worktree/abandon`,"nodeWorktreeAbandon"),quarantinedWorktrees:o(()=>"/v1/worktrees/quarantined","quarantinedWorktrees"),spaces:o(()=>"/v1/spaces","spaces"),limits:o(()=>"/v1/limits","limits"),limitsApp:o(e=>`/v1/limits/apps/${encodeURIComponent(e)}`,"limitsApp"),nodeAttach:o(e=>`/v1/nodes/${e}/attach`,"nodeAttach"),focuses:o(()=>"/v1/focuses","focuses"),focusByNode:o(()=>"/v1/focuses/by-node","focusByNode"),focusByPane:o(()=>"/v1/focuses/by-pane","focusByPane"),focus:o(e=>`/v1/focuses/${e}`,"focus"),nodeSubscriptions:o(e=>`/v1/nodes/${e}/subscriptions`,"nodeSubscriptions"),nodeSubscription:o((e,n)=>`/v1/nodes/${e}/subscriptions/${n}`,"nodeSubscription"),crons:o(()=>"/v1/crons","crons"),cron:o(e=>`/v1/crons/${e}`,"cron"),cronPause:o(e=>`/v1/crons/${e}/pause`,"cronPause"),cronResume:o(e=>`/v1/crons/${e}/resume`,"cronResume"),cronRun:o(e=>`/v1/crons/${e}/run`,"cronRun"),cronsPoke:o(()=>"/v1/crons/poke","cronsPoke"),canvasAttention:o(()=>"/v1/canvas/attention","canvasAttention"),canvasAttentionCounts:o(()=>"/v1/canvas/attention/counts","canvasAttentionCounts"),canvasHistorySearch:o(()=>"/v1/canvas/history/search","canvasHistorySearch"),canvasHistoryGrep:o(()=>"/v1/canvas/history/grep","canvasHistoryGrep"),canvasHistoryRead:o(()=>"/v1/canvas/history/read","canvasHistoryRead"),canvasHistoryStats:o(()=>"/v1/canvas/history/stats","canvasHistoryStats"),canvasSnapshot:o(()=>"/v1/canvas/snapshot","canvasSnapshot"),canvasLiveRoots:o(()=>"/v1/canvas/live-roots","canvasLiveRoots"),canvasRoster:o(()=>"/v1/canvas/roster","canvasRoster"),canvasBrowse:o(()=>"/v1/canvas/browse","canvasBrowse"),canvasAnalytics:o(()=>"/v1/canvas/analytics","canvasAnalytics"),canvasGraph:o(()=>"/v1/canvas/graph","canvasGraph"),canvasPrune:o(()=>"/v1/canvas/prune","canvasPrune"),humanReviews:o(()=>"/v1/human/reviews","humanReviews"),humanReview:o(e=>`/v1/human/reviews/${e}`,"humanReview"),humanReviewSubmit:o(e=>`/v1/human/reviews/${e}/submit`,"humanReviewSubmit"),humanReviewCancel:o(e=>`/v1/human/reviews/${e}/cancel`,"humanReviewCancel"),humanReviewDocument:o(e=>`/v1/human/reviews/${e}/document`,"humanReviewDocument"),humanReviewComments:o(e=>`/v1/human/reviews/${e}/comments`,"humanReviewComments"),humanReviewCommentEvents:o(e=>`/v1/human/reviews/${e}/comment-events`,"humanReviewCommentEvents"),humanReviewCommentRanges:o(e=>`/v1/human/reviews/${e}/comment-ranges`,"humanReviewCommentRanges"),humanComment:o(e=>`/v1/human/comments/${e}`,"humanComment"),humanCommentEdit:o(e=>`/v1/human/comments/${e}/edit`,"humanCommentEdit"),humanCommentResolve:o(e=>`/v1/human/comments/${e}/resolve`,"humanCommentResolve"),humanCommentReopen:o(e=>`/v1/human/comments/${e}/reopen`,"humanCommentReopen"),humanCommentDelete:o(e=>`/v1/human/comments/${e}/delete`,"humanCommentDelete"),humanCommentFork:o(e=>`/v1/human/comments/${e}/fork`,"humanCommentFork"),humanInbox:o(()=>"/v1/human/inbox","humanInbox"),humanInboxTicket:o(e=>`/v1/human/inbox/${e}`,"humanInboxTicket"),humanInboxRespond:o(e=>`/v1/human/inbox/${e}/respond`,"humanInboxRespond"),humanInboxProgress:o(e=>`/v1/human/inbox/${e}/progress`,"humanInboxProgress"),humanInboxResponse:o(e=>`/v1/human/inbox/${e}/response`,"humanInboxResponse"),humanInboxCancel:o(e=>`/v1/human/inbox/${e}/cancel`,"humanInboxCancel"),humanInboxFeedbackResolve:o((e,n)=>`/v1/human/inbox/${e}/feedback-comments/${n}/resolve`,"humanInboxFeedbackResolve"),humanRequests:o(()=>"/v1/human/requests","humanRequests"),humanComponents:o(()=>"/v1/human/components","humanComponents"),humanRequest:o(e=>`/v1/human/requests/${e}`,"humanRequest"),humanRequestReplace:o(e=>`/v1/human/requests/${e}/replace`,"humanRequestReplace"),humanRequestRespond:o(e=>`/v1/human/requests/${e}/respond`,"humanRequestRespond"),humanRequestDismiss:o(e=>`/v1/human/requests/${e}/dismiss`,"humanRequestDismiss"),humanRequestCancel:o(e=>`/v1/human/requests/${e}/cancel`,"humanRequestCancel"),profiles:o(()=>"/v1/profiles","profiles"),profile:o(e=>`/v1/profiles/${e}`,"profile"),profilePause:o(e=>`/v1/profiles/${e}/pause`,"profilePause"),profileResume:o(e=>`/v1/profiles/${e}/resume`,"profileResume"),profileMetadata:o(e=>`/v1/profiles/${e}/metadata`,"profileMetadata"),appEnv:o(()=>"/v1/apps/self/env","appEnv"),appEnvVar:o(e=>`/v1/apps/self/env/${encodeURIComponent(e)}`,"appEnvVar"),profileEnv:o(e=>`/v1/profiles/${e}/env`,"profileEnv"),profileEnvVar:o((e,n)=>`/v1/profiles/${e}/env/${n}`,"profileEnvVar"),modelAuths:o(()=>"/v1/model-auth","modelAuths"),modelAuthReadiness:o(()=>"/v1/model-auth/readiness","modelAuthReadiness"),modelAuth:o(e=>`/v1/model-auth/${e}`,"modelAuth"),modelAuthFlows:o(()=>"/v1/model-auth/flows","modelAuthFlows"),modelAuthFlow:o(e=>`/v1/model-auth/flows/${encodeURIComponent(e)}`,"modelAuthFlow"),modelAuthFlowComplete:o(e=>`/v1/model-auth/flows/${encodeURIComponent(e)}/complete`,"modelAuthFlowComplete"),modelAuthFlowCancel:o(e=>`/v1/model-auth/flows/${encodeURIComponent(e)}/cancel`,"modelAuthFlowCancel"),filePeek:o(()=>"/v1/files/peek","filePeek"),fileWrite:o(()=>"/v1/files/write","fileWrite"),fileList:o(()=>"/v1/files/list","fileList"),bash:o(()=>"/v1/bash","bash"),objects:o(()=>"/v1/objects","objects"),object:o(e=>`/v1/objects/${encodeURIComponent(e)}`,"object"),objectsSearch:o(()=>"/v1/objects/search","objectsSearch"),objectWatch:o(e=>`/v1/objects/${encodeURIComponent(e)}/watch`,"objectWatch"),customObjects:o(()=>"/v1/custom-objects","customObjects"),customObject:o(e=>`/v1/custom-objects/${encodeURIComponent(e)}`,"customObject"),customObjectEvents:o(e=>`/v1/custom-objects/${encodeURIComponent(e)}/events`,"customObjectEvents"),customObjectDeliveries:o(e=>`/v1/custom-objects/${encodeURIComponent(e)}/deliveries`,"customObjectDeliveries"),customObjectAck:o(e=>`/v1/custom-objects/${encodeURIComponent(e)}/deliveries/ack`,"customObjectAck"),objectShares:o(e=>`/v1/objects/${encodeURIComponent(e)}/shares`,"objectShares"),objectEdges:o(e=>`/v1/objects/${encodeURIComponent(e)}/edges`,"objectEdges"),docs:o(()=>"/v1/docs","docs"),doc:o(e=>`/v1/docs/${encodeURIComponent(e)}`,"doc"),docMove:o(e=>`/v1/docs/${encodeURIComponent(e)}/move`,"docMove"),docHistory:o(e=>`/v1/docs/${encodeURIComponent(e)}/history`,"docHistory"),docsLint:o(()=>"/v1/docs/lint","docsLint"),schemas:o(()=>"/v1/schemas","schemas"),relations:o(()=>"/v1/relations","relations"),check:o(()=>"/v1/check","check"),pluginAppToken:o(e=>`/v1/plugins/${encodeURIComponent(e)}/app-token`,"pluginAppToken"),pluginCallHeaders:o(e=>`/v1/plugins/${encodeURIComponent(e)}/call-headers`,"pluginCallHeaders"),documentsBrowserAccess:o(()=>"/v1/documents/browser-access","documentsBrowserAccess"),documentsReconcilePackages:o(()=>"/v1/documents/reconcile-packages","documentsReconcilePackages")};export{t as API_VERSION,a as routes};
@@ -35,7 +35,7 @@ An installed plugin is an app named after the plugin, and the documentation that
35
35
 
36
36
  ## Who may read
37
37
 
38
- Each document is `public` (the default), `friends` or `private`. The person reads everything, a repo owns only public documents, and a reader that cannot see a document gets the same answer as for one that does not exist. A node's own owner space is open to it; an app's access to the person's documents is by privacy level and the scopes its grant holds (see [[crouter-concepts/scopes-and-trust]]).
38
+ Each document is `public` (the default) or `private`. The person reads everything, a repo owns only public documents, and a reader that cannot see a document gets the same answer as for one that does not exist. A node's own owner space is open to it; an app's access to the person's documents is by privacy level and the scopes its grant holds (see [[crouter-concepts/scopes-and-trust]]).
39
39
 
40
40
  ```mermaid
41
41
  flowchart LR
@@ -17,7 +17,7 @@ Scope strings are prefixed with `crtr:`. These are the ones the daemon and CLI c
17
17
  | `crtr:act` | Creating, forking, reviving, closing and messaging nodes; `bash` and `files`; creating a human request or review (the `crtr human` commands are hidden from a run without it) |
18
18
  | `crtr:schedule` | Creating, pausing, resuming, running and deleting crons (the `crtr cron` commands are hidden without it) |
19
19
  | `crtr:memory:read:user[:path]`, `crtr:memory:rw:user[:path]`, `crtr:memory:manage:user` | The person's documents: reading, writing (`crtr doc`), and `manage` for every privacy level and every document |
20
- | `crtr:memory:read_private:user` | Read-only access to the person's `public` and `private` documents, never `friends`; no path suffix; an optional permission the person switches on; `manage:user` covers it, `read:user` and `rw:user` do not |
20
+ | `crtr:memory:read_private:user` | Read-only access to the person's `public` and `private` documents; no path suffix; an optional permission the person switches on; `manage:user` covers it, `read:user` and `rw:user` do not |
21
21
  | `crtr:memory:read:app:<id>`, `crtr:memory:rw:app:<id>` | An app's documents; `…:profile:<profile>` narrows to one of its profiles. A run with no `scopes` list, and an app's own server, reads and writes its own app's space freely; a run started with a `scopes` list needs these for its own app too |
22
22
  | `crtr:files:read\|rw:user:<dir>`, `crtr:files:read\|rw:app:<id>:<dir>`, `crtr:files:share` | Host files the run may mount, and sharing files beyond the app's own space |
23
23
  | `crtr:conversations:read:app:<id>`, `crtr:objects:read:app:<id>` | Reading another app's conversations or node objects |
@@ -25,7 +25,7 @@ Scope strings are prefixed with `crtr:`. These are the ones the daemon and CLI c
25
25
 
26
26
  The `memory` in `crtr:memory:*` is the scope family's name for access to **documents** (see [[crouter-concepts/documents]]); there is no separate memory store. The older short names (`ask`, `act`, `schedule`, `memory:read`, `memory:write`, `llm`) are not accepted by `crtr sys connect --scopes`. A node's own documents, and an app's documents for its own nodes, need no `crtr:memory` scope.
27
27
 
28
- This is an allow-list, not a claim that code will behave. The daemon checks the scope at the route that performs the action and rejects an unavailable one. The SDK’s [[crouter-sdk/nodes]] `scopes` field narrows a run: a run's list must stay inside what its creator and grant hold, and `crtr:act` requires `crtr:llm`. `client.memory` is not scope-gated: it lists and reads the person's `knowledge` and `preference` documents, and the answer is filtered by privacy — an app sees `public` documents, a grant holding `crtr:memory:read_private:user` also sees `private` ones, and a grant holding `crtr:memory:manage:user` sees `friends` and `private` ones. Who may read any document is the owner-and-privacy model, not a per-call scope. The exception is a run started with a `scopes` list: it reads its own app's documents (including automatic delivery of them at boot) only with `crtr:memory:read:app:<id>` and writes or edits them only with `crtr:memory:rw:app:<id>`; a refused write answers `scope_missing` naming the scope. Such a run still publishes its own reports with `crtr push` and its promoted node still gets a roadmap, but cannot edit any other document through that path, and a child never regains a scope its parent's list dropped.
28
+ This is an allow-list, not a claim that code will behave. The daemon checks the scope at the route that performs the action and rejects an unavailable one. The SDK’s [[crouter-sdk/nodes]] `scopes` field narrows a run: a run's list must stay inside what its creator and grant hold, and `crtr:act` requires `crtr:llm`. `client.memory` is not scope-gated: it lists and reads the person's `knowledge` and `preference` documents, and the answer is filtered by privacy, which is `public` or `private`. An app's ceiling is `public` documents; a grant holding `crtr:memory:read_private:user` or `crtr:memory:manage:user` widens it to `private` ones. Within that ceiling, the app's registered schema and the relation facts it writes decide who may read a document, not a per-call scope. The exception is a run started with a `scopes` list: it reads its own app's documents (including automatic delivery of them at boot) only with `crtr:memory:read:app:<id>` and writes or edits them only with `crtr:memory:rw:app:<id>`; a refused write answers `scope_missing` naming the scope. Such a run still publishes its own reports with `crtr push` and its promoted node still gets a roadmap, but cannot edit any other document through that path, and a child never regains a scope its parent's list dropped.
29
29
 
30
30
  ```mermaid
31
31
  flowchart LR
@@ -9,6 +9,17 @@ when-and-why-to-read: When you need Release notes, this knowledge should be read
9
9
 
10
10
  Changes to `@north-light/sdk` that can change what an existing app sees. Newest first.
11
11
 
12
+ ## 0.3.550
13
+
14
+ An app registers a permission schema for its own object types and decides who may read each object with relations. Additive, except that `friends` leaves the privacy levels and nodes move under their profile.
15
+
16
+ - **Schemas, relations, check.** `client.schemas.register({ namespace, source })` (`POST /v1/schemas`) registers the schema for a namespace the app first claims; `client.relations.write | replace | list` (`/v1/relations`) writes and reads facts such as `firstlight/memory:<id> editor user:<id>`; `client.check(subject, permission, resource)` (`POST /v1/check`) answers whether a person may act. A type or relation outside the app's own namespace is refused `403 not_schema_owner`; a namespace another app registered first is refused `namespace_taken`.
17
+ - **Typed documents.** `docs.write` takes `schema_type` (the app type the document is an instance of) and `relations` (facts written in the same transaction), and `owner: 'user'` writes under the person the call token names. `docs.get` returns `extensions` and `schema_type`. `docs.delete(ref)`, `docs.list(params)` and `docs.search(params)` are new; `list` and `search` filter by `schema_type` and by `extensions` inside the permission-filtered query, before the page limit. Document history entries carry `acting_app` and `acting_for`.
18
+ - **`friends` is removed.** Privacy is `public` or `private`. A write naming `friends` is refused `400 invalid_request`. Existing `friends` documents became `private`; a `friends` value that arrives from an older source (a peer on an older release, a plugin package, a legacy canvas) is read as `private`.
19
+ - **Nodes are owned by their profile.** A node started under a profile now has that profile object as its `owner`, where it used to have the app: `owner` on list, search, read and event payloads names the profile, and listing with `owner=<app>&type=node` no longer returns those nodes; list them with `owner=<profile>`. Events carry the node's app as `app`. A node with no profile stays under its app.
20
+ - **A fields-only edit records a revision.** `docs.edit` with only fields (preview, summary, privacy, rules, …) now records a revision with the body unchanged, attributed to the editor with the rationale: the returned `revision` advances and `docs.history` lists it. Before, it changed the fields and left the revision alone.
21
+ - **FakeCloud** serves the new routes in memory: it parses and validates a registered schema source, refuses facts the schema does not declare, and evaluates `check`, `list` and `search` against the schema the way the runtime does. Deleting a typed document removes the facts that name it.
22
+
12
23
  ## 0.3.548
13
24
 
14
25
  `canvas.watch` with a `watcher` that is a node of your own app now works under `crtr:objects:link:node`. It answered `404 not_found` (`watcher not found`) before. The node must be reachable from the caller under run confinement and must itself be able to read the object. A watch on a node of another machine now forwards every event level, and that node's own listening config decides how each is delivered, where an event below level 3 was dropped before it left the object's machine.
@@ -15,9 +15,10 @@ This directory is the runtime's **self- and developer-documentation**: operation
15
15
 
16
16
  crtr keeps one graph of **objects** in one SQLite database (`canvas.db`). Documents, nodes, bash jobs, owners (person, app, repo, profile) and custom objects are all objects: each has an id, a name, an owner and a privacy level, and **the same verbs work on all of them** — `crtr canvas read`, `list`, `search`, `watch`, `unwatch`, `edges`. What differs is the object's *type*, which decides what events it can emit and how it renders. There are no memory stores, tiers or scopes: a thing an agent writes is a document, and who sees it is decided by its owner, its privacy and its delivery rules.
17
17
 
18
- - **Documents** are the one object type for written knowledge: what used to be called memories, reports and context documents. Write them with `crtr doc write|edit|move|history|delete|lint`; read them with `crtr canvas read`. Each has a required one-line **preview** ("When …, read this because …"), a body, optional summary, privacy (`public` default, `friends`, `private`), delivery **rules**, and revisions — an edit is made from the revision you last read and is refused if the document moved on. A document's `kind` is `knowledge` (consulted) or `preference` (directs behavior); `report` documents are created only by `crtr push`. `crtr doc write -h` is the writing guide.
18
+ - **Documents** are the one object type for written knowledge: what used to be called memories, reports and context documents. Write them with `crtr doc write|edit|move|history|delete|lint`; read them with `crtr canvas read`. Each has a required one-line **preview** ("When …, read this because …"), a body, optional summary, privacy (`public` default, or `private`: readable by you and the people you share it with, and by an app only with a private-read scope; share with `crtr canvas share`), delivery **rules**, and revisions — an edit is made from the revision you last read and is refused if the document moved on. A document's `kind` is `knowledge` (consulted) or `preference` (directs behavior); `report` documents are created only by `crtr push`. `crtr doc write -h` is the writing guide.
19
19
  - **Owners** are objects too: a node, the person (`user`), a profile, an app, or a repo. The owner decides who may read and change a document, where it syncs, and what deletes it. The default owner is the writing node (the document goes away with the node unless a kept document links to it); `--owner user|profile|app|repo` makes it outlive the node. A repo owns only public documents and syncs them to collaborators over the git ref `refs/crtr/docs`. An installed plugin is an app (`app:<plugin>`); crtr's own documents belong to the app `crtr`. Which owner to pick: [[internal/agent-shaping]].
20
20
  - **Names and pointers.** A document's full name is `<owner-handle>/<path>`; a node's handle is its id, so a node's report is `<node-id>/reports/<ts>-<id>-<kind>`. Point at an object as `[[name]]`, never by file path. In a document body each `[[link]]` attaches the target's preview wherever the body is delivered in full, and creates a `links-to` edge. A bare name resolves in the reader's view — own node, repos nearest-first, profile, app, then the person, installed plugins, and `crtr` last — so a repo document can shadow one of crtr's own. Moving a document (`doc move`) keeps its id and its links.
21
+ - **Sharing.** Privacy has two levels, `public` and `private`, with one meaning on every object: an app reads a private object only through a scope that allows private. Between people, a share is a permission on one object: `crtr canvas share <object> <read|edit|message|use> <user:ID|team:ID|everyone>` (`--revoke` removes it). The owner and the owner's agents share; a shared person cannot re-share. `read` works on any object, `edit` on documents, `message` on nodes and profiles, `use` on environments; `everyone` is read-only and needs a joined install. A share flows down to everything the object owns, and `crtr canvas list --shared` lists what you reach only through a share.
21
22
  - **Watches and events.** Every object publishes events — all kinds share created, read, watched, deleted and configured; each kind adds its own (a document `edited`, a node `report.update`, a job `exited`) — each with a level 1–10. **Reading an object, writing a document, messaging a node, spawning one or starting a job makes you its watcher**, and its later events reach your inbox — an edit to a document you read can steer you while you run. `crtr canvas watch` adds a watch with a pattern or listening config; `crtr canvas unwatch` ends one when the object no longer bears on your work. `list`, `search` and `edges` record nothing. `crtr canvas edges` shows `acted-on`, `links-to` and `watches` edges.
22
23
  - **Jobs** are backgrounded bash commands: object type `job`, readable with `crtr canvas read` (command, status, exit code, log path). A job emits `exited` and `killed` events to its watchers.
23
24
  - **Custom objects** are objects an outside service, script or app registers with `crtr custom-object register` — a dotted kind, a declared event catalog with fixed levels, and optionally a receiver (`queue` pulled with `receive`/`ack`, an HTTPS `url`, or an `argv` command). They `publish` declared events to watchers and, with `crtr canvas watch --as <object>`, can watch other objects. Use one when something outside crtr must surface state on the canvas or react to canvas events.
@@ -69,7 +69,7 @@ Reach for a **new** profile when a distinct body of work has its own set of dire
69
69
 
70
70
  ## Owners — who owns a document sets its reach
71
71
 
72
- An owner is itself an object (a node, the person, a profile, an app, a repo), and a document's full name starts with its owner's handle: `<owner-handle>/<name>`. Ownership decides who may read and change the document, where it syncs and what deletes it; together with the document's privacy (`public` default, `friends`, `private`) and its delivery rules it decides who gets it. The wider the owner, the more agents pay to carry it, forever. Choose the **narrowest owner that still reaches the next agent who needs it**, and revise an existing document (`crtr doc edit`) rather than adding a near copy under a second owner. Moving a document between owners (`crtr doc move --owner`) keeps its id and every `[[link]]`. The owner decides *eligibility*; a rule decides *loading* (`internal/memory-loading`); a node can always read what it is pointed at with `crtr canvas read`. Where state lives on disk is `internal/storage-tiers`; the field and rule contract is `crtr doc write -h`. The owners an agent chooses between, narrowest reach to widest:
72
+ An owner is itself an object (a node, the person, a profile, an app, a repo), and a document's full name starts with its owner's handle: `<owner-handle>/<name>`. Ownership decides who may read and change the document, where it syncs and what deletes it; together with the document's privacy (`public` default, or `private`) and its delivery rules it decides who gets it. The wider the owner, the more agents pay to carry it, forever. Choose the **narrowest owner that still reaches the next agent who needs it**, and revise an existing document (`crtr doc edit`) rather than adding a near copy under a second owner. Moving a document between owners (`crtr doc move --owner`) keeps its id and every `[[link]]`. The owner decides *eligibility*; a rule decides *loading* (`internal/memory-loading`); a node can always read what it is pointed at with `crtr canvas read`. Where state lives on disk is `internal/storage-tiers`; the field and rule contract is `crtr doc write -h`. The owners an agent chooses between, narrowest reach to widest:
73
73
 
74
74
  - **node** — the default owner of what a node writes. Only this node's view includes it; it is deleted with the node unless a kept document links to it. One goal's cross-refresh state.
75
75
  - **profile** (`--owner profile`) — every node running under that profile, across all the dirs in its purview. Cross-repo conventions and the user's stance toward that bundle of work.
@@ -13,7 +13,7 @@ surfaces:
13
13
 
14
14
  Everything on the canvas — documents, nodes, jobs, owners, custom objects — is an **object** in one SQLite database; see [[internal]] for the object model. Two places on disk hold the rest: the **scope root**, for configuration and prepared content that is files by nature, and the **canvas home**, for the database and per-node runtime files. This is the routing contract; precise resolver behavior lives in `src/core/scope.ts` and `src/core/canvas/paths.ts`.
15
15
 
16
- Documents are not a third place. A document is an object row in `canvas.db` plus a content-addressed body (a package document — crtr's own or a plugin's — keeps its body in its package file, read through `source_path`); who may read it comes from its owner and privacy (`crtr doc write --owner -h`), not from a directory. Do not look for documents on disk, and do not write one as a file: use `crtr doc write`, and read with `crtr canvas read`.
16
+ Documents are not a third place. A document is an object row in `canvas.db` plus a content-addressed body (a package document — crtr's own or a plugin's — keeps its body in its package file, read through `source_path`); who may read it comes from its privacy (`public` or `private`), the app's schema and its relation facts (`crtr doc write --owner -h`), not from a directory. Do not look for documents on disk, and do not write one as a file: use `crtr doc write`, and read with `crtr canvas read`.
17
17
 
18
18
  ## 1. Scope root — configuration and prepared content
19
19
 
@@ -21,7 +21,7 @@ A non-2xx answer is thrown as an `APIError`, never returned as bytes. A bad `ran
21
21
 
22
22
  ## Read the person's public documents
23
23
 
24
- `runtime.memory` is a read-only view of the `knowledge` and `preference` documents the person owns (`memory` and the `/v1/memory` routes are the API's names for this). An app reads the person's `public` documents with `memory.list` and `memory.get`, and needs no scope to do it. Without more, it never sees a `friends` or `private` document and cannot tell one from a document that does not exist: both answer `404 not_found`. The optional scope [`crtr:memory:read_private:user`](#private-memory) adds `private`. The list is what the app's agents can read about the person, so an app can show the person exactly which of their documents it draws on.
24
+ `runtime.memory` is a read-only view of the `knowledge` and `preference` documents the person owns (`memory` and the `/v1/memory` routes are the API's names for this). An app reads the person's `public` documents with `memory.list` and `memory.get`, and needs no scope to do it. Without more, it never sees a `private` document and cannot tell one from a document that does not exist: both answer `404 not_found`. The optional scope [`crtr:memory:read_private:user`](#private-memory) adds `private`. The list is what the app's agents can read about the person, so an app can show the person exactly which of their documents it draws on.
25
25
 
26
26
  ```ts
27
27
  const page = await runtime.memory.list({store: 'user'});
@@ -58,13 +58,13 @@ for await (const item of runtime.memory.listAll({store: 'user', path: 'work'}))
58
58
 
59
59
  - `body` is the current markdown as stored; `[[links]]` are not resolved. A body over 1 MiB is cut to its longest whole-character prefix of at most 1 MiB, with `truncated: true`; `size` is always the full length in UTF-8 bytes.
60
60
  - `grantee` is `app:<id>` of the app whose agent wrote the first revision, or `null` when the person wrote it.
61
- - An absent or deleted name, a `friends` name, and a `private` name without `crtr:memory:read_private:user` reject with `NotFoundError` (`code: 'not_found'`); a malformed field rejects with `BadRequestError`.
61
+ - An absent or deleted name, and a `private` name without `crtr:memory:read_private:user` reject with `NotFoundError` (`code: 'not_found'`); a malformed field rejects with `BadRequestError`.
62
62
 
63
63
  ## Private memory
64
64
 
65
65
  `crtr:memory:read_private:user` is an [[northlight-apps/guides/grant-changes]] that lets your app read the person's `private` documents. Declare it, then let the person switch it on from your app (sign-in request or `permissionUrl`).
66
66
 
67
- - **Read-only, and never `friends`.** With the scope `memory.list` and `memory.get` return `public` and `private` documents; a `friends` document still reads as absent, and the scope writes nothing. Each private document arrives with `privacy: 'private'`.
67
+ - **Read-only.** With the scope `memory.list` and `memory.get` return `public` and `private` documents, and the scope writes nothing. Each private document arrives with `privacy: 'private'`.
68
68
  - **Both server reads and runs.** Your server's `memory` calls see private documents while the grant holds the scope. A run sees them only if it was started with the scope: `runs.start` `scopes` must cover `crtr:memory:read_private:user` (name it, or name `crtr:memory:manage:user` if the grant holds that) (a run with no `scopes` list gets what the grant holds), and the start is refused `403 scope_missing` while the grant lacks it. Add the scope to the runs that need it only while `resolved_scopes` holds it.
69
69
  - **The person can turn it off at any time.** Reads then stop returning private documents at once, including from a run that is still live. That run keeps what it already read in its context, so restart the runs that used it when the permission turns off (`watchGrants` tells you).
70
70
  - **Never show a private detail to anyone but the owner**, unless the owner asked your app to. A visitor, a guest or another user must not see a fact, quote or summary taken from a private document.
@@ -48,7 +48,7 @@ A visitor chatting with B's clone starts an app run on **B's runtime and B's AI
48
48
 
49
49
  A run your app starts is **your app's agent**, not a continuation of another app's agent. It starts in `/apps/<app>/files`, uses the person's AI under `crtr:llm`, and reaches your app's own documents (owned by `app:<your app>`) without a `crtr:memory` scope. Other people's or apps' data is not shared merely because the app has many users. The grant's resolved permissions govern access to the person's files (`crtr:files:<access>:user:<dir>`), the person's documents (`crtr:memory:<access>:user`), another app's space (only where that app allows it), and another app's conversations (`crtr:conversations:read:app:<B>`).
50
50
 
51
- The exception is the person's **public** documents (owned by the person, read through `memory`; see [[northlight-apps/guides/files-and-documents]]): an app with an active grant can read these even without a user-memory scope. A third-party app cannot see `friends` documents, and sees `private` ones only with the optional `crtr:memory:read_private:user` the person switched on; `crtr:memory:read:user` reveals neither. They look absent from lists, searches, reads and history. Only a holder of `crtr:memory:manage:user` (a first-party app), or the person, reads all three levels. A document without a privacy field reads as `private`. Public read access is not write access.
51
+ The exception is the person's **public** documents (owned by the person, read through `memory`; see [[northlight-apps/guides/files-and-documents]]): an app with an active grant can read these even without a user-memory scope. A third-party app sees `private` documents only with the optional `crtr:memory:read_private:user` the person switched on; `crtr:memory:read:user` does not reveal them. They look absent from lists, searches, reads and history. `crtr:memory:read_private:user` and `crtr:memory:manage:user` (a first-party app) widen the app's ceiling to `private`, and the app's schema and relation facts decide visibility within it. The person reads both levels. A document without a privacy field reads as `private`. Public read access is not write access.
52
52
 
53
53
  Every run is sandboxed: its shell runs as the app's OS user and sees only the app's space and the folders its permissions name. Normal runs have network access. Start a run with `isolated: true` when the agent should have **no network** and **no `/apps/<app>/files` mount**: its cwd is its own node folder, and all children inherit the restriction. The shell, stored conversation and model calls still work, and the run's `scopes` can narrow its commands. An isolated run cannot turn isolation off in a child or schedule, or use an outside cwd or worktree.
54
54
 
@@ -119,7 +119,7 @@ In your callback handler, check `authorizationRefusalOf(url)` before reading `co
119
119
 
120
120
  ## Memory and providers
121
121
 
122
- `user.memory.put({name, body, privacy = 'public', kind = 'knowledge', ...})` and `remove(name)`. Without `crtr:memory:manage:user` in the grant, only `public` documents are listed and others read as 404, as on the runtime; `crtr:memory:read_private:user` adds `private` (never `friends`). FakeCloud applies the user's whole grant (`user.grant.set`), not the `scopes` a run was started with; test narrowed runs on the real runtime. List items carry the full `MemoryListItem` fields.
122
+ `user.memory.put({name, body, privacy = 'public', kind = 'knowledge', ...})` and `remove(name)`. Without `crtr:memory:manage:user` in the grant, only `public` documents are listed and others read as 404, as on the runtime; `crtr:memory:read_private:user` adds `private`. FakeCloud applies the user's whole grant (`user.grant.set`), not the `scopes` a run was started with; test narrowed runs on the real runtime. List items carry the full `MemoryListItem` fields.
123
123
 
124
124
  ```ts
125
125
  cloud.providers.define('sms', { tools: { send: { group: 'send', handler: ({ userId, arguments: args }) => ({ sent: true }) } } });