@north-light/crouter 0.3.355 → 0.3.357
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/dto/delivery.d.ts +13 -3
- package/dist/api/dto/objects.d.ts +24 -22
- package/dist/api/dto/objects.js +1 -1
- package/dist/clients/attach/session/document-links.js +1 -1
- package/dist/clients/attach/viewer.js +829 -755
- package/dist/commands/canvas/list.js +3 -3
- package/dist/commands/canvas/read.d.ts +2 -4
- package/dist/commands/canvas/read.js +3 -5
- package/dist/commands/canvas/search.js +1 -1
- package/dist/commands/sys/context/admin/actions.js +1 -1
- package/dist/commands/sys/sync-deps.js +1 -1
- package/dist/commands/sys/sync-shared.js +1 -1
- package/dist/core/canvas/daemon-actions.d.ts +43 -0
- package/dist/core/canvas/daemon-actions.js +26 -0
- package/dist/core/canvas/deliveries.d.ts +1 -0
- package/dist/core/canvas/deliveries.js +1 -1
- package/dist/core/canvas/migrations.js +106 -46
- package/dist/core/feed/messages.d.ts +2 -20
- package/dist/core/feed/messages.js +6 -10
- package/dist/core/graph/events.d.ts +10 -5
- package/dist/core/graph/events.js +5 -5
- package/dist/core/graph/jobs.js +2 -2
- package/dist/core/graph/kinds/document.d.ts +19 -0
- package/dist/core/graph/kinds/document.js +5 -0
- package/dist/core/graph/kinds/dto.d.ts +5 -0
- package/dist/core/graph/kinds/dto.js +1 -0
- package/dist/core/graph/kinds/job.d.ts +2 -0
- package/dist/core/graph/kinds/job.js +2 -0
- package/dist/core/graph/kinds/kind.d.ts +39 -0
- package/dist/core/graph/kinds/kind.js +1 -0
- package/dist/core/graph/kinds/node.d.ts +2 -0
- package/dist/core/graph/kinds/node.js +4 -0
- package/dist/core/graph/kinds/owner.d.ts +2 -0
- package/dist/core/graph/kinds/owner.js +2 -0
- package/dist/core/graph/kinds/registry.d.ts +8 -0
- package/dist/core/graph/kinds/registry.js +1 -0
- package/dist/core/graph/kinds/render.d.ts +9 -0
- package/dist/core/graph/kinds/render.js +1 -0
- package/dist/core/graph/objects.d.ts +5 -4
- package/dist/core/graph/objects.js +5 -5
- package/dist/core/graph/types.d.ts +6 -5
- package/dist/core/providers/errors.d.ts +97 -0
- package/dist/core/providers/errors.js +1 -0
- package/dist/core/runtime/broker-protocol.d.ts +2 -7
- package/dist/daemon/api/app-listener.js +12 -12
- package/dist/daemon/api/handlers/human-requests.js +1 -1
- package/dist/daemon/api/handlers/objects.js +2 -5
- package/dist/daemon/api/handlers/providers.d.ts +69 -0
- package/dist/daemon/api/handlers/providers.js +1 -0
- package/dist/daemon/api/operations.js +1 -1
- package/dist/daemon/api/server.js +1 -1
- package/dist/daemon/cron/settle.js +1 -1
- package/dist/daemon/cron/sinks.d.ts +3 -3
- package/dist/daemon/cron/sinks.js +2 -2
- package/dist/daemon/crtrd.js +6 -6
- package/dist/daemon/human/finish.js +6 -6
- package/dist/daemon/human/settle.d.ts +2 -3
- package/dist/daemon/human/settle.js +1 -1
- package/dist/daemon/reconcilers/action-lane.d.ts +8 -0
- package/dist/daemon/reconcilers/action-lane.js +1 -0
- package/dist/daemon/reconcilers/delivery-lane.d.ts +1 -1
- package/dist/daemon/reconcilers/delivery-lane.js +1 -1
- package/package.json +2 -2
- package/packages/crouter-identity/package.json +1 -1
- package/runtime.lock.json +11 -11
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { NodeSubjectDTO } from './nodes.js';
|
|
1
2
|
export type DeliveryActivity = 'boot' | 'system-prompt' | 'compact' | 'persona' | 'file-read' | 'command' | 'pre-command' | 'slash-command' | 'names'
|
|
2
3
|
/** Dry run only: a live node's workspace-open arrives inside its boot. */
|
|
3
4
|
| 'workspace-open'
|
|
@@ -9,7 +10,7 @@ export interface DeliveryRequest {
|
|
|
9
10
|
subject?: string;
|
|
10
11
|
inherited?: boolean;
|
|
11
12
|
dry_run?: boolean;
|
|
12
|
-
subject_override?: Partial<
|
|
13
|
+
subject_override?: Partial<NodeSubjectDTO>;
|
|
13
14
|
}
|
|
14
15
|
/** A node that does not exist, for `POST /v1/delivery/dry-run`. Unset fields
|
|
15
16
|
* come from `node` when one is named, else from defaults. */
|
|
@@ -32,7 +33,16 @@ export interface DeliveryDryRunRequest {
|
|
|
32
33
|
subject?: string;
|
|
33
34
|
node?: string;
|
|
34
35
|
hypothetical?: HypotheticalNodeDTO;
|
|
35
|
-
subject_override?: Partial<
|
|
36
|
+
subject_override?: Partial<NodeSubjectDTO>;
|
|
37
|
+
}
|
|
38
|
+
/** One resolvable inline memory reference — the broker's `RefMeta`. Metadata
|
|
39
|
+
* only, never the document body or its source path. */
|
|
40
|
+
export interface DeliveryRefDTO {
|
|
41
|
+
name: string;
|
|
42
|
+
kind: 'knowledge' | 'preference';
|
|
43
|
+
scope: 'node' | 'project' | 'profile' | 'user' | 'builtin';
|
|
44
|
+
shortForm: string;
|
|
45
|
+
gatewayVisible: boolean;
|
|
36
46
|
}
|
|
37
47
|
export interface DeliveryCommandDTO {
|
|
38
48
|
name: string;
|
|
@@ -47,7 +57,7 @@ export interface DeliveryResponse {
|
|
|
47
57
|
commands?: DeliveryCommandDTO[];
|
|
48
58
|
blocks?: string[];
|
|
49
59
|
execution_body?: string;
|
|
50
|
-
refs?:
|
|
60
|
+
refs?: DeliveryRefDTO[];
|
|
51
61
|
names?: string[];
|
|
52
62
|
plan?: unknown;
|
|
53
63
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export declare const OBJECT_TYPES: readonly ["document", "node", "job", "person", "app", "repo", "profile"];
|
|
2
|
-
export type ObjectTypeName = typeof OBJECT_TYPES[number];
|
|
3
1
|
export declare const PRIVACY_LEVELS_DTO: readonly ["public", "friends", "private"];
|
|
4
2
|
export type PrivacyName = typeof PRIVACY_LEVELS_DTO[number];
|
|
5
3
|
export type OwnerTypeName = 'person' | 'app' | 'repo' | 'profile' | 'node' | 'document' | 'job';
|
|
@@ -10,7 +8,8 @@ export interface ObjectOwnerDTO {
|
|
|
10
8
|
}
|
|
11
9
|
export interface ObjectDTO {
|
|
12
10
|
id: string;
|
|
13
|
-
|
|
11
|
+
/** The object's kind name: `document`, `node`, `job`, `person`, `app`, `repo`, `profile`, or a later kind. */
|
|
12
|
+
type: string;
|
|
14
13
|
kind: string | null;
|
|
15
14
|
owner: ObjectOwnerDTO | null;
|
|
16
15
|
privacy: PrivacyName;
|
|
@@ -33,10 +32,8 @@ export interface DocFieldsDTO {
|
|
|
33
32
|
extensions?: Record<string, Record<string, unknown>>;
|
|
34
33
|
rules?: import('./docs.js').DeliveryRuleDTO[];
|
|
35
34
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
type: 'document';
|
|
39
|
-
object: ObjectDTO;
|
|
35
|
+
/** `data` of a document read. */
|
|
36
|
+
export interface DocumentReadData {
|
|
40
37
|
summary: string | null;
|
|
41
38
|
revision: number;
|
|
42
39
|
heads: DocHeadDTO[];
|
|
@@ -49,29 +46,23 @@ export interface DocumentReadDTO {
|
|
|
49
46
|
attachments?: string;
|
|
50
47
|
fields?: DocFieldsDTO;
|
|
51
48
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
type: 'node';
|
|
55
|
-
object: ObjectDTO;
|
|
49
|
+
/** `data` of a node read. */
|
|
50
|
+
export interface NodeReadData {
|
|
56
51
|
status: string;
|
|
57
52
|
mandate_first_line: string;
|
|
58
53
|
children: ObjectDTO[];
|
|
59
54
|
owned: ObjectDTO[];
|
|
60
55
|
jobs: ObjectDTO[];
|
|
61
56
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
type: 'job';
|
|
65
|
-
object: ObjectDTO;
|
|
57
|
+
/** `data` of a job read. */
|
|
58
|
+
export interface JobReadData {
|
|
66
59
|
command: string;
|
|
67
60
|
status: string;
|
|
68
61
|
exit_code: number | null;
|
|
69
62
|
log_path: string;
|
|
70
63
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
type: 'person' | 'app' | 'repo' | 'profile';
|
|
74
|
-
object: ObjectDTO;
|
|
64
|
+
/** `data` of a person, app, repo or profile read. */
|
|
65
|
+
export interface OwnerReadData {
|
|
75
66
|
handle: string;
|
|
76
67
|
display_name: string;
|
|
77
68
|
identity: {
|
|
@@ -79,6 +70,15 @@ export interface OwnerReadDTO {
|
|
|
79
70
|
external_id: string;
|
|
80
71
|
};
|
|
81
72
|
}
|
|
73
|
+
/** A live object: `text` is exactly what `crtr canvas read` prints; `data` holds the kind's
|
|
74
|
+
* structured fields (for the built-in kinds, the `*ReadData` shapes above). */
|
|
75
|
+
export interface ObjectLiveReadDTO {
|
|
76
|
+
state: 'object';
|
|
77
|
+
type: string;
|
|
78
|
+
object: ObjectDTO;
|
|
79
|
+
text: string;
|
|
80
|
+
data: Record<string, unknown>;
|
|
81
|
+
}
|
|
82
82
|
/** A pointer to a deleted object resolves to that object (§8); an answer, not an error. */
|
|
83
83
|
export interface ObjectDeletedDTO {
|
|
84
84
|
state: 'deleted';
|
|
@@ -89,12 +89,13 @@ export interface ObjectRemoteDTO {
|
|
|
89
89
|
state: 'remote';
|
|
90
90
|
remote: string;
|
|
91
91
|
}
|
|
92
|
-
export type ObjectReadDTO =
|
|
92
|
+
export type ObjectReadDTO = ObjectLiveReadDTO | ObjectDeletedDTO | ObjectRemoteDTO;
|
|
93
93
|
export interface ObjectReadQuery {
|
|
94
94
|
fields?: boolean;
|
|
95
95
|
}
|
|
96
96
|
export interface ObjectListRequest {
|
|
97
|
-
|
|
97
|
+
/** A kind name. */
|
|
98
|
+
type?: string;
|
|
98
99
|
kind?: string;
|
|
99
100
|
/** An owner ref (name or id). */
|
|
100
101
|
owner?: string;
|
|
@@ -118,7 +119,8 @@ export interface ObjectSearchRequest {
|
|
|
118
119
|
text: string;
|
|
119
120
|
body?: boolean;
|
|
120
121
|
grep?: string;
|
|
121
|
-
|
|
122
|
+
/** A kind name. */
|
|
123
|
+
type?: string;
|
|
122
124
|
kind?: string;
|
|
123
125
|
owner?: string;
|
|
124
126
|
limit?: number;
|
package/dist/api/dto/objects.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e=["public","friends","private"];export{e as PRIVACY_LEVELS_DTO};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var k=Object.defineProperty;var i=(o
|
|
1
|
+
var k=Object.defineProperty;var i=(n,o)=>k(n,"name",{value:o,configurable:!0});import{APIError as C}from"../../../api/errors.js";import{cliClient as v}from"../../../commands/api-client.js";import{setDocLinkContext as y}from"../render/doc-links.js";import{DOC_SAVEBACK_ENV as g,documentForPath as h,materializeDocument as b,saveDocumentEdit as E,saveOutcomeNotice as L}from"./doc-materialize.js";async function w(n){const o=await v().objects.read(n);if(o.state!=="object"||o.type!=="document")return`${n} is not a readable document`;const a=o.data;if(a.needs_merge||a.bodies.length!==1)return`${n} has ${a.heads.length} heads and needs a merge`;const s=o.object.owner?.handle;return{id:o.object.id,name:s===void 0?o.object.name:`${s}/${o.object.name}`,revision:a.revision,heads_key:a.heads.map(d=>d.rev_id).sort().join(","),body:a.bodies[0]}}i(w,"readSnapshot");function z(n){const o=new Map,a=new Map,s=new Set,d=new Set;let m=!1,f=!1,l=!1;const j=i(()=>{m||f||(f=!0,n.canvasSource.listNodes().then(t=>{for(const e of t)o.set(e.node_id,e.name);m=!0,l||n.refresh()}).catch(()=>{m=!0}).finally(()=>{f=!1}))},"loadRoster"),N=i(t=>{n.remote||s.has(t)||d.has(t)||(s.add(t),w(t).then(e=>{if(typeof e=="string"){d.add(t);return}a.set(t,b(t,e)),l||n.refresh()}).catch(()=>{d.add(t)}).finally(()=>{s.delete(t)}))},"materialize"),S={selfNodeId:n.selfNodeId,nodeName:i(t=>{const e=o.get(t);return e===void 0&&j(),e},"nodeName"),pathFor:i(t=>{const e=a.get(t);return e===void 0&&N(t),e},"pathFor")};return y(S),{isDocumentPath:i(t=>h(t)!==void 0,"isDocumentPath"),async prepareOpen(t){if(n.remote)return{notice:"Opening a document is unavailable in a remote attach"};const e=h(t);if(e===void 0)return{notice:"Not a document link"};try{const r=await w(e.id);if(typeof r=="string")return{notice:r};const c=b(e.ref,r);return a.set(e.ref,c),{path:c}}catch(r){return{notice:`Could not read ${e.name}: ${r instanceof Error?r.message:String(r)}`}}},async consumeSaveBack(t){const e=process.env[g];if(e===void 0||e==="")return;delete process.env[g];const r=h(e),c=await E(e,async(_,$,D)=>{try{return{revision:(await v().docs.edit(_,{body:$,base:D,rationale:"edited by the person in the attach viewer"})).revision}}catch(u){if(u instanceof C&&u.code==="stale_revision")return"stale";throw u}}),p=L(r?.name??e,c);p!==void 0&&t(p)},dispose(){l=!0,y(void 0)}}}i(z,"createDocumentLinks");export{z as createDocumentLinks};
|