@agentshouse/mdruntime-adapter 0.1.0-c3bd45bca89d3 → 0.1.0-c3c5582303db5
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/README.md +3 -3
- package/dist/actions.d.ts +6 -7
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +45 -345
- package/dist/adapter.d.ts +1 -1
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +301 -252
- package/dist/authored-path.d.ts +61 -0
- package/dist/authored-path.d.ts.map +1 -0
- package/dist/authored-path.js +166 -0
- package/dist/chunks.d.ts +36 -0
- package/dist/chunks.d.ts.map +1 -0
- package/dist/chunks.js +281 -0
- package/dist/digest.d.ts +0 -1
- package/dist/discovery.d.ts +45 -18
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +254 -65
- package/dist/history.d.ts +6 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +85 -0
- package/dist/index.d.ts +10 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/map.d.ts +0 -1
- package/dist/model.d.ts +6 -7
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +30 -50
- package/dist/read.d.ts +54 -53
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +209 -278
- package/dist/refusal.d.ts +6 -5
- package/dist/refusal.d.ts.map +1 -1
- package/dist/refusal.js +27 -10
- 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 +4 -0
- package/dist/room-query.d.ts.map +1 -0
- package/dist/room-query.js +63 -0
- package/dist/search.d.ts +4 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +47 -0
- package/dist/session-content/check.d.ts +20 -0
- package/dist/session-content/index.d.ts +6 -0
- package/dist/session-content/parts.d.ts +30 -0
- package/dist/session-content/state.d.ts +54 -0
- package/dist/session-content/turn.d.ts +147 -0
- package/dist/site.d.ts +1 -2
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +153 -107
- package/dist/space-schema.d.ts +6 -0
- package/dist/space-schema.d.ts.map +1 -0
- package/dist/space-schema.js +11 -0
- package/dist/stream.d.ts +15 -14
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +344 -153
- package/dist/transport.d.ts +152 -31
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +93 -9
- package/dist/uncertain.d.ts +5 -0
- package/dist/uncertain.d.ts.map +1 -0
- package/dist/uncertain.js +11 -0
- package/dist/upload.d.ts +17 -0
- package/dist/upload.d.ts.map +1 -0
- package/dist/upload.js +106 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/write.d.ts +14 -12
- package/dist/write.d.ts.map +1 -1
- package/dist/write.js +197 -137
- package/package.json +11 -7
- package/AGENTS.md +0 -269
- package/dist/gather.d.ts +0 -4
- package/dist/gather.d.ts.map +0 -1
- package/dist/gather.js +0 -45
- package/dist/links.d.ts +0 -20
- package/dist/links.d.ts.map +0 -1
- package/dist/links.js +0 -104
package/dist/renamed.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { selectorRewritten } from '@agentshouse/mdruntime';
|
|
2
|
+
const ROOM_ROOT = /^\/rooms\/([^/]+)(?=\/|$)/u;
|
|
3
|
+
function roomOfPath(path) {
|
|
4
|
+
return typeof path === 'string' ? (ROOM_ROOT.exec(path)?.[1] ?? null) : null;
|
|
5
|
+
}
|
|
6
|
+
export function renamedHandle(answer) {
|
|
7
|
+
if (answer.kind !== 'rejected' || answer.code !== 'handle_changed')
|
|
8
|
+
return null;
|
|
9
|
+
const from = roomOfPath(answer.fields?.path);
|
|
10
|
+
const to = roomOfPath(answer.fields?.current_path);
|
|
11
|
+
return from === null || to === null || from === to ? null : { from, to };
|
|
12
|
+
}
|
|
13
|
+
function movedPath(value, renamed) {
|
|
14
|
+
if (typeof value !== 'string' || roomOfPath(value) !== renamed.from)
|
|
15
|
+
return value;
|
|
16
|
+
return `/rooms/${renamed.to}${value.slice(`/rooms/${renamed.from}`.length)}`;
|
|
17
|
+
}
|
|
18
|
+
export function movedPaths(value, roomPaths, renamed) {
|
|
19
|
+
return roomPaths.reduce((moved, selector) => selectorRewritten(moved, selector, (one) => movedPath(one, renamed)), value);
|
|
20
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { HouseQueryAnswer, HouseQueryAsk } from '@agentshouse/mdruntime';
|
|
2
|
+
import { type HouseSiteTransport, type HouseTransport } from './transport.js';
|
|
3
|
+
export declare function houseQuery(transport: Pick<HouseTransport, 'door'>, request: HouseQueryAsk): Promise<HouseQueryAnswer>;
|
|
4
|
+
export declare function siteQuery(transport: Pick<HouseSiteTransport, 'read'>, request: HouseQueryAsk): Promise<HouseQueryAnswer>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"room-query.d.ts","sourceRoot":"","sources":["../src/room-query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,aAAa,EAId,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAKL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAwBxB,wBAAsB,UAAU,CAC9B,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,EACvC,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,gBAAgB,CAAC,CAK3B;AAED,wBAAsB,SAAS,CAC7B,SAAS,EAAE,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,EAC3C,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,gBAAgB,CAAC,CAQ3B"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { answeredFailure, doorRefusal } from './refusal.js';
|
|
2
|
+
import { houseDoorRoute, SITE_QUERY_ROUTE_CHARACTERS, siteQueryRoute, } from './transport.js';
|
|
3
|
+
const TOO_LONG_FOR_AN_ADDRESS = {
|
|
4
|
+
kind: 'rejected',
|
|
5
|
+
code: 'query_too_large',
|
|
6
|
+
fields: {},
|
|
7
|
+
retryable: false,
|
|
8
|
+
};
|
|
9
|
+
function infoAsked(request) {
|
|
10
|
+
const root = `/rooms/${request.room}`;
|
|
11
|
+
const follows = request.follows === undefined ? {} : { follows: request.follows };
|
|
12
|
+
if (!('query' in request)) {
|
|
13
|
+
const { path, after } = request;
|
|
14
|
+
return {
|
|
15
|
+
path: `${root}/${path}`,
|
|
16
|
+
...(after === undefined ? {} : { cursor: after }),
|
|
17
|
+
...follows,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const { after, ...query } = request.query;
|
|
21
|
+
return { path: root, query, ...(after === undefined ? {} : { cursor: after }), ...follows };
|
|
22
|
+
}
|
|
23
|
+
export async function houseQuery(transport, request) {
|
|
24
|
+
return queriedPage(await transport.door(houseDoorRoute('info'), infoAsked(request)), 'next_cursor');
|
|
25
|
+
}
|
|
26
|
+
export async function siteQuery(transport, request) {
|
|
27
|
+
const asked = 'query' in request
|
|
28
|
+
? request.query
|
|
29
|
+
: { path: request.path, ...(request.after === undefined ? {} : { after: request.after }) };
|
|
30
|
+
const route = siteQueryRoute(request.room, asked, request.fresh);
|
|
31
|
+
if (route.length > SITE_QUERY_ROUTE_CHARACTERS)
|
|
32
|
+
return TOO_LONG_FOR_AN_ADDRESS;
|
|
33
|
+
return queriedPage(await transport.read(route), 'next');
|
|
34
|
+
}
|
|
35
|
+
function queriedPage(answer, named) {
|
|
36
|
+
if (answer.status === 401)
|
|
37
|
+
return { kind: 'revoked-authorization' };
|
|
38
|
+
const refusal = doorRefusal(answer.body);
|
|
39
|
+
if (refusal !== null)
|
|
40
|
+
return { kind: 'rejected', ...refusal };
|
|
41
|
+
const body = (answer.body ?? {});
|
|
42
|
+
const { documents, groups, total, totalCapped, capped } = body;
|
|
43
|
+
const next = body[named];
|
|
44
|
+
if (answer.status !== 200 || !(Array.isArray(documents) || Array.isArray(groups))) {
|
|
45
|
+
return answeredFailure(answer.status, answer.body);
|
|
46
|
+
}
|
|
47
|
+
const continued = typeof next === 'string' ? { next } : {};
|
|
48
|
+
if (Array.isArray(groups)) {
|
|
49
|
+
return {
|
|
50
|
+
kind: 'groups',
|
|
51
|
+
groups: groups,
|
|
52
|
+
...continued,
|
|
53
|
+
...(capped === true ? { capped } : {}),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
kind: 'rows',
|
|
58
|
+
documents: documents,
|
|
59
|
+
...continued,
|
|
60
|
+
...(typeof total === 'number' ? { total } : {}),
|
|
61
|
+
...(totalCapped === true ? { totalCapped } : {}),
|
|
62
|
+
};
|
|
63
|
+
}
|
package/dist/search.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SearchAnswer, SearchAsk } from '@agentshouse/mdruntime';
|
|
2
|
+
import type { TrackedAuthority } from './discovery.js';
|
|
3
|
+
import { type HouseTransport } from './transport.js';
|
|
4
|
+
export declare function houseSearch(transport: Pick<HouseTransport, 'door'>, tracked: readonly TrackedAuthority[], request: SearchAsk): Promise<SearchAnswer>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAa,MAAM,wBAAwB,CAAC;AACjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAoBrE,wBAAsB,WAAW,CAC/B,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,EACvC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,OAAO,EAAE,SAAS,GACjB,OAAO,CAAC,YAAY,CAAC,CAsBvB"}
|
package/dist/search.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { answeredFailure, doorRefusal } from './refusal.js';
|
|
2
|
+
import { houseDoorRoute } from './transport.js';
|
|
3
|
+
const ROOMS = '/rooms/';
|
|
4
|
+
function hitOf(file, locators) {
|
|
5
|
+
if (typeof file !== 'object' || file === null)
|
|
6
|
+
return null;
|
|
7
|
+
const { path, line, snippet } = file;
|
|
8
|
+
if (typeof path !== 'string' || !path.startsWith(ROOMS))
|
|
9
|
+
return null;
|
|
10
|
+
const slash = path.indexOf('/', ROOMS.length);
|
|
11
|
+
if (slash < 0)
|
|
12
|
+
return null;
|
|
13
|
+
const room = locators.get(path.slice(ROOMS.length, slash));
|
|
14
|
+
if (room === undefined)
|
|
15
|
+
return null;
|
|
16
|
+
return {
|
|
17
|
+
room,
|
|
18
|
+
path: path.slice(slash + 1),
|
|
19
|
+
...(typeof line === 'number' ? { line } : {}),
|
|
20
|
+
...(typeof snippet === 'string' ? { snippet } : {}),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export async function houseSearch(transport, tracked, request) {
|
|
24
|
+
const named = request.rooms === null
|
|
25
|
+
? null
|
|
26
|
+
: tracked.filter((entry) => request.rooms.includes(entry.locator));
|
|
27
|
+
if (named !== null && named.length === 0)
|
|
28
|
+
return { kind: 'found', documents: [] };
|
|
29
|
+
const answer = await transport.door(houseDoorRoute('rooms/search'), {
|
|
30
|
+
query: request.text,
|
|
31
|
+
...(named === null ? {} : { paths: named.map((entry) => `${ROOMS}${entry.handle}`) }),
|
|
32
|
+
});
|
|
33
|
+
if (answer.status === 401)
|
|
34
|
+
return { kind: 'revoked-authorization' };
|
|
35
|
+
const refusal = doorRefusal(answer.body);
|
|
36
|
+
if (refusal !== null)
|
|
37
|
+
return { kind: 'rejected', ...refusal };
|
|
38
|
+
const files = answer.body?.files;
|
|
39
|
+
if (answer.status !== 200 || !Array.isArray(files)) {
|
|
40
|
+
return answeredFailure(answer.status, answer.body);
|
|
41
|
+
}
|
|
42
|
+
const locators = new Map(tracked.map((entry) => [entry.handle, entry.locator]));
|
|
43
|
+
return {
|
|
44
|
+
kind: 'found',
|
|
45
|
+
documents: files.flatMap((file) => hitOf(file, locators) ?? []),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type Check<T> = (value: unknown) => value is T;
|
|
2
|
+
export type Checked<C> = C extends Check<infer T> ? T : never;
|
|
3
|
+
type Shape = Readonly<Record<string, Check<unknown>>>;
|
|
4
|
+
export type Shaped<S extends Shape> = {
|
|
5
|
+
readonly [K in keyof S]: Checked<S[K]>;
|
|
6
|
+
};
|
|
7
|
+
export declare const text: Check<string>;
|
|
8
|
+
export declare const count: Check<number>;
|
|
9
|
+
export declare const figure: Check<number>;
|
|
10
|
+
export declare const instant: Check<string>;
|
|
11
|
+
export declare function oneOf<const V extends readonly string[]>(...values: V): Check<V[number]>;
|
|
12
|
+
export declare function where<T>(check: Check<T>, holds: (value: T) => boolean): Check<T>;
|
|
13
|
+
export declare function nullable<T>(check: Check<T>): Check<T | null>;
|
|
14
|
+
export declare function list<T>(check: Check<T>): Check<readonly T[]>;
|
|
15
|
+
export type Optional<O extends Shape> = {
|
|
16
|
+
readonly [K in keyof O]?: Checked<O[K]>;
|
|
17
|
+
};
|
|
18
|
+
export declare function exact<const S extends Shape, const O extends Shape = Record<never, never>>(shape: S, optional?: O): Check<Shaped<S> & Optional<O>>;
|
|
19
|
+
export declare function anyOf<const C extends readonly Check<unknown>[]>(...checks: C): Check<Checked<C[number]>>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { isPart, turnCounts } from './parts.js';
|
|
2
|
+
export type { Counts, Part, PartOf } from './parts.js';
|
|
3
|
+
export { isState, standingState } from './state.js';
|
|
4
|
+
export type { SessionState, Tokens } from './state.js';
|
|
5
|
+
export { applied, isOperation, isTurn } from './turn.js';
|
|
6
|
+
export type { ModelTokens, Operation, Turn } from './turn.js';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Check, type Checked } from './check.js';
|
|
2
|
+
declare const PART: Check<(import("./check.js").Shaped<{
|
|
3
|
+
readonly type: Check<"text">;
|
|
4
|
+
readonly text: Check<string>;
|
|
5
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
6
|
+
readonly commands: Check<number>;
|
|
7
|
+
readonly edited: Check<number>;
|
|
8
|
+
readonly other: Check<number>;
|
|
9
|
+
readonly added: Check<number>;
|
|
10
|
+
readonly removed: Check<number>;
|
|
11
|
+
readonly failed: Check<number>;
|
|
12
|
+
readonly type: Check<"counts">;
|
|
13
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
14
|
+
readonly type: Check<"image">;
|
|
15
|
+
readonly file: Check<string>;
|
|
16
|
+
readonly name: Check<string>;
|
|
17
|
+
readonly media_type: Check<string>;
|
|
18
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
19
|
+
readonly type: Check<"notice">;
|
|
20
|
+
readonly kind: Check<"compaction" | "error" | "info" | "mode" | "model" | "retry" | "warning">;
|
|
21
|
+
readonly text: Check<string>;
|
|
22
|
+
}> & import("./check.js").Optional<Record<never, never>>)>;
|
|
23
|
+
export type Part = Checked<typeof PART>;
|
|
24
|
+
export type PartOf<T extends Part['type']> = Extract<Part, {
|
|
25
|
+
readonly type: T;
|
|
26
|
+
}>;
|
|
27
|
+
export type Counts = Omit<PartOf<'counts'>, 'type'>;
|
|
28
|
+
export declare const isPart: Check<Part>;
|
|
29
|
+
export declare function turnCounts(parts: readonly Part[]): Counts;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type Check, type Checked } from './check.js';
|
|
2
|
+
declare const TOKENS: Check<import("./check.js").Shaped<{
|
|
3
|
+
readonly input: Check<number>;
|
|
4
|
+
readonly output: Check<number>;
|
|
5
|
+
readonly cache_read: Check<number>;
|
|
6
|
+
readonly cache_write: Check<number>;
|
|
7
|
+
}> & import("./check.js").Optional<Record<never, never>>>;
|
|
8
|
+
export type Tokens = Checked<typeof TOKENS>;
|
|
9
|
+
declare const STATE: Check<import("./check.js").Shaped<{
|
|
10
|
+
readonly context: Check<(import("./check.js").Shaped<{
|
|
11
|
+
readonly used: Check<number>;
|
|
12
|
+
readonly window: Check<number>;
|
|
13
|
+
readonly breakdown: Check<readonly (import("./check.js").Shaped<{
|
|
14
|
+
readonly name: Check<string>;
|
|
15
|
+
readonly tokens: Check<number>;
|
|
16
|
+
}> & import("./check.js").Optional<Record<never, never>>)[]>;
|
|
17
|
+
}> & import("./check.js").Optional<Record<never, never>>) | null>;
|
|
18
|
+
readonly limits: Check<readonly (import("./check.js").Shaped<{
|
|
19
|
+
readonly name: Check<string | null>;
|
|
20
|
+
readonly minutes: Check<number>;
|
|
21
|
+
readonly percent: Check<number>;
|
|
22
|
+
readonly resets: Check<string | null>;
|
|
23
|
+
}> & import("./check.js").Optional<Record<never, never>>)[]>;
|
|
24
|
+
readonly tokens: Check<(import("./check.js").Shaped<{
|
|
25
|
+
readonly input: Check<number>;
|
|
26
|
+
readonly output: Check<number>;
|
|
27
|
+
readonly cache_read: Check<number>;
|
|
28
|
+
readonly cache_write: Check<number>;
|
|
29
|
+
}> & import("./check.js").Optional<Record<never, never>>) | null>;
|
|
30
|
+
readonly duration: Check<number | null>;
|
|
31
|
+
readonly files: Check<import("./check.js").Shaped<{
|
|
32
|
+
readonly count: Check<number>;
|
|
33
|
+
readonly added: Check<number>;
|
|
34
|
+
readonly removed: Check<number>;
|
|
35
|
+
}> & import("./check.js").Optional<Record<never, never>>>;
|
|
36
|
+
readonly branch: Check<string | null>;
|
|
37
|
+
readonly worktree: Check<string | null>;
|
|
38
|
+
readonly pull: Check<(import("./check.js").Shaped<{
|
|
39
|
+
readonly number: Check<number>;
|
|
40
|
+
readonly url: Check<string>;
|
|
41
|
+
}> & import("./check.js").Optional<Record<never, never>>) | null>;
|
|
42
|
+
readonly model: Check<string | null>;
|
|
43
|
+
readonly effort: Check<string | null>;
|
|
44
|
+
readonly mode: Check<string | null>;
|
|
45
|
+
readonly suggestion: Check<string | null>;
|
|
46
|
+
readonly running: Check<readonly (import("./check.js").Shaped<{
|
|
47
|
+
readonly kind: Check<"monitor" | "schedule" | "shell" | "subagent" | "task">;
|
|
48
|
+
readonly count: Check<number>;
|
|
49
|
+
}> & import("./check.js").Optional<Record<never, never>>)[]>;
|
|
50
|
+
}> & import("./check.js").Optional<Record<never, never>>>;
|
|
51
|
+
export type SessionState = Checked<typeof STATE>;
|
|
52
|
+
export declare const isState: Check<SessionState>;
|
|
53
|
+
export declare function standingState(state: SessionState, saved: string, ended: string | null): SessionState;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { type Check, type Checked } from './check.js';
|
|
2
|
+
import { type Part } from './parts.js';
|
|
3
|
+
declare const OPERATION: Check<(import("./check.js").Shaped<{
|
|
4
|
+
readonly op: Check<"start">;
|
|
5
|
+
readonly index: Check<number>;
|
|
6
|
+
readonly part: Check<(import("./check.js").Shaped<{
|
|
7
|
+
readonly type: Check<"text">;
|
|
8
|
+
readonly text: Check<string>;
|
|
9
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
10
|
+
readonly commands: Check<number>;
|
|
11
|
+
readonly edited: Check<number>;
|
|
12
|
+
readonly other: Check<number>;
|
|
13
|
+
readonly added: Check<number>;
|
|
14
|
+
readonly removed: Check<number>;
|
|
15
|
+
readonly failed: Check<number>;
|
|
16
|
+
readonly type: Check<"counts">;
|
|
17
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
18
|
+
readonly type: Check<"image">;
|
|
19
|
+
readonly file: Check<string>;
|
|
20
|
+
readonly name: Check<string>;
|
|
21
|
+
readonly media_type: Check<string>;
|
|
22
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
23
|
+
readonly type: Check<"notice">;
|
|
24
|
+
readonly kind: Check<"compaction" | "error" | "info" | "mode" | "model" | "retry" | "warning">;
|
|
25
|
+
readonly text: Check<string>;
|
|
26
|
+
}> & import("./check.js").Optional<Record<never, never>>)>;
|
|
27
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
28
|
+
readonly op: Check<"append">;
|
|
29
|
+
readonly index: Check<number>;
|
|
30
|
+
readonly text: Check<string>;
|
|
31
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
32
|
+
readonly op: Check<"set">;
|
|
33
|
+
readonly index: Check<number>;
|
|
34
|
+
readonly part: Check<(import("./check.js").Shaped<{
|
|
35
|
+
readonly type: Check<"text">;
|
|
36
|
+
readonly text: Check<string>;
|
|
37
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
38
|
+
readonly commands: Check<number>;
|
|
39
|
+
readonly edited: Check<number>;
|
|
40
|
+
readonly other: Check<number>;
|
|
41
|
+
readonly added: Check<number>;
|
|
42
|
+
readonly removed: Check<number>;
|
|
43
|
+
readonly failed: Check<number>;
|
|
44
|
+
readonly type: Check<"counts">;
|
|
45
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
46
|
+
readonly type: Check<"image">;
|
|
47
|
+
readonly file: Check<string>;
|
|
48
|
+
readonly name: Check<string>;
|
|
49
|
+
readonly media_type: Check<string>;
|
|
50
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
51
|
+
readonly type: Check<"notice">;
|
|
52
|
+
readonly kind: Check<"compaction" | "error" | "info" | "mode" | "model" | "retry" | "warning">;
|
|
53
|
+
readonly text: Check<string>;
|
|
54
|
+
}> & import("./check.js").Optional<Record<never, never>>)>;
|
|
55
|
+
}> & import("./check.js").Optional<Record<never, never>>)>;
|
|
56
|
+
export type Operation = Checked<typeof OPERATION>;
|
|
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>;
|
|
69
|
+
declare const TURN: Check<import("./check.js").Shaped<{
|
|
70
|
+
readonly parts: Check<readonly ((import("./check.js").Shaped<{
|
|
71
|
+
readonly type: Check<"text">;
|
|
72
|
+
readonly text: Check<string>;
|
|
73
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
74
|
+
readonly commands: Check<number>;
|
|
75
|
+
readonly edited: Check<number>;
|
|
76
|
+
readonly other: Check<number>;
|
|
77
|
+
readonly added: Check<number>;
|
|
78
|
+
readonly removed: Check<number>;
|
|
79
|
+
readonly failed: Check<number>;
|
|
80
|
+
readonly type: Check<"counts">;
|
|
81
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
82
|
+
readonly type: Check<"image">;
|
|
83
|
+
readonly file: Check<string>;
|
|
84
|
+
readonly name: Check<string>;
|
|
85
|
+
readonly media_type: Check<string>;
|
|
86
|
+
}> & import("./check.js").Optional<Record<never, never>>) | (import("./check.js").Shaped<{
|
|
87
|
+
readonly type: Check<"notice">;
|
|
88
|
+
readonly kind: Check<"compaction" | "error" | "info" | "mode" | "model" | "retry" | "warning">;
|
|
89
|
+
readonly text: Check<string>;
|
|
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<{
|
|
94
|
+
readonly input: Check<number>;
|
|
95
|
+
readonly cache_write: Check<number>;
|
|
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
|
+
}>)[]>;
|
|
101
|
+
readonly state: Check<import("./check.js").Shaped<{
|
|
102
|
+
readonly context: Check<(import("./check.js").Shaped<{
|
|
103
|
+
readonly used: Check<number>;
|
|
104
|
+
readonly window: Check<number>;
|
|
105
|
+
readonly breakdown: Check<readonly (import("./check.js").Shaped<{
|
|
106
|
+
readonly name: Check<string>;
|
|
107
|
+
readonly tokens: Check<number>;
|
|
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<{
|
|
111
|
+
readonly name: Check<string | null>;
|
|
112
|
+
readonly minutes: Check<number>;
|
|
113
|
+
readonly percent: Check<number>;
|
|
114
|
+
readonly resets: Check<string | null>;
|
|
115
|
+
}> & import("./check.js").Optional<Record<never, never>>)[]>;
|
|
116
|
+
readonly tokens: Check<(import("./check.js").Shaped<{
|
|
117
|
+
readonly input: Check<number>;
|
|
118
|
+
readonly output: Check<number>;
|
|
119
|
+
readonly cache_read: Check<number>;
|
|
120
|
+
readonly cache_write: Check<number>;
|
|
121
|
+
}> & import("./check.js").Optional<Record<never, never>>) | null>;
|
|
122
|
+
readonly duration: Check<number | null>;
|
|
123
|
+
readonly files: Check<import("./check.js").Shaped<{
|
|
124
|
+
readonly count: Check<number>;
|
|
125
|
+
readonly added: Check<number>;
|
|
126
|
+
readonly removed: Check<number>;
|
|
127
|
+
}> & import("./check.js").Optional<Record<never, never>>>;
|
|
128
|
+
readonly branch: Check<string | null>;
|
|
129
|
+
readonly worktree: Check<string | null>;
|
|
130
|
+
readonly pull: Check<(import("./check.js").Shaped<{
|
|
131
|
+
readonly number: Check<number>;
|
|
132
|
+
readonly url: Check<string>;
|
|
133
|
+
}> & import("./check.js").Optional<Record<never, never>>) | null>;
|
|
134
|
+
readonly model: Check<string | null>;
|
|
135
|
+
readonly effort: Check<string | null>;
|
|
136
|
+
readonly mode: Check<string | null>;
|
|
137
|
+
readonly suggestion: Check<string | null>;
|
|
138
|
+
readonly running: Check<readonly (import("./check.js").Shaped<{
|
|
139
|
+
readonly kind: Check<"monitor" | "schedule" | "shell" | "subagent" | "task">;
|
|
140
|
+
readonly count: Check<number>;
|
|
141
|
+
}> & import("./check.js").Optional<Record<never, never>>)[]>;
|
|
142
|
+
}> & import("./check.js").Optional<Record<never, never>>>;
|
|
143
|
+
}> & import("./check.js").Optional<Record<never, never>>>;
|
|
144
|
+
export type Turn = Checked<typeof TURN>;
|
|
145
|
+
export declare const isTurn: Check<Turn>;
|
|
146
|
+
export declare function applied(parts: readonly Part[], operation: Operation): readonly Part[] | null;
|
|
147
|
+
export {};
|
package/dist/site.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { Adapter } from '@agentshouse/mdruntime';
|
|
2
2
|
import { type HouseSiteTransport } from './transport.js';
|
|
3
|
-
export declare function createSiteAdapter(transport: HouseSiteTransport): Adapter;
|
|
4
|
-
//# sourceMappingURL=site.d.ts.map
|
|
3
|
+
export declare function createSiteAdapter(transport: HouseSiteTransport, snapshot?: boolean): Adapter;
|
package/dist/site.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../src/site.ts"],"names":[],"mappings":"
|
|
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"}
|