@agentshouse/mdruntime-adapter 0.1.0-alpha.21 → 0.1.0-alpha.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +4 -3
- package/dist/adapter.js +3 -3
- package/dist/adapter.js.map +1 -1
- package/dist/discovery.d.ts +1 -1
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +4 -3
- package/dist/discovery.js.map +1 -1
- package/package.json +3 -3
package/AGENTS.md
CHANGED
|
@@ -111,7 +111,8 @@ the revision you read, or `null` when there was none, and every part it should
|
|
|
111
111
|
now change: fields, sections and the preamble, or the whole Markdown, a
|
|
112
112
|
creation, a move, or a removal. A part new to the Room Draft names its base,
|
|
113
113
|
the value you showed when it was opened; the MD Runtime keeps a part's first
|
|
114
|
-
base. A
|
|
114
|
+
base. A binary link target has a Room Draft too, for a move or a removal, with
|
|
115
|
+
`null` as its base. A write or a discard from an older revision is refused as `stale` with
|
|
115
116
|
the current Room Draft; read it and write again.
|
|
116
117
|
|
|
117
118
|
Save takes one Room and the Room Drafts of it to save, each with its revision,
|
|
@@ -119,8 +120,8 @@ validates locally, and on success appends one Change Batch to that Room's
|
|
|
119
120
|
queue and removes those Room Drafts. It is refused as `stale`, as
|
|
120
121
|
`changed-underneath` naming each part whose base no longer matches the visible
|
|
121
122
|
state, or by a local validation rule, and then creates nothing and leaves every
|
|
122
|
-
Room Draft in place. A directory move is a move part on
|
|
123
|
-
it, saved together.
|
|
123
|
+
Room Draft in place. A directory move or removal is a move or removal part on
|
|
124
|
+
each Document and binary link target beneath it, saved together.
|
|
124
125
|
|
|
125
126
|
Outcomes follow the Provider's answer. Accepted advances the confirmed
|
|
126
127
|
layer. Conflicted and Rejected, an expired outcome record, and a change that no
|
package/dist/adapter.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DISCOVER_PREFIXES,
|
|
1
|
+
import { DISCOVER_PREFIXES, HOUSE_TYPES_ROOT, capabilities, discoveredRoom, locatorOf, mapDiscovery, parseDiscovery, providerSelection, trackedFrom } from './discovery.js';
|
|
2
2
|
import { MODEL_ABSENT, failedModel, heldModel, modelKey, modelShelf } from './model.js';
|
|
3
3
|
import { createSiteAdapter } from './site.js';
|
|
4
4
|
import { authorityRoot, bootstrapFrom, contentPrefixes, definitionsFrom, modelPrefix, parseEnumeration, parseEnvelope, parseGrant, refreshFrom } from './read.js';
|
|
@@ -43,7 +43,7 @@ export function createAgentsHouseAdapter(options) {
|
|
|
43
43
|
const privateEntry = entries.find((entry)=>entry.locator === PRIVATE_LOCATOR);
|
|
44
44
|
const prefixes = entries.map((entry)=>modelPrefix(entry, entry.modelRoot));
|
|
45
45
|
if (privateEntry !== undefined) {
|
|
46
|
-
prefixes.push(`${authorityRoot(undefined)}/${
|
|
46
|
+
prefixes.push(`${authorityRoot(undefined)}/${HOUSE_TYPES_ROOT}`);
|
|
47
47
|
}
|
|
48
48
|
const answer = await transport.door(DOOR_BOOTSTRAP, {
|
|
49
49
|
prefixes
|
|
@@ -55,7 +55,7 @@ export function createAgentsHouseAdapter(options) {
|
|
|
55
55
|
acquired.set(modelKey(entry.locator, 'collection'), await held(envelope, entry, entry.modelRoot, `${authorityRoot(entry.handle)}/${entry.modelRoot}`, failure));
|
|
56
56
|
}
|
|
57
57
|
if (privateEntry !== undefined) {
|
|
58
|
-
acquired.set(modelKey(privateEntry.locator, 'typed-selection'), await held(envelope, privateEntry,
|
|
58
|
+
acquired.set(modelKey(privateEntry.locator, 'typed-selection'), await held(envelope, privateEntry, HOUSE_TYPES_ROOT, `${authorityRoot(undefined)}/${HOUSE_TYPES_ROOT}`, failure));
|
|
59
59
|
}
|
|
60
60
|
return acquired;
|
|
61
61
|
}
|
package/dist/adapter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/workspace/packages/mdruntime-adapter/src/adapter.ts"],"sourcesContent":["import type {\n ActionRequest,\n ActionResult,\n Adapter,\n Authorization,\n BootstrapRequest,\n BootstrapResult,\n DiscoverResult,\n DiscoveredRoom,\n HistoryRequest,\n HistoryResult,\n ModelRequest,\n ModelResult,\n MutationRequest,\n MutationResult,\n RefreshRequest,\n RefreshResult,\n} from '@agentshouse/mdruntime';\nimport {\n DISCOVER_PREFIXES,\n PROVIDER_SELECTION_MODEL_ROOT,\n capabilities,\n discoveredRoom,\n locatorOf,\n mapDiscovery,\n parseDiscovery,\n providerSelection,\n trackedFrom,\n type HouseAuthority,\n type TrackedAuthority,\n} from './discovery.js';\nimport {\n MODEL_ABSENT,\n failedModel,\n heldModel,\n modelKey,\n modelShelf,\n type HeldModel,\n} from './model.js';\nimport { createSiteAdapter } from './site.js';\nimport {\n authorityRoot,\n bootstrapFrom,\n contentPrefixes,\n definitionsFrom,\n modelPrefix,\n parseEnumeration,\n parseEnvelope,\n parseGrant,\n refreshFrom,\n} from './read.js';\nimport { houseAction } from './actions.js';\nimport { classifyDoor, discoveryFailure } from './refusal.js';\nimport { houseNotifications } from './stream.js';\nimport {\n DOOR_BATCH,\n DOOR_BATCH_UPLOAD,\n DOOR_BOOTSTRAP,\n DOOR_DISCOVER,\n DOOR_ENUMERATE,\n DOOR_REVISIONS,\n PRIVATE_LOCATOR,\n type HouseSiteTransport,\n type HouseTransport,\n} from './transport.js';\nimport {\n batchPaths,\n deltaBody,\n deltaBytes,\n deltaDigest,\n historyOutcome,\n houseChanges,\n mutationOutcome,\n operationHead,\n rejectedMapping,\n revisionBody,\n uploadable,\n type OperationHead,\n} from './write.js';\nimport { logPosition, presented } from './version.js';\n\nexport type AgentsHouseAdapterOptions =\n | {\n transport: HouseTransport;\n authorize(): Promise<Authorization>;\n }\n | { site: HouseSiteTransport };\n\nconst UNCERTAIN: MutationResult = { kind: 'transport-uncertainty' };\n\nconst RESOLVED_OUTCOMES: ReadonlySet<MutationResult['kind']> = new Set([\n 'accepted',\n 'conflicted',\n 'rejected',\n 'expired',\n]);\n\ntype Submission = { body: Record<string, unknown> } | { outcome: MutationResult };\n\nfunction lapsedGrant(outcome: MutationResult): boolean {\n return outcome.kind === 'rejected' && outcome.code === 'upload_unavailable';\n}\n\nfunction modelFailure(\n classified: ReturnType<typeof classifyDoor>,\n envelope: ReturnType<typeof parseEnvelope>,\n): ModelResult {\n if (classified === null) {\n return envelope === null ? { kind: 'transport-uncertainty' } : MODEL_ABSENT;\n }\n return failedModel(classified);\n}\n\nexport function createAgentsHouseAdapter(options: AgentsHouseAdapterOptions): Adapter {\n if ('site' in options) return createSiteAdapter(options.site);\n const transport = options.transport;\n const notifications = houseNotifications(transport, 'credential');\n const tracked = new Map<string, TrackedAuthority>();\n const models = modelShelf();\n const submissions = new Map<string, { sha256: string; body: Record<string, unknown> }>();\n\n function held(\n envelope: ReturnType<typeof parseEnvelope>,\n entry: TrackedAuthority,\n modelRoot: string,\n identity: string,\n failure: ModelResult,\n ): Promise<HeldModel> {\n return heldModel(\n envelope === null ? null : definitionsFrom(envelope, entry, modelRoot),\n identity,\n failure,\n );\n }\n\n async function acquireModels(\n entries: readonly TrackedAuthority[],\n ): Promise<Map<string, HeldModel>> {\n const acquired = new Map<string, HeldModel>();\n const privateEntry = entries.find((entry) => entry.locator === PRIVATE_LOCATOR);\n const prefixes = entries.map((entry) => modelPrefix(entry, entry.modelRoot));\n if (privateEntry !== undefined) {\n prefixes.push(`${authorityRoot(undefined)}/${PROVIDER_SELECTION_MODEL_ROOT}`);\n }\n const answer = await transport.door(DOOR_BOOTSTRAP, { prefixes });\n const classified = classifyDoor(answer.status, answer.body, PRIVATE_LOCATOR);\n const envelope = classified === null ? parseEnvelope(await bundled(answer.body)) : null;\n const failure: ModelResult = modelFailure(classified, envelope);\n for (const entry of entries) {\n acquired.set(\n modelKey(entry.locator, 'collection'),\n await held(\n envelope,\n entry,\n entry.modelRoot,\n `${authorityRoot(entry.handle)}/${entry.modelRoot}`,\n failure,\n ),\n );\n }\n if (privateEntry !== undefined) {\n acquired.set(\n modelKey(privateEntry.locator, 'typed-selection'),\n await held(\n envelope,\n privateEntry,\n PROVIDER_SELECTION_MODEL_ROOT,\n `${authorityRoot(undefined)}/${PROVIDER_SELECTION_MODEL_ROOT}`,\n failure,\n ),\n );\n }\n return acquired;\n }\n\n function roomOf(authority: HouseAuthority, acquired: Map<string, HeldModel>): DiscoveredRoom {\n const locator = locatorOf(authority);\n const key = modelKey(locator, 'collection');\n const collection = models.retain(key, acquired.get(key));\n if (authority.roomHandle !== null) {\n return discoveredRoom(authority, collection?.identity ?? null, undefined);\n }\n const selection = models.retain(\n modelKey(locator, 'typed-selection'),\n acquired.get(modelKey(locator, 'typed-selection')),\n );\n return discoveredRoom(\n authority,\n collection?.identity ?? null,\n providerSelection(selection?.identity ?? null),\n );\n }\n\n function authorityFor(locator: string): TrackedAuthority | undefined {\n return tracked.get(locator);\n }\n\n async function bundled(body: unknown): Promise<unknown> {\n const grant = parseGrant(body);\n if (grant === null) return body;\n if (grant.method !== 'GET') return null;\n const answer = await transport.transfer({\n act: 'working_copy_bundle',\n method: 'GET',\n url: grant.url,\n });\n return answer.status === 200 ? answer.body : null;\n }\n\n async function uploaded(\n head: OperationHead,\n changes: readonly Readonly<Record<string, unknown>>[],\n delta: string,\n bytes: number,\n entry: TrackedAuthority,\n ): Promise<Submission> {\n const paths = batchPaths(changes);\n const sha256 = await deltaDigest(delta);\n const retained = submissions.get(head.operation_id);\n if (\n retained !== undefined &&\n retained.sha256 === sha256 &&\n retained.body.app_ref === head.app_ref &&\n retained.body.release === head.release\n )\n return { body: retained.body };\n const minted = await transport.door(DOOR_BATCH_UPLOAD, { ...head, paths, bytes, sha256 });\n if (minted.status !== 200) {\n return { outcome: mutationOutcome(minted.status, minted.body, entry.locator, entry.handle) };\n }\n const grant = parseGrant(minted.body);\n if (grant === null || grant.method !== 'POST') return { outcome: UNCERTAIN };\n const delivered = await transport.transfer({\n act: 'authored_batch_upload',\n method: 'POST',\n url: grant.url,\n body: `${grant.operation}\\n${delta}`,\n });\n if (delivered.status !== 200) return { outcome: UNCERTAIN };\n const holding = parseGrant(delivered.body);\n if (holding === null) return { outcome: UNCERTAIN };\n const body = {\n ...head,\n paths,\n upload: { url: holding.url, operation: holding.operation, bytes, sha256 },\n };\n submissions.set(head.operation_id, { sha256, body });\n return { body };\n }\n\n async function submit(\n head: OperationHead,\n changes: readonly Readonly<Record<string, unknown>>[],\n delta: string,\n bytes: number,\n entry: TrackedAuthority,\n ): Promise<MutationResult> {\n const prepared: Submission = uploadable(bytes)\n ? await uploaded(head, changes, delta, bytes, entry)\n : { body: { ...head, changes } };\n if ('outcome' in prepared) return prepared.outcome;\n const answer = await transport.door(DOOR_BATCH, prepared.body);\n return mutationOutcome(answer.status, answer.body, entry.locator, entry.handle);\n }\n\n return {\n async authorize() {\n return options.authorize();\n },\n\n async model(_authorization: Authorization, request: ModelRequest): Promise<ModelResult> {\n return models.answer(request);\n },\n\n async discover(_authorization: Authorization): Promise<DiscoverResult> {\n const answer = await transport.door(DOOR_DISCOVER, { prefixes: [...DISCOVER_PREFIXES] });\n const classified = classifyDoor(answer.status, answer.body, PRIVATE_LOCATOR);\n if (classified !== null) return discoveryFailure(classified);\n const document = parseDiscovery(answer.body);\n if (document === null) return { kind: 'transport-uncertainty' };\n const entries = trackedFrom(document);\n tracked.clear();\n for (const entry of entries) tracked.set(entry.locator, entry);\n notifications.track(entries);\n const acquired = await acquireModels(entries);\n models.keep(entries.map((entry) => entry.locator));\n return mapDiscovery(\n document,\n document.authorities.map((authority) => roomOf(authority, acquired)),\n capabilities(document.actions),\n );\n },\n\n async bootstrap(\n _authorization: Authorization,\n request: BootstrapRequest,\n ): Promise<BootstrapResult> {\n const entry = authorityFor(request.locator);\n if (entry === undefined) return { kind: 'room-not-readable', locator: request.locator };\n if (request.pageToken !== undefined) return { kind: 'transport-uncertainty' };\n const answer = await transport.door(DOOR_BOOTSTRAP, {\n prefixes: [...contentPrefixes(entry)],\n });\n const classified = classifyDoor(answer.status, answer.body, entry.locator);\n if (classified !== null) {\n return classified.kind === 'beyond-horizon'\n ? { kind: 'transport-uncertainty' }\n : classified;\n }\n const envelope = parseEnvelope(await bundled(answer.body));\n if (envelope === null) return { kind: 'transport-uncertainty' };\n return bootstrapFrom(envelope, entry);\n },\n\n async refresh(_authorization: Authorization, request: RefreshRequest): Promise<RefreshResult> {\n const entry = authorityFor(request.locator);\n if (entry === undefined) return { kind: 'room-not-readable', locator: request.locator };\n if (request.pageToken !== undefined) return { kind: 'transport-uncertainty' };\n const from = logPosition(request.fromRoomVersion);\n if (from === null) return { kind: 'beyond-horizon' };\n const streamed = notifications.advance(entry, from);\n if (streamed !== null) return streamed;\n const answer = await transport.door(DOOR_ENUMERATE, {\n prefixes: [...contentPrefixes(entry)],\n positions: [presented(entry.authority, from)],\n });\n const classified = classifyDoor(answer.status, answer.body, entry.locator);\n if (classified !== null) return classified;\n const enumeration = parseEnumeration(answer.body, 'credential');\n if (enumeration === null) return { kind: 'transport-uncertainty' };\n return refreshFrom(enumeration, entry, request.fromRoomVersion);\n },\n\n async mutate(_authorization: Authorization, request: MutationRequest): Promise<MutationResult> {\n const entry = authorityFor(request.locator);\n if (entry === undefined) return { kind: 'room-not-readable', locator: request.locator };\n const mapped = houseChanges(request.changeBatch, entry.handle);\n if (mapped.kind === 'unmapped') return rejectedMapping(mapped);\n const head = operationHead(request.changeBatch);\n const delta = deltaBody(mapped.changes);\n const bytes = deltaBytes(delta);\n const resent = submissions.has(head.operation_id);\n let outcome = await submit(head, mapped.changes, delta, bytes, entry);\n if (resent && lapsedGrant(outcome)) {\n submissions.delete(head.operation_id);\n outcome = await submit(head, mapped.changes, delta, bytes, entry);\n }\n if (RESOLVED_OUTCOMES.has(outcome.kind)) submissions.delete(head.operation_id);\n return outcome;\n },\n\n async history(_authorization: Authorization, request: HistoryRequest): Promise<HistoryResult> {\n const entry = authorityFor(request.locator);\n if (entry === undefined) return { kind: 'room-not-readable', locator: request.locator };\n const answer = await transport.door(\n DOOR_REVISIONS,\n revisionBody({\n path: request.path,\n handle: entry.handle,\n ...(request.revision === undefined ? {} : { revision: request.revision }),\n ...(request.pageToken === undefined ? {} : { pageToken: request.pageToken }),\n }),\n );\n return historyOutcome(answer.status, answer.body, entry.locator, {\n path: request.path,\n ...(request.revision === undefined ? {} : { revision: request.revision }),\n });\n },\n\n async action(_authorization: Authorization, request: ActionRequest): Promise<ActionResult> {\n return houseAction(transport, request);\n },\n\n roomVersions: notifications,\n conversations: notifications.conversations,\n };\n}\n"],"names":["DISCOVER_PREFIXES","PROVIDER_SELECTION_MODEL_ROOT","capabilities","discoveredRoom","locatorOf","mapDiscovery","parseDiscovery","providerSelection","trackedFrom","MODEL_ABSENT","failedModel","heldModel","modelKey","modelShelf","createSiteAdapter","authorityRoot","bootstrapFrom","contentPrefixes","definitionsFrom","modelPrefix","parseEnumeration","parseEnvelope","parseGrant","refreshFrom","houseAction","classifyDoor","discoveryFailure","houseNotifications","DOOR_BATCH","DOOR_BATCH_UPLOAD","DOOR_BOOTSTRAP","DOOR_DISCOVER","DOOR_ENUMERATE","DOOR_REVISIONS","PRIVATE_LOCATOR","batchPaths","deltaBody","deltaBytes","deltaDigest","historyOutcome","houseChanges","mutationOutcome","operationHead","rejectedMapping","revisionBody","uploadable","logPosition","presented","UNCERTAIN","kind","RESOLVED_OUTCOMES","Set","lapsedGrant","outcome","code","modelFailure","classified","envelope","createAgentsHouseAdapter","options","site","transport","notifications","tracked","Map","models","submissions","held","entry","modelRoot","identity","failure","acquireModels","entries","acquired","privateEntry","find","locator","prefixes","map","undefined","push","answer","door","status","body","bundled","set","handle","roomOf","authority","key","collection","retain","get","roomHandle","selection","authorityFor","grant","method","transfer","act","url","uploaded","head","changes","delta","bytes","paths","sha256","retained","operation_id","app_ref","release","minted","delivered","operation","holding","upload","submit","prepared","authorize","model","_authorization","request","discover","document","clear","track","keep","authorities","actions","bootstrap","pageToken","refresh","from","fromRoomVersion","streamed","advance","positions","enumeration","mutate","mapped","changeBatch","resent","has","delete","history","path","revision","action","roomVersions","conversations"],"mappings":"AAkB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AuB;YAClE,MAAMxD,QAAQ6B,aAAa2B,QAAQ/C,OAAO;YAC1C,IAAIT,UAAUY,WAAW,OAAO;gBAAE/B,MAAM;gBAAqB4B,SAAS+C,QAAQ/C,OAAO;YAAC;YACtF,MAAMK,SAAS,MAAMrB,UAAUsB,IAAI,CACjClD,gBACAW,aAAa;gBACXwG,MAAMxB,QAAQwB,IAAI;gBAClB5D,QAAQpB,MAAMoB,MAAM;gBACpB,GAAIoC,QAAQyB,QAAQ,KAAKrE,YAAY,CAAC,IAAI;oBAAEqE,UAAUzB,QAAQyB,QAAQ;gBAAC,CAAC;gBACxE,GAAIzB,QAAQS,SAAS,KAAKrD,YAAY,CAAC,IAAI;oBAAEqD,WAAWT,QAAQS,SAAS;gBAAC,CAAC;YAC7E;YAEF,OAAO9F,eAAe2C,OAAOE,MAAM,EAAEF,OAAOG,IAAI,EAAEjB,MAAMS,OAAO,EAAE;gBAC/DuE,MAAMxB,QAAQwB,IAAI;gBAClB,GAAIxB,QAAQyB,QAAQ,KAAKrE,YAAY,CAAC,IAAI;oBAAEqE,UAAUzB,QAAQyB,QAAQ;gBAAC,CAAC;YAC1E;QACF;QAEA,MAAMC,QAAO3B,cAA6B,EAAEC,OAAsB;YAChE,OAAOpG,YAAYqC,WAAW+D;QAChC;QAEA2B,cAAczF;QACd0F,eAAe1F,cAAc0F,aAAa;IAC5C;AACF"}
|
|
1
|
+
{"version":3,"sources":["/workspace/packages/mdruntime-adapter/src/adapter.ts"],"sourcesContent":["import type {\n ActionRequest,\n ActionResult,\n Adapter,\n Authorization,\n BootstrapRequest,\n BootstrapResult,\n DiscoverResult,\n DiscoveredRoom,\n HistoryRequest,\n HistoryResult,\n ModelRequest,\n ModelResult,\n MutationRequest,\n MutationResult,\n RefreshRequest,\n RefreshResult,\n} from '@agentshouse/mdruntime';\nimport {\n DISCOVER_PREFIXES,\n HOUSE_TYPES_ROOT,\n capabilities,\n discoveredRoom,\n locatorOf,\n mapDiscovery,\n parseDiscovery,\n providerSelection,\n trackedFrom,\n type HouseAuthority,\n type TrackedAuthority,\n} from './discovery.js';\nimport {\n MODEL_ABSENT,\n failedModel,\n heldModel,\n modelKey,\n modelShelf,\n type HeldModel,\n} from './model.js';\nimport { createSiteAdapter } from './site.js';\nimport {\n authorityRoot,\n bootstrapFrom,\n contentPrefixes,\n definitionsFrom,\n modelPrefix,\n parseEnumeration,\n parseEnvelope,\n parseGrant,\n refreshFrom,\n} from './read.js';\nimport { houseAction } from './actions.js';\nimport { classifyDoor, discoveryFailure } from './refusal.js';\nimport { houseNotifications } from './stream.js';\nimport {\n DOOR_BATCH,\n DOOR_BATCH_UPLOAD,\n DOOR_BOOTSTRAP,\n DOOR_DISCOVER,\n DOOR_ENUMERATE,\n DOOR_REVISIONS,\n PRIVATE_LOCATOR,\n type HouseSiteTransport,\n type HouseTransport,\n} from './transport.js';\nimport {\n batchPaths,\n deltaBody,\n deltaBytes,\n deltaDigest,\n historyOutcome,\n houseChanges,\n mutationOutcome,\n operationHead,\n rejectedMapping,\n revisionBody,\n uploadable,\n type OperationHead,\n} from './write.js';\nimport { logPosition, presented } from './version.js';\n\nexport type AgentsHouseAdapterOptions =\n | {\n transport: HouseTransport;\n authorize(): Promise<Authorization>;\n }\n | { site: HouseSiteTransport };\n\nconst UNCERTAIN: MutationResult = { kind: 'transport-uncertainty' };\n\nconst RESOLVED_OUTCOMES: ReadonlySet<MutationResult['kind']> = new Set([\n 'accepted',\n 'conflicted',\n 'rejected',\n 'expired',\n]);\n\ntype Submission = { body: Record<string, unknown> } | { outcome: MutationResult };\n\nfunction lapsedGrant(outcome: MutationResult): boolean {\n return outcome.kind === 'rejected' && outcome.code === 'upload_unavailable';\n}\n\nfunction modelFailure(\n classified: ReturnType<typeof classifyDoor>,\n envelope: ReturnType<typeof parseEnvelope>,\n): ModelResult {\n if (classified === null) {\n return envelope === null ? { kind: 'transport-uncertainty' } : MODEL_ABSENT;\n }\n return failedModel(classified);\n}\n\nexport function createAgentsHouseAdapter(options: AgentsHouseAdapterOptions): Adapter {\n if ('site' in options) return createSiteAdapter(options.site);\n const transport = options.transport;\n const notifications = houseNotifications(transport, 'credential');\n const tracked = new Map<string, TrackedAuthority>();\n const models = modelShelf();\n const submissions = new Map<string, { sha256: string; body: Record<string, unknown> }>();\n\n function held(\n envelope: ReturnType<typeof parseEnvelope>,\n entry: TrackedAuthority,\n modelRoot: string,\n identity: string,\n failure: ModelResult,\n ): Promise<HeldModel> {\n return heldModel(\n envelope === null ? null : definitionsFrom(envelope, entry, modelRoot),\n identity,\n failure,\n );\n }\n\n async function acquireModels(\n entries: readonly TrackedAuthority[],\n ): Promise<Map<string, HeldModel>> {\n const acquired = new Map<string, HeldModel>();\n const privateEntry = entries.find((entry) => entry.locator === PRIVATE_LOCATOR);\n const prefixes = entries.map((entry) => modelPrefix(entry, entry.modelRoot));\n if (privateEntry !== undefined) {\n prefixes.push(`${authorityRoot(undefined)}/${HOUSE_TYPES_ROOT}`);\n }\n const answer = await transport.door(DOOR_BOOTSTRAP, { prefixes });\n const classified = classifyDoor(answer.status, answer.body, PRIVATE_LOCATOR);\n const envelope = classified === null ? parseEnvelope(await bundled(answer.body)) : null;\n const failure: ModelResult = modelFailure(classified, envelope);\n for (const entry of entries) {\n acquired.set(\n modelKey(entry.locator, 'collection'),\n await held(\n envelope,\n entry,\n entry.modelRoot,\n `${authorityRoot(entry.handle)}/${entry.modelRoot}`,\n failure,\n ),\n );\n }\n if (privateEntry !== undefined) {\n acquired.set(\n modelKey(privateEntry.locator, 'typed-selection'),\n await held(\n envelope,\n privateEntry,\n HOUSE_TYPES_ROOT,\n `${authorityRoot(undefined)}/${HOUSE_TYPES_ROOT}`,\n failure,\n ),\n );\n }\n return acquired;\n }\n\n function roomOf(authority: HouseAuthority, acquired: Map<string, HeldModel>): DiscoveredRoom {\n const locator = locatorOf(authority);\n const key = modelKey(locator, 'collection');\n const collection = models.retain(key, acquired.get(key));\n if (authority.roomHandle !== null) {\n return discoveredRoom(authority, collection?.identity ?? null, undefined);\n }\n const selection = models.retain(\n modelKey(locator, 'typed-selection'),\n acquired.get(modelKey(locator, 'typed-selection')),\n );\n return discoveredRoom(\n authority,\n collection?.identity ?? null,\n providerSelection(selection?.identity ?? null),\n );\n }\n\n function authorityFor(locator: string): TrackedAuthority | undefined {\n return tracked.get(locator);\n }\n\n async function bundled(body: unknown): Promise<unknown> {\n const grant = parseGrant(body);\n if (grant === null) return body;\n if (grant.method !== 'GET') return null;\n const answer = await transport.transfer({\n act: 'working_copy_bundle',\n method: 'GET',\n url: grant.url,\n });\n return answer.status === 200 ? answer.body : null;\n }\n\n async function uploaded(\n head: OperationHead,\n changes: readonly Readonly<Record<string, unknown>>[],\n delta: string,\n bytes: number,\n entry: TrackedAuthority,\n ): Promise<Submission> {\n const paths = batchPaths(changes);\n const sha256 = await deltaDigest(delta);\n const retained = submissions.get(head.operation_id);\n if (\n retained !== undefined &&\n retained.sha256 === sha256 &&\n retained.body.app_ref === head.app_ref &&\n retained.body.release === head.release\n )\n return { body: retained.body };\n const minted = await transport.door(DOOR_BATCH_UPLOAD, { ...head, paths, bytes, sha256 });\n if (minted.status !== 200) {\n return { outcome: mutationOutcome(minted.status, minted.body, entry.locator, entry.handle) };\n }\n const grant = parseGrant(minted.body);\n if (grant === null || grant.method !== 'POST') return { outcome: UNCERTAIN };\n const delivered = await transport.transfer({\n act: 'authored_batch_upload',\n method: 'POST',\n url: grant.url,\n body: `${grant.operation}\\n${delta}`,\n });\n if (delivered.status !== 200) return { outcome: UNCERTAIN };\n const holding = parseGrant(delivered.body);\n if (holding === null) return { outcome: UNCERTAIN };\n const body = {\n ...head,\n paths,\n upload: { url: holding.url, operation: holding.operation, bytes, sha256 },\n };\n submissions.set(head.operation_id, { sha256, body });\n return { body };\n }\n\n async function submit(\n head: OperationHead,\n changes: readonly Readonly<Record<string, unknown>>[],\n delta: string,\n bytes: number,\n entry: TrackedAuthority,\n ): Promise<MutationResult> {\n const prepared: Submission = uploadable(bytes)\n ? await uploaded(head, changes, delta, bytes, entry)\n : { body: { ...head, changes } };\n if ('outcome' in prepared) return prepared.outcome;\n const answer = await transport.door(DOOR_BATCH, prepared.body);\n return mutationOutcome(answer.status, answer.body, entry.locator, entry.handle);\n }\n\n return {\n async authorize() {\n return options.authorize();\n },\n\n async model(_authorization: Authorization, request: ModelRequest): Promise<ModelResult> {\n return models.answer(request);\n },\n\n async discover(_authorization: Authorization): Promise<DiscoverResult> {\n const answer = await transport.door(DOOR_DISCOVER, { prefixes: [...DISCOVER_PREFIXES] });\n const classified = classifyDoor(answer.status, answer.body, PRIVATE_LOCATOR);\n if (classified !== null) return discoveryFailure(classified);\n const document = parseDiscovery(answer.body);\n if (document === null) return { kind: 'transport-uncertainty' };\n const entries = trackedFrom(document);\n tracked.clear();\n for (const entry of entries) tracked.set(entry.locator, entry);\n notifications.track(entries);\n const acquired = await acquireModels(entries);\n models.keep(entries.map((entry) => entry.locator));\n return mapDiscovery(\n document,\n document.authorities.map((authority) => roomOf(authority, acquired)),\n capabilities(document.actions),\n );\n },\n\n async bootstrap(\n _authorization: Authorization,\n request: BootstrapRequest,\n ): Promise<BootstrapResult> {\n const entry = authorityFor(request.locator);\n if (entry === undefined) return { kind: 'room-not-readable', locator: request.locator };\n if (request.pageToken !== undefined) return { kind: 'transport-uncertainty' };\n const answer = await transport.door(DOOR_BOOTSTRAP, {\n prefixes: [...contentPrefixes(entry)],\n });\n const classified = classifyDoor(answer.status, answer.body, entry.locator);\n if (classified !== null) {\n return classified.kind === 'beyond-horizon'\n ? { kind: 'transport-uncertainty' }\n : classified;\n }\n const envelope = parseEnvelope(await bundled(answer.body));\n if (envelope === null) return { kind: 'transport-uncertainty' };\n return bootstrapFrom(envelope, entry);\n },\n\n async refresh(_authorization: Authorization, request: RefreshRequest): Promise<RefreshResult> {\n const entry = authorityFor(request.locator);\n if (entry === undefined) return { kind: 'room-not-readable', locator: request.locator };\n if (request.pageToken !== undefined) return { kind: 'transport-uncertainty' };\n const from = logPosition(request.fromRoomVersion);\n if (from === null) return { kind: 'beyond-horizon' };\n const streamed = notifications.advance(entry, from);\n if (streamed !== null) return streamed;\n const answer = await transport.door(DOOR_ENUMERATE, {\n prefixes: [...contentPrefixes(entry)],\n positions: [presented(entry.authority, from)],\n });\n const classified = classifyDoor(answer.status, answer.body, entry.locator);\n if (classified !== null) return classified;\n const enumeration = parseEnumeration(answer.body, 'credential');\n if (enumeration === null) return { kind: 'transport-uncertainty' };\n return refreshFrom(enumeration, entry, request.fromRoomVersion);\n },\n\n async mutate(_authorization: Authorization, request: MutationRequest): Promise<MutationResult> {\n const entry = authorityFor(request.locator);\n if (entry === undefined) return { kind: 'room-not-readable', locator: request.locator };\n const mapped = houseChanges(request.changeBatch, entry.handle);\n if (mapped.kind === 'unmapped') return rejectedMapping(mapped);\n const head = operationHead(request.changeBatch);\n const delta = deltaBody(mapped.changes);\n const bytes = deltaBytes(delta);\n const resent = submissions.has(head.operation_id);\n let outcome = await submit(head, mapped.changes, delta, bytes, entry);\n if (resent && lapsedGrant(outcome)) {\n submissions.delete(head.operation_id);\n outcome = await submit(head, mapped.changes, delta, bytes, entry);\n }\n if (RESOLVED_OUTCOMES.has(outcome.kind)) submissions.delete(head.operation_id);\n return outcome;\n },\n\n async history(_authorization: Authorization, request: HistoryRequest): Promise<HistoryResult> {\n const entry = authorityFor(request.locator);\n if (entry === undefined) return { kind: 'room-not-readable', locator: request.locator };\n const answer = await transport.door(\n DOOR_REVISIONS,\n revisionBody({\n path: request.path,\n handle: entry.handle,\n ...(request.revision === undefined ? {} : { revision: request.revision }),\n ...(request.pageToken === undefined ? {} : { pageToken: request.pageToken }),\n }),\n );\n return historyOutcome(answer.status, answer.body, entry.locator, {\n path: request.path,\n ...(request.revision === undefined ? {} : { revision: request.revision }),\n });\n },\n\n async action(_authorization: Authorization, request: ActionRequest): Promise<ActionResult> {\n return houseAction(transport, request);\n },\n\n roomVersions: notifications,\n conversations: notifications.conversations,\n };\n}\n"],"names":["DISCOVER_PREFIXES","HOUSE_TYPES_ROOT","capabilities","discoveredRoom","locatorOf","mapDiscovery","parseDiscovery","providerSelection","trackedFrom","MODEL_ABSENT","failedModel","heldModel","modelKey","modelShelf","createSiteAdapter","authorityRoot","bootstrapFrom","contentPrefixes","definitionsFrom","modelPrefix","parseEnumeration","parseEnvelope","parseGrant","refreshFrom","houseAction","classifyDoor","discoveryFailure","houseNotifications","DOOR_BATCH","DOOR_BATCH_UPLOAD","DOOR_BOOTSTRAP","DOOR_DISCOVER","DOOR_ENUMERATE","DOOR_REVISIONS","PRIVATE_LOCATOR","batchPaths","deltaBody","deltaBytes","deltaDigest","historyOutcome","houseChanges","mutationOutcome","operationHead","rejectedMapping","revisionBody","uploadable","logPosition","presented","UNCERTAIN","kind","RESOLVED_OUTCOMES","Set","lapsedGrant","outcome","code","modelFailure","classified","envelope","createAgentsHouseAdapter","options","site","transport","notifications","tracked","Map","models","submissions","held","entry","modelRoot","identity","failure","acquireModels","entries","acquired","privateEntry","find","locator","prefixes","map","undefined","push","answer","door","status","body","bundled","set","handle","roomOf","authority","key","collection","retain","get","roomHandle","selection","authorityFor","grant","method","transfer","act","url","uploaded","head","changes","delta","bytes","paths","sha256","retained","operation_id","app_ref","release","minted","delivered","operation","holding","upload","submit","prepared","authorize","model","_authorization","request","discover","document","clear","track","keep","authorities","actions","bootstrap","pageToken","refresh","from","fromRoomVersion","streamed","advance","positions","enumeration","mutate","mapped","changeBatch","resent","has","delete","history","path","revision","action","roomVersions","conversations"],"mappings":"AAkBA,SACEA,iBAAiB,EACjBC,gBAAgB,EAChBC,YAAY,EACZC,cAAc,EACdC,SAAS,EACTC,YAAY,EACZC,cAAc,EACdC,iBAAiB,EACjBC,WAAW,QAGN,iBAAiB;AACxB,SACEC,YAAY,EACZC,WAAW,EACXC,SAAS,EACTC,QAAQ,EACRC,UAAU,QAEL,aAAa;AACpB,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SACEC,aAAa,EACbC,aAAa,EACbC,eAAe,EACfC,eAAe,EACfC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Y,CAAC,IAAI;oBAAEqE,UAAUzB,QAAQyB,QAAQ;gBAAC,CAAC;gBACxE,GAAIzB,QAAQS,SAAS,KAAKrD,YAAY,CAAC,IAAI;oBAAEqD,WAAWT,QAAQS,SAAS;gBAAC,CAAC;YAC7E;YAEF,OAAO9F,eAAe2C,OAAOE,MAAM,EAAEF,OAAOG,IAAI,EAAEjB,MAAMS,OAAO,EAAE;gBAC/DuE,MAAMxB,QAAQwB,IAAI;gBAClB,GAAIxB,QAAQyB,QAAQ,KAAKrE,YAAY,CAAC,IAAI;oBAAEqE,UAAUzB,QAAQyB,QAAQ;gBAAC,CAAC;YAC1E;QACF;QAEA,MAAMC,QAAO3B,cAA6B,EAAEC,OAAsB;YAChE,OAAOpG,YAAYqC,WAAW+D;QAChC;QAEA2B,cAAczF;QACd0F,eAAe1F,cAAc0F,aAAa;IAC5C;AACF"}
|
package/dist/discovery.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const PROVIDER_ACTIONS = "provider-actions";
|
|
|
7
7
|
export declare const MOVE_REFERENCE_REWRITES = "move-reference-rewrites";
|
|
8
8
|
export declare const DISCOVER_PREFIXES: readonly string[];
|
|
9
9
|
export declare const PROVIDER_SELECTION_ROOTS: readonly string[];
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const HOUSE_TYPES_ROOT = "house/types";
|
|
11
11
|
export type HouseBounds = {
|
|
12
12
|
max_authored_file_bytes: number;
|
|
13
13
|
max_batch_operations: number;
|
package/dist/discovery.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,SAAS,EACT,aAAa,EACb,SAAS,EACT,cAAc,EACf,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAA6B,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3E,eAAO,MAAM,qBAAqB,IAAI,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c,CAC5B,SAAS,EAAE,cAAc,EACzB,aAAa,EAAE,cAAc,CAAC,eAAe,CAAC,EAC9C,cAAc,EAAE,cAAc,GAAG,SAAS,GACzC,cAAc,CAiBhB;AAED,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,IAAI,CAAC,sBAAsB,EAAE,QAAQ,GAAG,gBAAgB,CAAC,EACnE,KAAK,EAAE,SAAS,cAAc,EAAE,EAChC,QAAQ,EAAE,SAAS,UAAU,EAAE,GAC9B,SAAS,CAUX"}
|
package/dist/discovery.js
CHANGED
|
@@ -11,9 +11,10 @@ export const DISCOVER_PREFIXES = [
|
|
|
11
11
|
];
|
|
12
12
|
export const PROVIDER_SELECTION_ROOTS = [
|
|
13
13
|
'agents',
|
|
14
|
-
'house'
|
|
14
|
+
'house',
|
|
15
|
+
'settings/apps'
|
|
15
16
|
];
|
|
16
|
-
export const
|
|
17
|
+
export const HOUSE_TYPES_ROOT = 'house/types';
|
|
17
18
|
const BOUND_KEYS = [
|
|
18
19
|
'max_authored_file_bytes',
|
|
19
20
|
'max_batch_operations',
|
|
@@ -209,7 +210,7 @@ export function trackedFrom(document) {
|
|
|
209
210
|
modelRoot: authority.modelRoot,
|
|
210
211
|
modelRoots: authority.roomHandle === null ? [
|
|
211
212
|
authority.modelRoot,
|
|
212
|
-
|
|
213
|
+
HOUSE_TYPES_ROOT
|
|
213
214
|
] : [
|
|
214
215
|
authority.modelRoot
|
|
215
216
|
],
|
package/dist/discovery.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/workspace/packages/mdruntime-adapter/src/discovery.ts"],"sourcesContent":["import type {\n Capability,\n DiscoveredRoom,\n Discovery,\n ProviderLimit,\n Retention,\n TypedSelection,\n} from '@agentshouse/mdruntime';\nimport { declaredActions, HOUSE_CONVERSATION_CARDS } from './actions.js';\nimport { PRIVATE_LOCATOR } from './transport.js';\nimport { readPosition, roomVersion, type LogPosition } from './version.js';\n\nexport const ROOM_CONTRACT_VERSION = 1;\n\nexport const MD_MODEL_IDENTITY = '@agentshouse/mdmodel';\n\nexport const ROOM_VERSION_NOTIFICATIONS = 'room-version-notifications';\n\nexport const PROVIDER_ACTIONS = 'provider-actions';\n\nexport const MOVE_REFERENCE_REWRITES = 'move-reference-rewrites';\n\nexport const DISCOVER_PREFIXES: readonly string[] = ['/'];\n\nexport const PROVIDER_SELECTION_ROOTS: readonly string[] = ['agents', 'house'];\n\nexport const PROVIDER_SELECTION_MODEL_ROOT = 'house/settings/model';\n\nexport type HouseBounds = {\n max_authored_file_bytes: number;\n max_batch_operations: number;\n max_path_length: number;\n max_path_depth: number;\n max_mount_files: number;\n max_mount_bytes: number;\n change_retention_seconds: number;\n operation_retention_seconds: number;\n};\n\nexport type HouseOperations = {\n read: readonly string[];\n sync: readonly string[];\n write: readonly string[];\n delete: readonly string[];\n};\n\nexport type HouseAuthority = LogPosition & {\n roomRef: string;\n roomHandle: string | null;\n name: string;\n collectionRoot: string;\n modelRoot: string;\n managedReplication: 'admitted' | 'unavailable';\n protectedPaths: readonly string[];\n operations: HouseOperations;\n};\n\nexport type HouseDiscoveryDocument = {\n bounds: HouseBounds;\n mdModelVersion: string;\n authorities: readonly HouseAuthority[];\n actions: readonly string[];\n};\n\nexport type TrackedAuthority = LogPosition & {\n locator: string;\n authority: string;\n handle: string | undefined;\n collectionRoot: string;\n modelRoot: string;\n modelRoots: readonly string[];\n};\n\nexport type HouseSiteEntry = {\n roomRef: string;\n segment: string;\n};\n\nexport type HouseSiteSlot = {\n slot: string;\n entries: readonly HouseSiteEntry[];\n};\n\nexport type HouseSiteAuthority = LogPosition & {\n roomRef: string;\n roomHandle: string;\n collectionRoot: string;\n modelRoot: string;\n};\n\nexport type HouseSiteDiscovery = {\n bounds: HouseBounds;\n mdModelVersion: string;\n slots: readonly HouseSiteSlot[];\n authorities: readonly HouseSiteAuthority[];\n};\n\nexport type SiteTracked = TrackedAuthority & { handle: string };\n\nconst BOUND_KEYS: readonly (keyof HouseBounds)[] = [\n 'max_authored_file_bytes',\n 'max_batch_operations',\n 'max_path_length',\n 'max_path_depth',\n 'max_mount_files',\n 'max_mount_bytes',\n 'change_retention_seconds',\n 'operation_retention_seconds',\n];\n\nconst OPERATION_KEYS: readonly (keyof HouseOperations)[] = ['read', 'sync', 'write', 'delete'];\n\nfunction stringList(value: unknown): readonly string[] | null {\n if (!Array.isArray(value)) return null;\n return value.every((entry) => typeof entry === 'string') ? (value as string[]) : null;\n}\n\nfunction parseBounds(value: unknown): HouseBounds | null {\n if (typeof value !== 'object' || value === null) return null;\n const held = value as Record<string, unknown>;\n const bounds: Partial<HouseBounds> = {};\n for (const key of BOUND_KEYS) {\n const amount = held[key];\n if (typeof amount !== 'number' || !Number.isFinite(amount)) return null;\n bounds[key] = amount;\n }\n return bounds as HouseBounds;\n}\n\nfunction parseOperations(value: unknown): HouseOperations | null {\n if (typeof value !== 'object' || value === null) return null;\n const held = value as Record<string, unknown>;\n const operations: Partial<Record<keyof HouseOperations, readonly string[]>> = {};\n for (const key of OPERATION_KEYS) {\n const scopes = stringList(held[key]);\n if (scopes === null) return null;\n operations[key] = scopes;\n }\n return operations as HouseOperations;\n}\n\nfunction parseAuthority(value: unknown): HouseAuthority | null {\n if (typeof value !== 'object' || value === null) return null;\n const held = value as Record<string, unknown>;\n if (held.kind !== 'room') return null;\n if (typeof held.name !== 'string' || held.name.length === 0) return null;\n if (typeof held.collection_root !== 'string' || typeof held.model_root !== 'string') return null;\n if (held.managed_replication !== 'admitted' && held.managed_replication !== 'unavailable') {\n return null;\n }\n const at = readPosition(held);\n const protectedPaths = stringList(held.protected_paths);\n const operations = parseOperations(held.operations);\n if (at === null || protectedPaths === null || operations === null) return null;\n if (typeof held.room_ref !== 'string' || held.room_ref.length === 0) return null;\n if (\n held.room_handle !== null &&\n (typeof held.room_handle !== 'string' || held.room_handle.length === 0)\n )\n return null;\n return {\n roomRef: held.room_ref,\n roomHandle: held.room_handle,\n name: held.name,\n collectionRoot: held.collection_root,\n modelRoot: held.model_root,\n managedReplication: held.managed_replication,\n protectedPaths,\n operations,\n ...at,\n };\n}\n\nexport function parseDiscovery(body: unknown): HouseDiscoveryDocument | null {\n if (typeof body !== 'object' || body === null) return null;\n const held = body as Record<string, unknown>;\n const bounds = parseBounds(held.bounds);\n if (bounds === null) return null;\n if (typeof held.md_model_version !== 'string' || held.md_model_version.length === 0) return null;\n const actions = stringList(held.actions);\n if (\n actions === null ||\n new Set(actions).size !== actions.length ||\n actions.some((name) => name.length === 0)\n )\n return null;\n if (!Array.isArray(held.authorities)) return null;\n const authorities: HouseAuthority[] = [];\n for (const entry of held.authorities) {\n const authority = parseAuthority(entry);\n if (authority === null) return null;\n authorities.push(authority);\n }\n return { bounds, mdModelVersion: held.md_model_version, authorities, actions };\n}\n\nfunction parseSiteEntry(value: unknown): HouseSiteEntry | null {\n if (typeof value !== 'object' || value === null) return null;\n const held = value as Record<string, unknown>;\n if (typeof held.room_ref !== 'string' || held.room_ref.length === 0) return null;\n if (typeof held.segment !== 'string' || held.segment.length === 0) return null;\n return { roomRef: held.room_ref, segment: held.segment };\n}\n\nfunction parseSiteSlot(value: unknown): HouseSiteSlot | null {\n if (typeof value !== 'object' || value === null) return null;\n const held = value as Record<string, unknown>;\n if (typeof held.slot !== 'string' || held.slot.length === 0) return null;\n if (!Array.isArray(held.entries)) return null;\n const entries: HouseSiteEntry[] = [];\n for (const entry of held.entries) {\n const parsed = parseSiteEntry(entry);\n if (parsed === null) return null;\n entries.push(parsed);\n }\n return { slot: held.slot, entries };\n}\n\nfunction parseSiteAuthority(value: unknown): HouseSiteAuthority | null {\n if (typeof value !== 'object' || value === null) return null;\n const held = value as Record<string, unknown>;\n if (held.kind !== 'room') return null;\n if (typeof held.room_ref !== 'string' || held.room_ref.length === 0) return null;\n if (typeof held.room_handle !== 'string' || held.room_handle.length === 0) return null;\n if (typeof held.collection_root !== 'string' || typeof held.model_root !== 'string') return null;\n const at = readPosition(held);\n if (at === null) return null;\n return {\n roomRef: held.room_ref,\n roomHandle: held.room_handle,\n collectionRoot: held.collection_root,\n modelRoot: held.model_root,\n ...at,\n };\n}\n\nexport function parseSiteDiscovery(body: unknown): HouseSiteDiscovery | null {\n if (typeof body !== 'object' || body === null) return null;\n const held = body as Record<string, unknown>;\n const bounds = parseBounds(held.bounds);\n if (bounds === null) return null;\n if (typeof held.md_model_version !== 'string' || held.md_model_version.length === 0) return null;\n if (!Array.isArray(held.slots) || !Array.isArray(held.authorities)) return null;\n const slots: HouseSiteSlot[] = [];\n for (const entry of held.slots) {\n const slot = parseSiteSlot(entry);\n if (slot === null) return null;\n slots.push(slot);\n }\n const authorities: HouseSiteAuthority[] = [];\n for (const entry of held.authorities) {\n const authority = parseSiteAuthority(entry);\n if (authority === null) return null;\n authorities.push(authority);\n }\n return { bounds, mdModelVersion: held.md_model_version, slots, authorities };\n}\n\nexport function siteTracked(document: HouseSiteDiscovery): SiteTracked[] {\n return document.authorities.map((authority) => ({\n locator: authority.roomRef,\n authority: authority.roomRef,\n handle: authority.roomHandle,\n collectionRoot: authority.collectionRoot,\n modelRoot: authority.modelRoot,\n modelRoots: [authority.modelRoot],\n position: authority.position,\n logEpoch: authority.logEpoch,\n }));\n}\n\nexport function siteSlots(document: HouseSiteDiscovery): Discovery['slots'] {\n return document.slots.map(({ slot, entries }) => ({\n slot,\n entries: entries.map(({ roomRef, segment }) => ({ locator: roomRef, segment })),\n }));\n}\n\nexport function locatorOf(authority: HouseAuthority): string {\n return authority.roomHandle ?? PRIVATE_LOCATOR;\n}\n\nexport function trackedFrom(document: HouseDiscoveryDocument): TrackedAuthority[] {\n return document.authorities.map((authority) => ({\n locator: locatorOf(authority),\n authority: authority.roomRef,\n handle: authority.roomHandle ?? undefined,\n collectionRoot: authority.collectionRoot,\n modelRoot: authority.modelRoot,\n modelRoots:\n authority.roomHandle === null\n ? [authority.modelRoot, PROVIDER_SELECTION_MODEL_ROOT]\n : [authority.modelRoot],\n position: authority.position,\n logEpoch: authority.logEpoch,\n }));\n}\n\nexport function providerLimits(bounds: HouseBounds): readonly ProviderLimit[] {\n return [\n { name: 'document-size', value: bounds.max_authored_file_bytes },\n { name: 'change-batch-operations', value: bounds.max_batch_operations },\n { name: 'path-length', value: bounds.max_path_length },\n { name: 'path-depth', value: bounds.max_path_depth },\n { name: 'write-rate' },\n { name: 'content-ceiling' },\n ];\n}\n\nexport function declaredRetention(bounds: HouseBounds): Retention {\n return {\n history: { kind: 'no-declared-time-bound' },\n outcome: bounds.operation_retention_seconds,\n refreshHorizon: bounds.change_retention_seconds,\n };\n}\n\nexport function capabilities(actions: readonly string[]): readonly Capability[] {\n return [\n { name: ROOM_VERSION_NOTIFICATIONS },\n {\n name: PROVIDER_ACTIONS,\n actions: declaredActions(actions),\n conversationCards: HOUSE_CONVERSATION_CARDS,\n },\n { name: MOVE_REFERENCE_REWRITES },\n ];\n}\n\nexport function siteCapabilities(): readonly Capability[] {\n return [\n { name: ROOM_VERSION_NOTIFICATIONS },\n { name: PROVIDER_ACTIONS, actions: [{ name: 'submit', inputShape: {}, resultKind: 'house' }] },\n ];\n}\n\nexport function providerSelection(attachedModel: TypedSelection['attachedModel']): TypedSelection {\n return { roots: [...PROVIDER_SELECTION_ROOTS], attachedModel };\n}\n\nexport function discoveredRoom(\n authority: HouseAuthority,\n attachedModel: DiscoveredRoom['attachedModel'],\n typedSelection: TypedSelection | undefined,\n): DiscoveredRoom {\n return {\n name: authority.name,\n locator: locatorOf(authority),\n collectionRoot: authority.collectionRoot,\n roomVersion: roomVersion(authority),\n operations: {\n read: [...authority.operations.read],\n sync: [...authority.operations.sync],\n write: [...authority.operations.write],\n delete: [...authority.operations.delete],\n },\n replica: { selection: locatorOf(authority), admission: authority.managedReplication },\n attachedModel,\n ...(typedSelection === undefined ? {} : { typedSelection }),\n providerOwnedPaths: [...authority.protectedPaths],\n };\n}\n\nexport function mapDiscovery(\n document: Pick<HouseDiscoveryDocument, 'bounds' | 'mdModelVersion'>,\n rooms: readonly DiscoveredRoom[],\n declared: readonly Capability[],\n): Discovery {\n return {\n kind: 'discovery',\n supportedVersions: [ROOM_CONTRACT_VERSION],\n mdModel: { identity: MD_MODEL_IDENTITY, version: document.mdModelVersion },\n rooms,\n capabilities: declared,\n providerLimits: providerLimits(document.bounds),\n retention: declaredRetention(document.bounds),\n };\n}\n"],"names":["declaredActions","HOUSE_CONVERSATION_CARDS","PRIVATE_LOCATOR","readPosition","roomVersion","ROOM_CONTRACT_VERSION","MD_MODEL_IDENTITY","ROOM_VERSION_NOTIFICATIONS","PROVIDER_ACTIONS","MOVE_REFERENCE_REWRITES","DISCOVER_PREFIXES","PROVIDER_SELECTION_ROOTS","PROVIDER_SELECTION_MODEL_ROOT","BOUND_KEYS","OPERATION_KEYS","stringList","value","Array","isArray","every","entry","parseBounds","held","bounds","key","amount","Number","isFinite","parseOperations","operations","scopes","parseAuthority","kind","name","length","collection_root","model_root","managed_replication","at","protectedPaths","protected_paths","room_ref","room_handle","roomRef","roomHandle","collectionRoot","modelRoot","managedReplication","parseDiscovery","body","md_model_version","actions","Set","size","some","authorities","authority","push","mdModelVersion","parseSiteEntry","segment","parseSiteSlot","slot","entries","parsed","parseSiteAuthority","parseSiteDiscovery","slots","siteTracked","document","map","locator","handle","modelRoots","position","logEpoch","siteSlots","locatorOf","trackedFrom","undefined","providerLimits","max_authored_file_bytes","max_batch_operations","max_path_length","max_path_depth","declaredRetention","history","outcome","operation_retention_seconds","refreshHorizon","change_retention_seconds","capabilities","conversationCards","siteCapabilities","inputShape","resultKind","providerSelection","attachedModel","roots","discoveredRoom","typedSelection","read","sync","write","delete","replica","selection","admission","providerOwnedPaths","mapDiscovery","rooms","declared","supportedVersions","mdModel","identity","version","retention"],"mappings":"AAQA,SAASA,eAAe,EAAEC,wBAAwB,QAAQ,eAAe;AACzE,SAASC,eAAe,QAAQ,iBAAiB;AACjD,SAASC,YAAY,EAAEC,WAAW,QAA0B,eAAe;AAE3E,OAAO,MAAMC,wBAAwB,EAAE;AAEvC,OAAO,MAAMC,oBAA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O;eAAIvF;SAAyB;QAAEsF;IAAc;AAC/D;AAEA,OAAO,SAASE,eACd3C,SAAyB,EACzByC,aAA8C,EAC9CG,cAA0C;IAE1C,OAAO;QACLnE,MAAMuB,UAAUvB,IAAI;QACpBsC,SAASM,UAAUrB;QACnBX,gBAAgBW,UAAUX,cAAc;QACxCzC,aAAaA,YAAYoD;QACzB3B,YAAY;YACVwE,MAAM;mBAAI7C,UAAU3B,UAAU,CAACwE,IAAI;aAAC;YACpCC,MAAM;mBAAI9C,UAAU3B,UAAU,CAACyE,IAAI;aAAC;YACpCC,OAAO;mBAAI/C,UAAU3B,UAAU,CAAC0E,KAAK;aAAC;YACtCC,QAAQ;mBAAIhD,UAAU3B,UAAU,CAAC2E,MAAM;aAAC;QAC1C;QACAC,SAAS;YAAEC,WAAW7B,UAAUrB;YAAYmD,WAAWnD,UAAUT,kBAAkB;QAAC;QACpFkD;QACA,GAAIG,mBAAmBrB,YAAY,CAAC,IAAI;YAAEqB;QAAe,CAAC;QAC1DQ,oBAAoB;eAAIpD,UAAUjB,cAAc;SAAC;IACnD;AACF;AAEA,OAAO,SAASsE,aACdxC,QAAmE,EACnEyC,KAAgC,EAChCC,QAA+B;IAE/B,OAAO;QACL/E,MAAM;QACNgF,mBAAmB;YAAC3G;SAAsB;QAC1C4G,SAAS;YAAEC,UAAU5G;YAAmB6G,SAAS9C,SAASX,cAAc;QAAC;QACzEoD;QACAnB,cAAcoB;QACd/B,gBAAgBA,eAAeX,SAAS9C,MAAM;QAC9C6F,WAAW/B,kBAAkBhB,SAAS9C,MAAM;IAC9C;AACF"}
|
|
1
|
+
{"version":3,"sources":["/workspace/packages/mdruntime-adapter/src/discovery.ts"],"sourcesContent":["import type {\n Capability,\n DiscoveredRoom,\n Discovery,\n ProviderLimit,\n Retention,\n TypedSelection,\n} from '@agentshouse/mdruntime';\nimport { declaredActions, HOUSE_CONVERSATION_CARDS } from './actions.js';\nimport { PRIVATE_LOCATOR } from './transport.js';\nimport { readPosition, roomVersion, type LogPosition } from './version.js';\n\nexport const ROOM_CONTRACT_VERSION = 1;\n\nexport const MD_MODEL_IDENTITY = '@agentshouse/mdmodel';\n\nexport const ROOM_VERSION_NOTIFICATIONS = 'room-version-notifications';\n\nexport const PROVIDER_ACTIONS = 'provider-actions';\n\nexport const MOVE_REFERENCE_REWRITES = 'move-reference-rewrites';\n\nexport const DISCOVER_PREFIXES: readonly string[] = ['/'];\n\nexport const PROVIDER_SELECTION_ROOTS: readonly string[] = ['agents', 'house', 'settings/apps'];\n\nexport const HOUSE_TYPES_ROOT = 'house/types';\n\nexport type HouseBounds = {\n max_authored_file_bytes: number;\n max_batch_operations: number;\n max_path_length: number;\n max_path_depth: number;\n max_mount_files: number;\n max_mount_bytes: number;\n change_retention_seconds: number;\n operation_retention_seconds: number;\n};\n\nexport type HouseOperations = {\n read: readonly string[];\n sync: readonly string[];\n write: readonly string[];\n delete: readonly string[];\n};\n\nexport type HouseAuthority = LogPosition & {\n roomRef: string;\n roomHandle: string | null;\n name: string;\n collectionRoot: string;\n modelRoot: string;\n managedReplication: 'admitted' | 'unavailable';\n protectedPaths: readonly string[];\n operations: HouseOperations;\n};\n\nexport type HouseDiscoveryDocument = {\n bounds: HouseBounds;\n mdModelVersion: string;\n authorities: readonly HouseAuthority[];\n actions: readonly string[];\n};\n\nexport type TrackedAuthority = LogPosition & {\n locator: string;\n authority: string;\n handle: string | undefined;\n collectionRoot: string;\n modelRoot: string;\n modelRoots: readonly string[];\n};\n\nexport type HouseSiteEntry = {\n roomRef: string;\n segment: string;\n};\n\nexport type HouseSiteSlot = {\n slot: string;\n entries: readonly HouseSiteEntry[];\n};\n\nexport type HouseSiteAuthority = LogPosition & {\n roomRef: string;\n roomHandle: string;\n collectionRoot: string;\n modelRoot: string;\n};\n\nexport type HouseSiteDiscovery = {\n bounds: HouseBounds;\n mdModelVersion: string;\n slots: readonly HouseSiteSlot[];\n authorities: readonly HouseSiteAuthority[];\n};\n\nexport type SiteTracked = TrackedAuthority & { handle: string };\n\nconst BOUND_KEYS: readonly (keyof HouseBounds)[] = [\n 'max_authored_file_bytes',\n 'max_batch_operations',\n 'max_path_length',\n 'max_path_depth',\n 'max_mount_files',\n 'max_mount_bytes',\n 'change_retention_seconds',\n 'operation_retention_seconds',\n];\n\nconst OPERATION_KEYS: readonly (keyof HouseOperations)[] = ['read', 'sync', 'write', 'delete'];\n\nfunction stringList(value: unknown): readonly string[] | null {\n if (!Array.isArray(value)) return null;\n return value.every((entry) => typeof entry === 'string') ? (value as string[]) : null;\n}\n\nfunction parseBounds(value: unknown): HouseBounds | null {\n if (typeof value !== 'object' || value === null) return null;\n const held = value as Record<string, unknown>;\n const bounds: Partial<HouseBounds> = {};\n for (const key of BOUND_KEYS) {\n const amount = held[key];\n if (typeof amount !== 'number' || !Number.isFinite(amount)) return null;\n bounds[key] = amount;\n }\n return bounds as HouseBounds;\n}\n\nfunction parseOperations(value: unknown): HouseOperations | null {\n if (typeof value !== 'object' || value === null) return null;\n const held = value as Record<string, unknown>;\n const operations: Partial<Record<keyof HouseOperations, readonly string[]>> = {};\n for (const key of OPERATION_KEYS) {\n const scopes = stringList(held[key]);\n if (scopes === null) return null;\n operations[key] = scopes;\n }\n return operations as HouseOperations;\n}\n\nfunction parseAuthority(value: unknown): HouseAuthority | null {\n if (typeof value !== 'object' || value === null) return null;\n const held = value as Record<string, unknown>;\n if (held.kind !== 'room') return null;\n if (typeof held.name !== 'string' || held.name.length === 0) return null;\n if (typeof held.collection_root !== 'string' || typeof held.model_root !== 'string') return null;\n if (held.managed_replication !== 'admitted' && held.managed_replication !== 'unavailable') {\n return null;\n }\n const at = readPosition(held);\n const protectedPaths = stringList(held.protected_paths);\n const operations = parseOperations(held.operations);\n if (at === null || protectedPaths === null || operations === null) return null;\n if (typeof held.room_ref !== 'string' || held.room_ref.length === 0) return null;\n if (\n held.room_handle !== null &&\n (typeof held.room_handle !== 'string' || held.room_handle.length === 0)\n )\n return null;\n return {\n roomRef: held.room_ref,\n roomHandle: held.room_handle,\n name: held.name,\n collectionRoot: held.collection_root,\n modelRoot: held.model_root,\n managedReplication: held.managed_replication,\n protectedPaths,\n operations,\n ...at,\n };\n}\n\nexport function parseDiscovery(body: unknown): HouseDiscoveryDocument | null {\n if (typeof body !== 'object' || body === null) return null;\n const held = body as Record<string, unknown>;\n const bounds = parseBounds(held.bounds);\n if (bounds === null) return null;\n if (typeof held.md_model_version !== 'string' || held.md_model_version.length === 0) return null;\n const actions = stringList(held.actions);\n if (\n actions === null ||\n new Set(actions).size !== actions.length ||\n actions.some((name) => name.length === 0)\n )\n return null;\n if (!Array.isArray(held.authorities)) return null;\n const authorities: HouseAuthority[] = [];\n for (const entry of held.authorities) {\n const authority = parseAuthority(entry);\n if (authority === null) return null;\n authorities.push(authority);\n }\n return { bounds, mdModelVersion: held.md_model_version, authorities, actions };\n}\n\nfunction parseSiteEntry(value: unknown): HouseSiteEntry | null {\n if (typeof value !== 'object' || value === null) return null;\n const held = value as Record<string, unknown>;\n if (typeof held.room_ref !== 'string' || held.room_ref.length === 0) return null;\n if (typeof held.segment !== 'string' || held.segment.length === 0) return null;\n return { roomRef: held.room_ref, segment: held.segment };\n}\n\nfunction parseSiteSlot(value: unknown): HouseSiteSlot | null {\n if (typeof value !== 'object' || value === null) return null;\n const held = value as Record<string, unknown>;\n if (typeof held.slot !== 'string' || held.slot.length === 0) return null;\n if (!Array.isArray(held.entries)) return null;\n const entries: HouseSiteEntry[] = [];\n for (const entry of held.entries) {\n const parsed = parseSiteEntry(entry);\n if (parsed === null) return null;\n entries.push(parsed);\n }\n return { slot: held.slot, entries };\n}\n\nfunction parseSiteAuthority(value: unknown): HouseSiteAuthority | null {\n if (typeof value !== 'object' || value === null) return null;\n const held = value as Record<string, unknown>;\n if (held.kind !== 'room') return null;\n if (typeof held.room_ref !== 'string' || held.room_ref.length === 0) return null;\n if (typeof held.room_handle !== 'string' || held.room_handle.length === 0) return null;\n if (typeof held.collection_root !== 'string' || typeof held.model_root !== 'string') return null;\n const at = readPosition(held);\n if (at === null) return null;\n return {\n roomRef: held.room_ref,\n roomHandle: held.room_handle,\n collectionRoot: held.collection_root,\n modelRoot: held.model_root,\n ...at,\n };\n}\n\nexport function parseSiteDiscovery(body: unknown): HouseSiteDiscovery | null {\n if (typeof body !== 'object' || body === null) return null;\n const held = body as Record<string, unknown>;\n const bounds = parseBounds(held.bounds);\n if (bounds === null) return null;\n if (typeof held.md_model_version !== 'string' || held.md_model_version.length === 0) return null;\n if (!Array.isArray(held.slots) || !Array.isArray(held.authorities)) return null;\n const slots: HouseSiteSlot[] = [];\n for (const entry of held.slots) {\n const slot = parseSiteSlot(entry);\n if (slot === null) return null;\n slots.push(slot);\n }\n const authorities: HouseSiteAuthority[] = [];\n for (const entry of held.authorities) {\n const authority = parseSiteAuthority(entry);\n if (authority === null) return null;\n authorities.push(authority);\n }\n return { bounds, mdModelVersion: held.md_model_version, slots, authorities };\n}\n\nexport function siteTracked(document: HouseSiteDiscovery): SiteTracked[] {\n return document.authorities.map((authority) => ({\n locator: authority.roomRef,\n authority: authority.roomRef,\n handle: authority.roomHandle,\n collectionRoot: authority.collectionRoot,\n modelRoot: authority.modelRoot,\n modelRoots: [authority.modelRoot],\n position: authority.position,\n logEpoch: authority.logEpoch,\n }));\n}\n\nexport function siteSlots(document: HouseSiteDiscovery): Discovery['slots'] {\n return document.slots.map(({ slot, entries }) => ({\n slot,\n entries: entries.map(({ roomRef, segment }) => ({ locator: roomRef, segment })),\n }));\n}\n\nexport function locatorOf(authority: HouseAuthority): string {\n return authority.roomHandle ?? PRIVATE_LOCATOR;\n}\n\nexport function trackedFrom(document: HouseDiscoveryDocument): TrackedAuthority[] {\n return document.authorities.map((authority) => ({\n locator: locatorOf(authority),\n authority: authority.roomRef,\n handle: authority.roomHandle ?? undefined,\n collectionRoot: authority.collectionRoot,\n modelRoot: authority.modelRoot,\n modelRoots:\n authority.roomHandle === null\n ? [authority.modelRoot, HOUSE_TYPES_ROOT]\n : [authority.modelRoot],\n position: authority.position,\n logEpoch: authority.logEpoch,\n }));\n}\n\nexport function providerLimits(bounds: HouseBounds): readonly ProviderLimit[] {\n return [\n { name: 'document-size', value: bounds.max_authored_file_bytes },\n { name: 'change-batch-operations', value: bounds.max_batch_operations },\n { name: 'path-length', value: bounds.max_path_length },\n { name: 'path-depth', value: bounds.max_path_depth },\n { name: 'write-rate' },\n { name: 'content-ceiling' },\n ];\n}\n\nexport function declaredRetention(bounds: HouseBounds): Retention {\n return {\n history: { kind: 'no-declared-time-bound' },\n outcome: bounds.operation_retention_seconds,\n refreshHorizon: bounds.change_retention_seconds,\n };\n}\n\nexport function capabilities(actions: readonly string[]): readonly Capability[] {\n return [\n { name: ROOM_VERSION_NOTIFICATIONS },\n {\n name: PROVIDER_ACTIONS,\n actions: declaredActions(actions),\n conversationCards: HOUSE_CONVERSATION_CARDS,\n },\n { name: MOVE_REFERENCE_REWRITES },\n ];\n}\n\nexport function siteCapabilities(): readonly Capability[] {\n return [\n { name: ROOM_VERSION_NOTIFICATIONS },\n { name: PROVIDER_ACTIONS, actions: [{ name: 'submit', inputShape: {}, resultKind: 'house' }] },\n ];\n}\n\nexport function providerSelection(attachedModel: TypedSelection['attachedModel']): TypedSelection {\n return { roots: [...PROVIDER_SELECTION_ROOTS], attachedModel };\n}\n\nexport function discoveredRoom(\n authority: HouseAuthority,\n attachedModel: DiscoveredRoom['attachedModel'],\n typedSelection: TypedSelection | undefined,\n): DiscoveredRoom {\n return {\n name: authority.name,\n locator: locatorOf(authority),\n collectionRoot: authority.collectionRoot,\n roomVersion: roomVersion(authority),\n operations: {\n read: [...authority.operations.read],\n sync: [...authority.operations.sync],\n write: [...authority.operations.write],\n delete: [...authority.operations.delete],\n },\n replica: { selection: locatorOf(authority), admission: authority.managedReplication },\n attachedModel,\n ...(typedSelection === undefined ? {} : { typedSelection }),\n providerOwnedPaths: [...authority.protectedPaths],\n };\n}\n\nexport function mapDiscovery(\n document: Pick<HouseDiscoveryDocument, 'bounds' | 'mdModelVersion'>,\n rooms: readonly DiscoveredRoom[],\n declared: readonly Capability[],\n): Discovery {\n return {\n kind: 'discovery',\n supportedVersions: [ROOM_CONTRACT_VERSION],\n mdModel: { identity: MD_MODEL_IDENTITY, version: document.mdModelVersion },\n rooms,\n capabilities: declared,\n providerLimits: providerLimits(document.bounds),\n retention: declaredRetention(document.bounds),\n };\n}\n"],"names":["declaredActions","HOUSE_CONVERSATION_CARDS","PRIVATE_LOCATOR","readPosition","roomVersion","ROOM_CONTRACT_VERSION","MD_MODEL_IDENTITY","ROOM_VERSION_NOTIFICATIONS","PROVIDER_ACTIONS","MOVE_REFERENCE_REWRITES","DISCOVER_PREFIXES","PROVIDER_SELECTION_ROOTS","HOUSE_TYPES_ROOT","BOUND_KEYS","OPERATION_KEYS","stringList","value","Array","isArray","every","entry","parseBounds","held","bounds","key","amount","Number","isFinite","parseOperations","operations","scopes","parseAuthority","kind","name","length","collection_root","model_root","managed_replication","at","protectedPaths","protected_paths","room_ref","room_handle","roomRef","roomHandle","collectionRoot","modelRoot","managedReplication","parseDiscovery","body","md_model_version","actions","Set","size","some","authorities","authority","push","mdModelVersion","parseSiteEntry","segment","parseSiteSlot","slot","entries","parsed","parseSiteAuthority","parseSiteDiscovery","slots","siteTracked","document","map","locator","handle","modelRoots","position","logEpoch","siteSlots","locatorOf","trackedFrom","undefined","providerLimits","max_authored_file_bytes","max_batch_operations","max_path_length","max_path_depth","declaredRetention","history","outcome","operation_retention_seconds","refreshHorizon","change_retention_seconds","capabilities","conversationCards","siteCapabilities","inputShape","resultKind","providerSelection","attachedModel","roots","discoveredRoom","typedSelection","read","sync","write","delete","replica","selection","admission","providerOwnedPaths","mapDiscovery","rooms","declared","supportedVersions","mdModel","identity","version","retention"],"mappings":"AAQA,SAASA,eAAe,EAAEC,wBAAwB,QAAQ,eAAe;AACzE,SAASC,eAAe,QAAQ,iBAAiB;AACjD,SAASC,YAAY,EAAEC,WAAW,QAA0B,eAAe;AAE3E,OAAO,MAAMC,wBAAwB,EAAE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AA8C;IAC9E,OAAO;QAAEC,OAAO;eAAIvF;SAAyB;QAAEsF;IAAc;AAC/D;AAEA,OAAO,SAASE,eACd3C,SAAyB,EACzByC,aAA8C,EAC9CG,cAA0C;IAE1C,OAAO;QACLnE,MAAMuB,UAAUvB,IAAI;QACpBsC,SAASM,UAAUrB;QACnBX,gBAAgBW,UAAUX,cAAc;QACxCzC,aAAaA,YAAYoD;QACzB3B,YAAY;YACVwE,MAAM;mBAAI7C,UAAU3B,UAAU,CAACwE,IAAI;aAAC;YACpCC,MAAM;mBAAI9C,UAAU3B,UAAU,CAACyE,IAAI;aAAC;YACpCC,OAAO;mBAAI/C,UAAU3B,UAAU,CAAC0E,KAAK;aAAC;YACtCC,QAAQ;mBAAIhD,UAAU3B,UAAU,CAAC2E,MAAM;aAAC;QAC1C;QACAC,SAAS;YAAEC,WAAW7B,UAAUrB;YAAYmD,WAAWnD,UAAUT,kBAAkB;QAAC;QACpFkD;QACA,GAAIG,mBAAmBrB,YAAY,CAAC,IAAI;YAAEqB;QAAe,CAAC;QAC1DQ,oBAAoB;eAAIpD,UAAUjB,cAAc;SAAC;IACnD;AACF;AAEA,OAAO,SAASsE,aACdxC,QAAmE,EACnEyC,KAAgC,EAChCC,QAA+B;IAE/B,OAAO;QACL/E,MAAM;QACNgF,mBAAmB;YAAC3G;SAAsB;QAC1C4G,SAAS;YAAEC,UAAU5G;YAAmB6G,SAAS9C,SAASX,cAAc;QAAC;QACzEoD;QACAnB,cAAcoB;QACd/B,gBAAgBA,eAAeX,SAAS9C,MAAM;QAC9C6F,WAAW/B,kBAAkBhB,SAAS9C,MAAM;IAC9C;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentshouse/mdruntime-adapter",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.23",
|
|
4
4
|
"description": "Agents House Adapter for the MD Runtime",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"url": "https://github.com/agentshouse/mdruntime/issues"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@agentshouse/mdmodel": "0.1.0-alpha.
|
|
37
|
-
"@agentshouse/mdruntime": "0.1.0-alpha.
|
|
36
|
+
"@agentshouse/mdmodel": "0.1.0-alpha.15",
|
|
37
|
+
"@agentshouse/mdruntime": "0.1.0-alpha.29"
|
|
38
38
|
}
|
|
39
39
|
}
|