@abraca/orchestrator 2.33.0 → 2.35.0
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/abracadabra-orchestrator.cjs +14 -1505
- package/dist/abracadabra-orchestrator.cjs.map +1 -1
- package/dist/abracadabra-orchestrator.esm.js +13 -1503
- package/dist/abracadabra-orchestrator.esm.js.map +1 -1
- package/package.json +2 -3
- package/src/actions/content.ts +1 -1
- package/src/actor-connection.ts +19 -35
- package/src/utils.ts +5 -37
- package/src/converters/markdownToYjs.ts +0 -932
- package/src/converters/types.ts +0 -179
- package/src/crypto.ts +0 -71
package/src/converters/types.ts
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
export interface UserMetaField {
|
|
2
|
-
id: string
|
|
3
|
-
type: string
|
|
4
|
-
label?: string
|
|
5
|
-
key?: string
|
|
6
|
-
latKey?: string
|
|
7
|
-
lngKey?: string
|
|
8
|
-
startKey?: string
|
|
9
|
-
endKey?: string
|
|
10
|
-
allDayKey?: string
|
|
11
|
-
presets?: string[]
|
|
12
|
-
options?: string[]
|
|
13
|
-
min?: number
|
|
14
|
-
max?: number
|
|
15
|
-
step?: number
|
|
16
|
-
unit?: string
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface PageMeta extends Record<string, unknown> {
|
|
20
|
-
// Universal display
|
|
21
|
-
color?: string
|
|
22
|
-
icon?: string
|
|
23
|
-
subtitle?: string
|
|
24
|
-
note?: string
|
|
25
|
-
|
|
26
|
-
// Datetime
|
|
27
|
-
datetimeStart?: string
|
|
28
|
-
datetimeEnd?: string
|
|
29
|
-
allDay?: boolean
|
|
30
|
-
dateStart?: string
|
|
31
|
-
dateEnd?: string
|
|
32
|
-
timeStart?: string
|
|
33
|
-
timeEnd?: string
|
|
34
|
-
|
|
35
|
-
// Task/status
|
|
36
|
-
checked?: boolean
|
|
37
|
-
priority?: number
|
|
38
|
-
status?: string
|
|
39
|
-
taskProgress?: number
|
|
40
|
-
rating?: number
|
|
41
|
-
tags?: string[]
|
|
42
|
-
members?: { id: string; label: string }[]
|
|
43
|
-
|
|
44
|
-
// Contact/value
|
|
45
|
-
url?: string
|
|
46
|
-
email?: string
|
|
47
|
-
phone?: string
|
|
48
|
-
number?: number
|
|
49
|
-
unit?: string
|
|
50
|
-
|
|
51
|
-
// Cover image
|
|
52
|
-
coverUploadId?: string
|
|
53
|
-
coverDocId?: string
|
|
54
|
-
coverMimeType?: string
|
|
55
|
-
|
|
56
|
-
// Geo/Map
|
|
57
|
-
geoType?: 'marker' | 'line' | 'measure'
|
|
58
|
-
geoLat?: number
|
|
59
|
-
geoLng?: number
|
|
60
|
-
geoDescription?: string
|
|
61
|
-
|
|
62
|
-
// Whiteboard
|
|
63
|
-
wbX?: number
|
|
64
|
-
wbY?: number
|
|
65
|
-
wbW?: number
|
|
66
|
-
wbH?: number
|
|
67
|
-
wbBg?: string
|
|
68
|
-
|
|
69
|
-
// Dashboard
|
|
70
|
-
deskX?: number
|
|
71
|
-
deskY?: number
|
|
72
|
-
deskZ?: number
|
|
73
|
-
deskMode?: string
|
|
74
|
-
|
|
75
|
-
// Mindmap
|
|
76
|
-
mmX?: number
|
|
77
|
-
mmY?: number
|
|
78
|
-
|
|
79
|
-
// Graph
|
|
80
|
-
graphX?: number
|
|
81
|
-
graphY?: number
|
|
82
|
-
graphPinned?: boolean
|
|
83
|
-
showRefEdges?: boolean
|
|
84
|
-
|
|
85
|
-
// Spatial (3D)
|
|
86
|
-
spShape?: string
|
|
87
|
-
spColor?: string
|
|
88
|
-
spOpacity?: number
|
|
89
|
-
spX?: number
|
|
90
|
-
spY?: number
|
|
91
|
-
spZ?: number
|
|
92
|
-
spRX?: number
|
|
93
|
-
spRY?: number
|
|
94
|
-
spRZ?: number
|
|
95
|
-
spSX?: number
|
|
96
|
-
spSY?: number
|
|
97
|
-
spSZ?: number
|
|
98
|
-
spModelUploadId?: string
|
|
99
|
-
spModelDocId?: string
|
|
100
|
-
|
|
101
|
-
// Slides
|
|
102
|
-
slidesTransition?: string
|
|
103
|
-
slidesTheme?: string
|
|
104
|
-
|
|
105
|
-
// Media metadata (extracted on import)
|
|
106
|
-
mediaDuration?: number
|
|
107
|
-
mediaWidth?: number
|
|
108
|
-
mediaHeight?: number
|
|
109
|
-
mediaCamera?: string
|
|
110
|
-
mediaLens?: string
|
|
111
|
-
mediaIso?: number
|
|
112
|
-
mediaFocalLength?: number
|
|
113
|
-
mediaAperture?: number
|
|
114
|
-
mediaShutterSpeed?: string
|
|
115
|
-
mediaArtist?: string
|
|
116
|
-
mediaAlbum?: string
|
|
117
|
-
mediaGenre?: string
|
|
118
|
-
mediaYear?: number
|
|
119
|
-
dateTaken?: string
|
|
120
|
-
|
|
121
|
-
// Sheets cell formatting
|
|
122
|
-
bold?: boolean
|
|
123
|
-
italic?: boolean
|
|
124
|
-
textColor?: string
|
|
125
|
-
bgColor?: string
|
|
126
|
-
align?: string
|
|
127
|
-
formula?: string
|
|
128
|
-
|
|
129
|
-
// Renderer config (set on the page doc itself, not children)
|
|
130
|
-
kanbanColumnWidth?: string
|
|
131
|
-
galleryColumns?: number
|
|
132
|
-
galleryAspect?: string
|
|
133
|
-
galleryCardStyle?: string
|
|
134
|
-
galleryShowLabels?: boolean
|
|
135
|
-
gallerySortBy?: string
|
|
136
|
-
calendarView?: string
|
|
137
|
-
calendarWeekStart?: string
|
|
138
|
-
calendarShowWeekNumbers?: boolean
|
|
139
|
-
tableMode?: string
|
|
140
|
-
tableSortDir?: string
|
|
141
|
-
tableColumns?: any[]
|
|
142
|
-
tableColumnWidths?: Record<string, number>
|
|
143
|
-
tableColumnOrder?: string[]
|
|
144
|
-
timelineZoom?: string
|
|
145
|
-
checklistFilter?: string
|
|
146
|
-
checklistSort?: string
|
|
147
|
-
mapShowLabels?: boolean
|
|
148
|
-
spatialGridVisible?: boolean
|
|
149
|
-
chartType?: string
|
|
150
|
-
chartMetric?: string
|
|
151
|
-
chartColorScheme?: string
|
|
152
|
-
chartLimit?: number
|
|
153
|
-
chartShowLegend?: boolean
|
|
154
|
-
chartShowValues?: boolean
|
|
155
|
-
mediaRepeat?: string
|
|
156
|
-
mediaShuffle?: boolean
|
|
157
|
-
sheetsDefaultColWidth?: number
|
|
158
|
-
sheetsDefaultRowHeight?: number
|
|
159
|
-
sheetsShowGridlines?: boolean
|
|
160
|
-
sheetsColumnWidths?: Record<string, number>
|
|
161
|
-
sheetsRowHeights?: Record<string, number>
|
|
162
|
-
sheetsFreezeRows?: number
|
|
163
|
-
sheetsFreezeCols?: number
|
|
164
|
-
|
|
165
|
-
// Internal
|
|
166
|
-
_metaFields?: UserMetaField[]
|
|
167
|
-
_metaInitialized?: boolean
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export interface TreeEntry {
|
|
171
|
-
id: string
|
|
172
|
-
label: string
|
|
173
|
-
parentId: string | null
|
|
174
|
-
order: number
|
|
175
|
-
type?: string
|
|
176
|
-
meta?: PageMeta
|
|
177
|
-
createdAt?: number
|
|
178
|
-
updatedAt?: number
|
|
179
|
-
}
|
package/src/crypto.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ed25519 key generation, persistence, and challenge signing for actor auth.
|
|
3
|
-
* Copied from packages/mcp/src/crypto.ts
|
|
4
|
-
*/
|
|
5
|
-
import * as ed from '@noble/ed25519'
|
|
6
|
-
import { sha512 } from '@noble/hashes/sha2.js'
|
|
7
|
-
import { readFile, writeFile, mkdir } from 'node:fs/promises'
|
|
8
|
-
|
|
9
|
-
// @noble/ed25519 v3 hash hook
|
|
10
|
-
ed.hashes.sha512 = sha512
|
|
11
|
-
ed.hashes.sha512Async = (m: Uint8Array) => Promise.resolve(sha512(m))
|
|
12
|
-
import { existsSync } from 'node:fs'
|
|
13
|
-
import { dirname } from 'node:path'
|
|
14
|
-
|
|
15
|
-
function toBase64url(bytes: Uint8Array): string {
|
|
16
|
-
return Buffer.from(bytes).toString('base64url')
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function fromBase64url(b64: string): Uint8Array {
|
|
20
|
-
return new Uint8Array(Buffer.from(b64, 'base64url'))
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface AgentKeypair {
|
|
24
|
-
privateKey: Uint8Array
|
|
25
|
-
publicKeyB64: string
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Load an existing Ed25519 keypair from disk, or generate and persist a new one.
|
|
30
|
-
*/
|
|
31
|
-
export async function loadOrCreateKeypair(keyPath: string): Promise<AgentKeypair> {
|
|
32
|
-
if (existsSync(keyPath)) {
|
|
33
|
-
const seed = await readFile(keyPath)
|
|
34
|
-
if (seed.length !== 32) {
|
|
35
|
-
throw new Error(`Invalid key file at ${keyPath}: expected 32 bytes, got ${seed.length}`)
|
|
36
|
-
}
|
|
37
|
-
const privateKey = new Uint8Array(seed)
|
|
38
|
-
const publicKey = ed.getPublicKey(privateKey)
|
|
39
|
-
return { privateKey, publicKeyB64: toBase64url(publicKey) }
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const privateKey = ed.utils.randomSecretKey()
|
|
43
|
-
const publicKey = ed.getPublicKey(privateKey)
|
|
44
|
-
|
|
45
|
-
const dir = dirname(keyPath)
|
|
46
|
-
if (!existsSync(dir)) {
|
|
47
|
-
await mkdir(dir, { recursive: true, mode: 0o700 })
|
|
48
|
-
}
|
|
49
|
-
await writeFile(keyPath, Buffer.from(privateKey), { mode: 0o600 })
|
|
50
|
-
|
|
51
|
-
console.error(`[orchestrator] Generated new keypair at ${keyPath}`)
|
|
52
|
-
return { privateKey, publicKeyB64: toBase64url(publicKey) }
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Generate a deterministic Ed25519 keypair from a seed string (e.g. actor name).
|
|
57
|
-
* The same seed always produces the same keypair.
|
|
58
|
-
*/
|
|
59
|
-
export function deterministicKeypair(seed: string): AgentKeypair {
|
|
60
|
-
const hash = sha512(new TextEncoder().encode(seed + ':orchestrator-salt'))
|
|
61
|
-
const privateKey = hash.slice(0, 32)
|
|
62
|
-
const publicKey = ed.getPublicKey(privateKey)
|
|
63
|
-
return { privateKey, publicKeyB64: toBase64url(publicKey) }
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/** Sign a base64url challenge with the agent's private key; returns base64url signature. */
|
|
67
|
-
export function signChallenge(challengeB64: string, privateKey: Uint8Array): string {
|
|
68
|
-
const challenge = fromBase64url(challengeB64)
|
|
69
|
-
const sig = ed.sign(challenge, privateKey)
|
|
70
|
-
return toBase64url(sig)
|
|
71
|
-
}
|