@agentshouse/mdruntime-adapter 0.1.0-c2b8b021403fc → 0.1.0-c2c0ec6c1f436
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/actions.d.ts +0 -1
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +26 -7
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +26 -17
- package/dist/authored-path.d.ts +0 -5
- package/dist/authored-path.d.ts.map +1 -1
- package/dist/authored-path.js +2 -2
- package/dist/discovery.js +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/read.d.ts +2 -2
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +3 -3
- package/dist/renamed.d.ts +10 -0
- package/dist/renamed.d.ts.map +1 -0
- package/dist/renamed.js +20 -0
- package/dist/room-query.d.ts.map +1 -1
- package/dist/room-query.js +7 -2
- package/dist/session-content/check.d.ts +4 -1
- package/dist/session-content/index.d.ts +1 -1
- package/dist/session-content/parts.d.ts +5 -5
- package/dist/session-content/state.d.ts +16 -21
- package/dist/session-content/turn.d.ts +53 -43
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +11 -3
- package/dist/stream.d.ts +2 -1
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +72 -3
- package/dist/transport.d.ts +34 -6
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +10 -8
- package/dist/write.d.ts +3 -8
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +61 -79
- package/package.json +4 -4
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type Check, type Checked } from './check.js';
|
|
2
2
|
import { type Part } from './parts.js';
|
|
3
|
-
declare const OPERATION: Check<import("./check.js").Shaped<{
|
|
3
|
+
declare const OPERATION: Check<(import("./check.js").Shaped<{
|
|
4
4
|
readonly op: Check<"start">;
|
|
5
5
|
readonly index: Check<number>;
|
|
6
|
-
readonly part: Check<import("./check.js").Shaped<{
|
|
6
|
+
readonly part: Check<(import("./check.js").Shaped<{
|
|
7
7
|
readonly type: Check<"text">;
|
|
8
8
|
readonly text: Check<string>;
|
|
9
|
-
}> | import("./check.js").Shaped<{
|
|
9
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
10
10
|
readonly commands: Check<number>;
|
|
11
11
|
readonly edited: Check<number>;
|
|
12
12
|
readonly other: Check<number>;
|
|
@@ -14,27 +14,27 @@ declare const OPERATION: Check<import("./check.js").Shaped<{
|
|
|
14
14
|
readonly removed: Check<number>;
|
|
15
15
|
readonly failed: Check<number>;
|
|
16
16
|
readonly type: Check<"counts">;
|
|
17
|
-
}> | import("./check.js").Shaped<{
|
|
17
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
18
18
|
readonly type: Check<"image">;
|
|
19
19
|
readonly file: Check<string>;
|
|
20
20
|
readonly name: Check<string>;
|
|
21
21
|
readonly media_type: Check<string>;
|
|
22
|
-
}> | import("./check.js").Shaped<{
|
|
22
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
23
23
|
readonly type: Check<"notice">;
|
|
24
24
|
readonly kind: Check<"compaction" | "error" | "info" | "mode" | "model" | "retry" | "warning">;
|
|
25
25
|
readonly text: Check<string>;
|
|
26
|
-
}
|
|
27
|
-
}> | import("./check.js").Shaped<{
|
|
26
|
+
}> & import("./check.js").Optional<Record<never, never>>)>;
|
|
27
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
28
28
|
readonly op: Check<"append">;
|
|
29
29
|
readonly index: Check<number>;
|
|
30
30
|
readonly text: Check<string>;
|
|
31
|
-
}> | import("./check.js").Shaped<{
|
|
31
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
32
32
|
readonly op: Check<"set">;
|
|
33
33
|
readonly index: Check<number>;
|
|
34
|
-
readonly part: Check<import("./check.js").Shaped<{
|
|
34
|
+
readonly part: Check<(import("./check.js").Shaped<{
|
|
35
35
|
readonly type: Check<"text">;
|
|
36
36
|
readonly text: Check<string>;
|
|
37
|
-
}> | import("./check.js").Shaped<{
|
|
37
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
38
38
|
readonly commands: Check<number>;
|
|
39
39
|
readonly edited: Check<number>;
|
|
40
40
|
readonly other: Check<number>;
|
|
@@ -42,24 +42,35 @@ declare const OPERATION: Check<import("./check.js").Shaped<{
|
|
|
42
42
|
readonly removed: Check<number>;
|
|
43
43
|
readonly failed: Check<number>;
|
|
44
44
|
readonly type: Check<"counts">;
|
|
45
|
-
}> | import("./check.js").Shaped<{
|
|
45
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
46
46
|
readonly type: Check<"image">;
|
|
47
47
|
readonly file: Check<string>;
|
|
48
48
|
readonly name: Check<string>;
|
|
49
49
|
readonly media_type: Check<string>;
|
|
50
|
-
}> | import("./check.js").Shaped<{
|
|
50
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
51
51
|
readonly type: Check<"notice">;
|
|
52
52
|
readonly kind: Check<"compaction" | "error" | "info" | "mode" | "model" | "retry" | "warning">;
|
|
53
53
|
readonly text: Check<string>;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
54
|
+
}> & import("./check.js").Optional<Record<never, never>>)>;
|
|
55
|
+
}> & import("./check.js").Optional<Record<never, never>>)>;
|
|
56
56
|
export type Operation = Checked<typeof OPERATION>;
|
|
57
57
|
export declare const isOperation: Check<Operation>;
|
|
58
|
+
declare const MODEL_TOKENS: Check<import("./check.js").Shaped<{
|
|
59
|
+
readonly model: Check<string | null>;
|
|
60
|
+
}> & import("./check.js").Optional<{
|
|
61
|
+
readonly input: Check<number>;
|
|
62
|
+
readonly cache_write: Check<number>;
|
|
63
|
+
readonly cache_write_5m: Check<number>;
|
|
64
|
+
readonly cache_write_1h: Check<number>;
|
|
65
|
+
readonly cache_read: Check<number>;
|
|
66
|
+
readonly output: Check<number>;
|
|
67
|
+
}>>;
|
|
68
|
+
export type ModelTokens = Checked<typeof MODEL_TOKENS>;
|
|
58
69
|
declare const TURN: Check<import("./check.js").Shaped<{
|
|
59
|
-
readonly parts: Check<readonly (import("./check.js").Shaped<{
|
|
70
|
+
readonly parts: Check<readonly ((import("./check.js").Shaped<{
|
|
60
71
|
readonly type: Check<"text">;
|
|
61
72
|
readonly text: Check<string>;
|
|
62
|
-
}> | import("./check.js").Shaped<{
|
|
73
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
63
74
|
readonly commands: Check<number>;
|
|
64
75
|
readonly edited: Check<number>;
|
|
65
76
|
readonly other: Check<number>;
|
|
@@ -67,70 +78,69 @@ declare const TURN: Check<import("./check.js").Shaped<{
|
|
|
67
78
|
readonly removed: Check<number>;
|
|
68
79
|
readonly failed: Check<number>;
|
|
69
80
|
readonly type: Check<"counts">;
|
|
70
|
-
}> | import("./check.js").Shaped<{
|
|
81
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
71
82
|
readonly type: Check<"image">;
|
|
72
83
|
readonly file: Check<string>;
|
|
73
84
|
readonly name: Check<string>;
|
|
74
85
|
readonly media_type: Check<string>;
|
|
75
|
-
}> | import("./check.js").Shaped<{
|
|
86
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
76
87
|
readonly type: Check<"notice">;
|
|
77
88
|
readonly kind: Check<"compaction" | "error" | "info" | "mode" | "model" | "retry" | "warning">;
|
|
78
89
|
readonly text: Check<string>;
|
|
79
|
-
}>)[]>;
|
|
80
|
-
readonly tokens: Check<import("./check.js").Shaped<{
|
|
90
|
+
}> & import("./check.js").Optional<Record<never, never>>))[]>;
|
|
91
|
+
readonly tokens: Check<readonly (import("./check.js").Shaped<{
|
|
92
|
+
readonly model: Check<string | null>;
|
|
93
|
+
}> & import("./check.js").Optional<{
|
|
81
94
|
readonly input: Check<number>;
|
|
82
|
-
readonly output: Check<number>;
|
|
83
|
-
readonly cache_read: Check<number>;
|
|
84
95
|
readonly cache_write: Check<number>;
|
|
85
|
-
|
|
96
|
+
readonly cache_write_5m: Check<number>;
|
|
97
|
+
readonly cache_write_1h: Check<number>;
|
|
98
|
+
readonly cache_read: Check<number>;
|
|
99
|
+
readonly output: Check<number>;
|
|
100
|
+
}>)[]>;
|
|
86
101
|
readonly state: Check<import("./check.js").Shaped<{
|
|
87
|
-
readonly
|
|
88
|
-
readonly context: Check<import("./check.js").Shaped<{
|
|
102
|
+
readonly context: Check<(import("./check.js").Shaped<{
|
|
89
103
|
readonly used: Check<number>;
|
|
90
104
|
readonly window: Check<number>;
|
|
91
|
-
readonly breakdown: Check<readonly import("./check.js").Shaped<{
|
|
105
|
+
readonly breakdown: Check<readonly (import("./check.js").Shaped<{
|
|
92
106
|
readonly name: Check<string>;
|
|
93
107
|
readonly tokens: Check<number>;
|
|
94
|
-
}>[]>;
|
|
95
|
-
}> | null>;
|
|
96
|
-
readonly limits: Check<readonly import("./check.js").Shaped<{
|
|
108
|
+
}> & import("./check.js").Optional<Record<never, never>>)[]>;
|
|
109
|
+
}> & import("./check.js").Optional<Record<never, never>>) | null>;
|
|
110
|
+
readonly limits: Check<readonly (import("./check.js").Shaped<{
|
|
97
111
|
readonly name: Check<string | null>;
|
|
98
112
|
readonly minutes: Check<number>;
|
|
99
113
|
readonly percent: Check<number>;
|
|
100
114
|
readonly resets: Check<string | null>;
|
|
101
|
-
}>[]>;
|
|
102
|
-
readonly
|
|
103
|
-
readonly amount: Check<number>;
|
|
104
|
-
readonly currency: Check<string>;
|
|
105
|
-
}> | null>;
|
|
106
|
-
readonly tokens: Check<import("./check.js").Shaped<{
|
|
115
|
+
}> & import("./check.js").Optional<Record<never, never>>)[]>;
|
|
116
|
+
readonly tokens: Check<(import("./check.js").Shaped<{
|
|
107
117
|
readonly input: Check<number>;
|
|
108
118
|
readonly output: Check<number>;
|
|
109
119
|
readonly cache_read: Check<number>;
|
|
110
120
|
readonly cache_write: Check<number>;
|
|
111
|
-
}> | null>;
|
|
121
|
+
}> & import("./check.js").Optional<Record<never, never>>) | null>;
|
|
112
122
|
readonly duration: Check<number | null>;
|
|
113
123
|
readonly files: Check<import("./check.js").Shaped<{
|
|
114
124
|
readonly count: Check<number>;
|
|
115
125
|
readonly added: Check<number>;
|
|
116
126
|
readonly removed: Check<number>;
|
|
117
|
-
}
|
|
127
|
+
}> & import("./check.js").Optional<Record<never, never>>>;
|
|
118
128
|
readonly branch: Check<string | null>;
|
|
119
129
|
readonly worktree: Check<string | null>;
|
|
120
|
-
readonly pull: Check<import("./check.js").Shaped<{
|
|
130
|
+
readonly pull: Check<(import("./check.js").Shaped<{
|
|
121
131
|
readonly number: Check<number>;
|
|
122
132
|
readonly url: Check<string>;
|
|
123
|
-
}> | null>;
|
|
133
|
+
}> & import("./check.js").Optional<Record<never, never>>) | null>;
|
|
124
134
|
readonly model: Check<string | null>;
|
|
125
135
|
readonly effort: Check<string | null>;
|
|
126
136
|
readonly mode: Check<string | null>;
|
|
127
137
|
readonly suggestion: Check<string | null>;
|
|
128
|
-
readonly running: Check<readonly import("./check.js").Shaped<{
|
|
138
|
+
readonly running: Check<readonly (import("./check.js").Shaped<{
|
|
129
139
|
readonly kind: Check<"monitor" | "schedule" | "shell" | "subagent" | "task">;
|
|
130
140
|
readonly count: Check<number>;
|
|
131
|
-
}>[]>;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
141
|
+
}> & import("./check.js").Optional<Record<never, never>>)[]>;
|
|
142
|
+
}> & import("./check.js").Optional<Record<never, never>>>;
|
|
143
|
+
}> & import("./check.js").Optional<Record<never, never>>>;
|
|
134
144
|
export type Turn = Checked<typeof TURN>;
|
|
135
145
|
export declare const isTurn: Check<Turn>;
|
|
136
146
|
export declare function applied(parts: readonly Part[], operation: Operation): readonly Part[] | null;
|
package/dist/site.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../src/site.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../src/site.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,OAAO,EASR,MAAM,wBAAwB,CAAC;AAchC,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AAuCxB,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,EAAE,QAAQ,UAAQ,GAAG,OAAO,CA2K1F"}
|
package/dist/site.js
CHANGED
|
@@ -6,9 +6,16 @@ import { answeredFailure, discoveryFailure } from './refusal.js';
|
|
|
6
6
|
import { admittedPath } from './authored-path.js';
|
|
7
7
|
import { siteQuery } from './room-query.js';
|
|
8
8
|
import { houseNotifications } from './stream.js';
|
|
9
|
-
import { houseSiteRoute, SITE_DOOR_ACTS, SITE_FILES, } from './transport.js';
|
|
9
|
+
import { houseSiteRoute, SITE_DOOR_ACTS, SITE_DOOR_TOOL, SITE_FILES, } from './transport.js';
|
|
10
10
|
import { UNANSWERED, unusable } from './uncertain.js';
|
|
11
11
|
import { followsVersion, reachedVersion, roomVersion } from './version.js';
|
|
12
|
+
function siteDoorRequest(request) {
|
|
13
|
+
const { op, ...input } = (request.input ?? {});
|
|
14
|
+
if (request.name !== SITE_DOOR_TOOL || typeof op !== 'string')
|
|
15
|
+
return request;
|
|
16
|
+
const named = Object.entries(SITE_DOOR_ACTS).find(([, act]) => act.op === op);
|
|
17
|
+
return named === undefined ? request : { ...request, name: named[0], input };
|
|
18
|
+
}
|
|
12
19
|
function unfound() {
|
|
13
20
|
return { kind: 'rejected', code: 'not_found', fields: {}, retryable: false };
|
|
14
21
|
}
|
|
@@ -169,9 +176,10 @@ export function createSiteAdapter(transport, snapshot = false) {
|
|
|
169
176
|
follows(_locator, version, next) {
|
|
170
177
|
return followsVersion(version, next);
|
|
171
178
|
},
|
|
172
|
-
async action(_authorization,
|
|
179
|
+
async action(_authorization, asked) {
|
|
180
|
+
const request = siteDoorRequest(asked);
|
|
173
181
|
const route = Object.hasOwn(SITE_DOOR_ACTS, request.name)
|
|
174
|
-
? SITE_DOOR_ACTS[request.name]
|
|
182
|
+
? SITE_DOOR_ACTS[request.name].route
|
|
175
183
|
: null;
|
|
176
184
|
if (route === null) {
|
|
177
185
|
return {
|
package/dist/stream.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AuthorityChange, type Discovery, type ConversationStream, type HeldRoom, type RoomStreamEvent, type ServiceModeSignal } from '@agentshouse/mdruntime';
|
|
1
|
+
import { type AuthorityChange, type Discovery, type ConversationStream, type HeldRoom, type RoomStreamEvent, type RunStream, type ServiceModeSignal } from '@agentshouse/mdruntime';
|
|
2
2
|
import type { TrackedAuthority } from './discovery.js';
|
|
3
3
|
import { type HouseDoor, type HouseMode, type HouseStreamFrame } from './transport.js';
|
|
4
4
|
export type HouseOpeningFrame = Extract<HouseStreamFrame, {
|
|
@@ -18,6 +18,7 @@ export type HouseNotifications = {
|
|
|
18
18
|
send(rooms: readonly HeldRoom[]): void;
|
|
19
19
|
track(authorities: readonly TrackedAuthority[]): void;
|
|
20
20
|
conversations: ConversationStream;
|
|
21
|
+
runs: RunStream;
|
|
21
22
|
serviceMode: ServiceModeSignal;
|
|
22
23
|
};
|
|
23
24
|
export declare function houseNotifications(transport: HouseDoor, mode: HouseMode, discovering: HouseDiscovering): HouseNotifications;
|
package/dist/stream.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,eAAe,EAEpB,KAAK,SAAS,EAC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EACpB,IAAI,EAAE,SAAS,EACf,WAAW,EAAE,gBAAgB,GAC5B,kBAAkB,CA2apB"}
|
package/dist/stream.js
CHANGED
|
@@ -1,9 +1,25 @@
|
|
|
1
|
+
import { parse } from '@agentshouse/mdmodel';
|
|
1
2
|
import { ROW_WEIGHT, stepped, } from '@agentshouse/mdruntime';
|
|
2
3
|
import { acceptedMessage, changeCursor, houseHistory } from './history.js';
|
|
3
4
|
import { spaceSchemaTexts, streamedModels } from './model.js';
|
|
4
5
|
import { spaceSchemas } from './space-schema.js';
|
|
5
6
|
import { answered, answering, documentEntry, folded, forgotten, kept, } from './read.js';
|
|
6
7
|
import { DECIMAL, logPosition, presented, roomVersion } from './version.js';
|
|
8
|
+
const CURRENT_RUN_STATES = new Set(['awaiting_approval', 'started']);
|
|
9
|
+
const NO_RUN_MARKS = { rooms: {}, sent: null };
|
|
10
|
+
function heardRun(request) {
|
|
11
|
+
const read = parse(`---\n${request.document}---\n`);
|
|
12
|
+
if (!read.ok)
|
|
13
|
+
throw new Error(`the stream carried request ${request.name} as no document`);
|
|
14
|
+
const fields = read.document.fields;
|
|
15
|
+
return {
|
|
16
|
+
room: request.room_ref,
|
|
17
|
+
name: request.name,
|
|
18
|
+
document: request.document,
|
|
19
|
+
current: CURRENT_RUN_STATES.has(fields.state),
|
|
20
|
+
starter: typeof fields.requester === 'string' ? fields.requester : null,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
7
23
|
function turnOperation(frame) {
|
|
8
24
|
return 'at' in frame ? { op: 'begin', at: frame.at } : structuredClone(frame.operation);
|
|
9
25
|
}
|
|
@@ -19,9 +35,13 @@ function listedAgent(agent) {
|
|
|
19
35
|
cli: agent.cli,
|
|
20
36
|
model: agent.model,
|
|
21
37
|
effort: agent.effort,
|
|
38
|
+
model_fixed: agent.model_fixed,
|
|
22
39
|
mode: agent.mode,
|
|
23
40
|
base_instructions: agent.base_instructions,
|
|
41
|
+
compaction_threshold: agent.compaction_threshold,
|
|
42
|
+
compaction_words: agent.compaction_words,
|
|
24
43
|
in_telegram: agent.in_telegram,
|
|
44
|
+
telegram_messages: agent.telegram_messages,
|
|
25
45
|
created: agent.created,
|
|
26
46
|
retired_at: agent.retired_at,
|
|
27
47
|
};
|
|
@@ -36,7 +56,11 @@ function listedConversation(listed) {
|
|
|
36
56
|
waiting: listed.waiting,
|
|
37
57
|
newest: listed.newest === null ? null : changeCursor(listed.newest),
|
|
38
58
|
processEnded: listed.process_ended_at,
|
|
59
|
+
activity: listed.activity,
|
|
39
60
|
subject: listed.subject,
|
|
61
|
+
room: listed.room_ref,
|
|
62
|
+
model: listed.model,
|
|
63
|
+
effort: listed.effort,
|
|
40
64
|
};
|
|
41
65
|
}
|
|
42
66
|
function position(value) {
|
|
@@ -88,9 +112,11 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
88
112
|
const observers = new Set();
|
|
89
113
|
const replaying = new Map();
|
|
90
114
|
const conversationObservers = new Set();
|
|
115
|
+
const runObservers = new Set();
|
|
91
116
|
const modeObservers = new Set();
|
|
92
117
|
let replicated = [];
|
|
93
118
|
let listedCursor = null;
|
|
119
|
+
let runMarks = NO_RUN_MARKS;
|
|
94
120
|
const unanswered = [];
|
|
95
121
|
const heldAtZero = new Set();
|
|
96
122
|
const live = new Set();
|
|
@@ -106,6 +132,10 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
106
132
|
held.push(event);
|
|
107
133
|
}
|
|
108
134
|
}
|
|
135
|
+
function emitRun(event) {
|
|
136
|
+
for (const observer of runObservers)
|
|
137
|
+
observer(event);
|
|
138
|
+
}
|
|
109
139
|
function emitConversation(event) {
|
|
110
140
|
if (event.kind === 'turn' ||
|
|
111
141
|
event.kind === 'questions' ||
|
|
@@ -266,6 +296,30 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
266
296
|
emit({ kind: 'reported' });
|
|
267
297
|
return;
|
|
268
298
|
}
|
|
299
|
+
if (frame.type === 'request') {
|
|
300
|
+
const room = frame.request.room_ref;
|
|
301
|
+
emitRun({
|
|
302
|
+
kind: 'run',
|
|
303
|
+
run: heardRun(frame.request),
|
|
304
|
+
listing: tracking.has(room) ? room : null,
|
|
305
|
+
});
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
if (frame.type === 'request_removed') {
|
|
309
|
+
emitRun({ kind: 'removed', room: frame.room_ref, name: frame.request });
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
if (frame.type === 'requests') {
|
|
313
|
+
emitRun({
|
|
314
|
+
kind: 'runs',
|
|
315
|
+
listing: frame.room_ref,
|
|
316
|
+
runs: frame.requests.map(heardRun),
|
|
317
|
+
whole: frame.whole,
|
|
318
|
+
more: frame.more,
|
|
319
|
+
mark: frame.cursor,
|
|
320
|
+
});
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
269
323
|
if (frame.type === 'authority_changed') {
|
|
270
324
|
const change = discovering.changed(frame);
|
|
271
325
|
if (change !== null)
|
|
@@ -368,6 +422,17 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
368
422
|
},
|
|
369
423
|
...(mode === 'credential' ? { history: (request) => houseHistory(transport, request) } : {}),
|
|
370
424
|
},
|
|
425
|
+
runs: {
|
|
426
|
+
hold(marks) {
|
|
427
|
+
runMarks = marks;
|
|
428
|
+
},
|
|
429
|
+
observe(notify) {
|
|
430
|
+
runObservers.add(notify);
|
|
431
|
+
return () => {
|
|
432
|
+
runObservers.delete(notify);
|
|
433
|
+
};
|
|
434
|
+
},
|
|
435
|
+
},
|
|
371
436
|
observe(notify) {
|
|
372
437
|
observers.add(notify);
|
|
373
438
|
if (opening !== null) {
|
|
@@ -410,10 +475,14 @@ export function houseNotifications(transport, mode, discovering) {
|
|
|
410
475
|
heldAtZero.delete(entry.authority);
|
|
411
476
|
const site = mode === 'site';
|
|
412
477
|
unanswered.push(site ? unheld.map((entry) => entry.locator) : []);
|
|
478
|
+
const marked = (held) => {
|
|
479
|
+
const mark = runMarks.rooms[held.authority];
|
|
480
|
+
return mark === undefined ? held : { ...held, requests: mark };
|
|
481
|
+
};
|
|
413
482
|
socket.hold([
|
|
414
|
-
...named.map(({ entry, at }) => presented(entry.authority, at)),
|
|
415
|
-
...(site ? [] : unheld).map((entry) => presented(entry.authority, { position: '0', logEpoch: entry.logEpoch })),
|
|
416
|
-
], runtime, listedCursor);
|
|
483
|
+
...named.map(({ entry, at }) => marked(presented(entry.authority, at))),
|
|
484
|
+
...(site ? [] : unheld).map((entry) => marked(presented(entry.authority, { position: '0', logEpoch: entry.logEpoch }))),
|
|
485
|
+
], runtime, listedCursor, runMarks.sent ?? undefined);
|
|
417
486
|
if (site)
|
|
418
487
|
return;
|
|
419
488
|
const made = unheld.filter((entry) => entry.position === '0');
|
package/dist/transport.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ConversationEvent, ListedAgent, SavedFacts } from '@agentshouse/mdruntime';
|
|
1
|
+
import type { ConversationActivity, ConversationEvent, ListedAgent, SavedFacts } from '@agentshouse/mdruntime';
|
|
2
2
|
import type { Operation, SessionState } from './session-content/index.js';
|
|
3
3
|
export declare const HOUSE_RUNTIME_READS: {
|
|
4
|
-
readonly acts: readonly ['
|
|
5
|
-
readonly frames: readonly ['agent', 'app-message', 'app-rooms', 'authority_changed', 'carried', 'caught_up', 'commands', 'conversation', 'conversation_deleted', 'conversations', 'deliveries', 'deployment', 'held', 'interactions', 'message', 'opening', 'options', 'part', 'process', 'received', 'report', 'signal', 'site', 'starting', 'state', 'tab-icon', 'turn'];
|
|
4
|
+
readonly acts: readonly ['account_update.set', 'app.screenshot', 'app.source', 'app_update.feature_set', 'conversations/history/list', 'files/attach', 'files/finish', 'files/read', 'files/revisions/list', 'info', 'room-chunks/list', 'rooms/discover', 'rooms/search', 'update'];
|
|
5
|
+
readonly frames: readonly ['agent', 'app-message', 'app-rooms', 'authority_changed', 'carried', 'caught_up', 'commands', 'conversation', 'conversation_deleted', 'conversations', 'deliveries', 'deployment', 'held', 'interactions', 'message', 'opening', 'options', 'part', 'process', 'received', 'report', 'request', 'request_removed', 'requests', 'signal', 'site', 'starting', 'state', 'tab-icon', 'turn'];
|
|
6
6
|
};
|
|
7
7
|
export type HouseRuntimeAct = (typeof HOUSE_RUNTIME_READS.acts)[number];
|
|
8
8
|
export type HouseRuntimeFrame = (typeof HOUSE_RUNTIME_READS.frames)[number];
|
|
@@ -17,7 +17,12 @@ export declare const SITES_SUBMISSIONS_CREATE = "sites/submissions/create";
|
|
|
17
17
|
export declare const SITE_DOOR_SUBMIT = "/_house/door/submit";
|
|
18
18
|
export declare const SITES_FUNCTIONS_CALL = "sites/functions/call";
|
|
19
19
|
export declare const SITE_DOOR_FUNCTION = "/_house/door/function";
|
|
20
|
-
|
|
20
|
+
interface SiteDoorAct {
|
|
21
|
+
readonly op: string;
|
|
22
|
+
readonly route: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const SITE_DOOR_ACTS: Readonly<Record<string, SiteDoorAct>>;
|
|
25
|
+
export declare const SITE_DOOR_TOOL = "app_update";
|
|
21
26
|
export type HouseMode = 'credential' | 'site';
|
|
22
27
|
export type HouseDoorAnswer = {
|
|
23
28
|
status: number;
|
|
@@ -61,11 +66,15 @@ export type HouseStreamEntry = {
|
|
|
61
66
|
changed_at?: string;
|
|
62
67
|
created_at?: string;
|
|
63
68
|
content?: string;
|
|
64
|
-
provenance?: string;
|
|
65
69
|
facts?: SavedFacts;
|
|
66
70
|
move?: 'arrival' | 'leaving';
|
|
67
71
|
space?: string;
|
|
68
72
|
};
|
|
73
|
+
export type HouseStreamedRequest = {
|
|
74
|
+
room_ref: string;
|
|
75
|
+
name: string;
|
|
76
|
+
document: string;
|
|
77
|
+
};
|
|
69
78
|
type LiveFact<K extends ConversationEvent['kind']> = Extract<ConversationEvent, {
|
|
70
79
|
kind: K;
|
|
71
80
|
}>;
|
|
@@ -78,7 +87,11 @@ export type HouseListedConversation = {
|
|
|
78
87
|
waiting: boolean;
|
|
79
88
|
newest: number | null;
|
|
80
89
|
process_ended_at: string | null;
|
|
90
|
+
activity: ConversationActivity | null;
|
|
81
91
|
subject: string | null;
|
|
92
|
+
room_ref: string | null;
|
|
93
|
+
model: string | null;
|
|
94
|
+
effort: string | null;
|
|
82
95
|
};
|
|
83
96
|
type Listed<Frame extends {
|
|
84
97
|
readonly type: HouseRuntimeFrame;
|
|
@@ -182,14 +195,29 @@ export type HouseStreamFrame = Listed<{
|
|
|
182
195
|
service_mode: string;
|
|
183
196
|
} | {
|
|
184
197
|
type: 'report';
|
|
198
|
+
} | {
|
|
199
|
+
type: 'request';
|
|
200
|
+
request: HouseStreamedRequest;
|
|
201
|
+
} | {
|
|
202
|
+
type: 'request_removed';
|
|
203
|
+
room_ref: string;
|
|
204
|
+
request: string;
|
|
205
|
+
} | {
|
|
206
|
+
type: 'requests';
|
|
207
|
+
room_ref: string | null;
|
|
208
|
+
requests: readonly HouseStreamedRequest[];
|
|
209
|
+
whole: boolean;
|
|
210
|
+
more: boolean;
|
|
211
|
+
cursor: string;
|
|
185
212
|
}>;
|
|
186
213
|
export type HouseHeldRoom = {
|
|
187
214
|
authority: string;
|
|
188
215
|
position: string;
|
|
189
216
|
log_epoch: string;
|
|
217
|
+
requests?: string;
|
|
190
218
|
};
|
|
191
219
|
export type HouseOpening = {
|
|
192
|
-
hold(rooms: readonly HouseHeldRoom[], runtime: string, conversations: string | null): void;
|
|
220
|
+
hold(rooms: readonly HouseHeldRoom[], runtime: string, conversations: string | null, sent?: string): void;
|
|
193
221
|
received(authority: string, carry: string, index: number): void;
|
|
194
222
|
close(failure?: unknown): void;
|
|
195
223
|
};
|
package/dist/transport.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAi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AI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC7D,MAAM,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG;IACvC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC/D,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACzF,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG;IAC3C,MAAM,IAAI,OAAO,CAAC;IAClB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACpD,CAAC"}
|
package/dist/transport.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { plain, queryKey } from '@agentshouse/mdmodel';
|
|
2
2
|
export const HOUSE_RUNTIME_READS = {
|
|
3
3
|
acts: [
|
|
4
|
-
'
|
|
5
|
-
'
|
|
6
|
-
'
|
|
7
|
-
'
|
|
8
|
-
'apps/source/top/read',
|
|
4
|
+
'account_update.set',
|
|
5
|
+
'app.screenshot',
|
|
6
|
+
'app.source',
|
|
7
|
+
'app_update.feature_set',
|
|
9
8
|
'conversations/history/list',
|
|
10
9
|
'files/attach',
|
|
11
10
|
'files/finish',
|
|
@@ -15,7 +14,6 @@ export const HOUSE_RUNTIME_READS = {
|
|
|
15
14
|
'room-chunks/list',
|
|
16
15
|
'rooms/discover',
|
|
17
16
|
'rooms/search',
|
|
18
|
-
'sites/screenshot/read',
|
|
19
17
|
'update',
|
|
20
18
|
],
|
|
21
19
|
frames: [
|
|
@@ -40,6 +38,9 @@ export const HOUSE_RUNTIME_READS = {
|
|
|
40
38
|
'process',
|
|
41
39
|
'received',
|
|
42
40
|
'report',
|
|
41
|
+
'request',
|
|
42
|
+
'request_removed',
|
|
43
|
+
'requests',
|
|
43
44
|
'signal',
|
|
44
45
|
'site',
|
|
45
46
|
'starting',
|
|
@@ -85,8 +86,9 @@ export const SITE_DOOR_SUBMIT = '/_house/door/submit';
|
|
|
85
86
|
export const SITES_FUNCTIONS_CALL = 'sites/functions/call';
|
|
86
87
|
export const SITE_DOOR_FUNCTION = '/_house/door/function';
|
|
87
88
|
export const SITE_DOOR_ACTS = {
|
|
88
|
-
[SITES_SUBMISSIONS_CREATE]: SITE_DOOR_SUBMIT,
|
|
89
|
-
[SITES_FUNCTIONS_CALL]: SITE_DOOR_FUNCTION,
|
|
89
|
+
[SITES_SUBMISSIONS_CREATE]: { op: 'submission_create', route: SITE_DOOR_SUBMIT },
|
|
90
|
+
[SITES_FUNCTIONS_CALL]: { op: 'function_call', route: SITE_DOOR_FUNCTION },
|
|
90
91
|
};
|
|
92
|
+
export const SITE_DOOR_TOOL = 'app_update';
|
|
91
93
|
export const SITE_FILES = '/_house/files/';
|
|
92
94
|
export const SITE_IMAGE_COPIES_HEADER = 'X-House-Image-Copies';
|
package/dist/write.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ChangeBatch, type HistoryResult, type MutationResult } from '@agentshouse/mdruntime';
|
|
1
|
+
import { type ChangeBatch, type HistoryResult, type MutationResult, type Written } from '@agentshouse/mdruntime';
|
|
2
2
|
import type { HouseBounds } from './discovery.js';
|
|
3
3
|
export type HouseOperation = Readonly<Record<string, unknown>>;
|
|
4
4
|
export type ChangeMapping = {
|
|
@@ -9,19 +9,14 @@ export type ChangeMapping = {
|
|
|
9
9
|
path: string;
|
|
10
10
|
rule: string;
|
|
11
11
|
};
|
|
12
|
-
export declare function houseChanges(batch: ChangeBatch, handle: string): ChangeMapping;
|
|
13
|
-
export declare function houseParts(saved: readonly {
|
|
14
|
-
readonly path: string;
|
|
15
|
-
readonly parts: unknown;
|
|
16
|
-
}[], handle: string): ChangeMapping;
|
|
12
|
+
export declare function houseChanges(batch: ChangeBatch, handle: string, written: Written): ChangeMapping;
|
|
17
13
|
export declare function houseMove(batch: ChangeBatch, source: string, destination: string): ChangeMapping;
|
|
18
14
|
export type OperationHead = {
|
|
19
15
|
readonly operation_id: string;
|
|
20
|
-
readonly room_ref: string;
|
|
21
16
|
readonly app_ref?: string;
|
|
22
17
|
readonly release?: string;
|
|
23
18
|
};
|
|
24
|
-
export declare function operationHead(batch: ChangeBatch
|
|
19
|
+
export declare function operationHead(batch: ChangeBatch): OperationHead;
|
|
25
20
|
export declare function batchPaths(changes: readonly HouseOperation[]): readonly string[];
|
|
26
21
|
export declare function deltaBody(changes: readonly HouseOperation[]): string;
|
|
27
22
|
export declare function deltaBytes(delta: string): number;
|
package/dist/write.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../src/write.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,WAAW,EAEhB,KAAK,aAAa,EAElB,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../src/write.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,WAAW,EAEhB,KAAK,aAAa,EAElB,KAAK,cAAc,EACnB,KAAK,OAAO,EACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAQlD,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAE/D,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,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