@agentshouse/mdruntime-adapter 0.1.0-cc710a8825617 → 0.1.0-cc7a67785b696

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.
Files changed (77) hide show
  1. package/README.md +3 -3
  2. package/dist/actions.d.ts +6 -67
  3. package/dist/actions.d.ts.map +1 -1
  4. package/dist/actions.js +26 -342
  5. package/dist/adapter.d.ts +0 -1
  6. package/dist/adapter.d.ts.map +1 -1
  7. package/dist/adapter.js +298 -397
  8. package/dist/authored-path.d.ts +65 -0
  9. package/dist/authored-path.d.ts.map +1 -0
  10. package/dist/authored-path.js +163 -0
  11. package/dist/chunks.d.ts +36 -0
  12. package/dist/chunks.d.ts.map +1 -0
  13. package/dist/chunks.js +281 -0
  14. package/dist/digest.d.ts +0 -1
  15. package/dist/discovery.d.ts +45 -19
  16. package/dist/discovery.d.ts.map +1 -1
  17. package/dist/discovery.js +252 -67
  18. package/dist/history.d.ts +6 -0
  19. package/dist/history.d.ts.map +1 -0
  20. package/dist/history.js +85 -0
  21. package/dist/index.d.ts +10 -3
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +9 -1
  24. package/dist/map.d.ts +0 -1
  25. package/dist/model.d.ts +6 -6
  26. package/dist/model.d.ts.map +1 -1
  27. package/dist/model.js +31 -48
  28. package/dist/read.d.ts +51 -72
  29. package/dist/read.d.ts.map +1 -1
  30. package/dist/read.js +192 -329
  31. package/dist/refusal.d.ts +6 -5
  32. package/dist/refusal.d.ts.map +1 -1
  33. package/dist/refusal.js +27 -11
  34. package/dist/room-query.d.ts +4 -0
  35. package/dist/room-query.d.ts.map +1 -0
  36. package/dist/room-query.js +48 -0
  37. package/dist/search.d.ts +4 -0
  38. package/dist/search.d.ts.map +1 -0
  39. package/dist/search.js +47 -0
  40. package/dist/session-content/check.d.ts +17 -0
  41. package/dist/session-content/index.d.ts +6 -0
  42. package/dist/session-content/parts.d.ts +30 -0
  43. package/dist/session-content/state.d.ts +59 -0
  44. package/dist/session-content/turn.d.ts +137 -0
  45. package/dist/site.d.ts +0 -1
  46. package/dist/site.d.ts.map +1 -1
  47. package/dist/site.js +135 -207
  48. package/dist/space-schema.d.ts +6 -0
  49. package/dist/space-schema.d.ts.map +1 -0
  50. package/dist/space-schema.js +11 -0
  51. package/dist/stream.d.ts +15 -16
  52. package/dist/stream.d.ts.map +1 -1
  53. package/dist/stream.js +259 -423
  54. package/dist/transport.d.ts +105 -50
  55. package/dist/transport.d.ts.map +1 -1
  56. package/dist/transport.js +89 -11
  57. package/dist/uncertain.d.ts +5 -0
  58. package/dist/uncertain.d.ts.map +1 -0
  59. package/dist/uncertain.js +11 -0
  60. package/dist/upload.d.ts +13 -0
  61. package/dist/upload.d.ts.map +1 -0
  62. package/dist/upload.js +65 -0
  63. package/dist/version.d.ts +0 -1
  64. package/dist/write.d.ts +18 -4
  65. package/dist/write.d.ts.map +1 -1
  66. package/dist/write.js +123 -95
  67. package/package.json +9 -4
  68. package/AGENTS.md +0 -302
  69. package/dist/gather.d.ts +0 -4
  70. package/dist/gather.d.ts.map +0 -1
  71. package/dist/gather.js +0 -45
  72. package/dist/handed.d.ts +0 -15
  73. package/dist/handed.d.ts.map +0 -1
  74. package/dist/handed.js +0 -38
  75. package/dist/referrer.d.ts +0 -7
  76. package/dist/referrer.d.ts.map +0 -1
  77. package/dist/referrer.js +0 -35
package/dist/refusal.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { refusedFor, UNANSWERED, unusable } from './uncertain.js';
1
2
  export function doorRefusal(body) {
2
3
  if (typeof body !== 'object' || body === null)
3
4
  return null;
@@ -9,24 +10,33 @@ export function doorRefusal(body) {
9
10
  const { code, retryable, ...fields } = error;
10
11
  return { code, fields, retryable: retryable === true };
11
12
  }
13
+ export function answeredFailure(status, body) {
14
+ const refusal = doorRefusal(body);
15
+ if (refusal !== null)
16
+ return refusedFor(refusal);
17
+ return status === 0 || (status >= 500 && body === null) ? UNANSWERED : unusable();
18
+ }
19
+ export function resetOf(refusal) {
20
+ const reset = refusal?.fields.retry_at;
21
+ return refusal?.retryable === true && typeof reset === 'string' ? reset : undefined;
22
+ }
12
23
  export function scopedRefusal(locator, scope, refusal) {
13
24
  return { kind: 'scoped-refusal', locator, scope, ...refusal };
14
25
  }
15
26
  function doorFailure(status, body) {
16
27
  if (status === 0)
17
- return { kind: 'transport-uncertainty' };
18
- const refusal = doorRefusal(body);
28
+ return UNANSWERED;
19
29
  if (status === 401)
20
30
  return { kind: 'revoked-authorization' };
21
- if (refusal?.retryable === true || refusal?.code === 'update_required') {
22
- return { kind: 'transport-uncertainty' };
23
- }
31
+ const refusal = doorRefusal(body);
32
+ if (refusal?.retryable === true || refusal?.code === 'update_required')
33
+ return refusedFor(refusal);
24
34
  if (status === 404 || refusal?.code === 'room_not_found')
25
35
  return { kind: 'room-not-readable' };
26
36
  if (status < 400)
27
37
  return null;
28
38
  if (refusal === null)
29
- return { kind: 'transport-uncertainty' };
39
+ return answeredFailure(status, body);
30
40
  return { kind: 'refused', scope: status === 403 ? 'operation' : 'undisclosed', refusal };
31
41
  }
32
42
  export function classifyDoor(status, body, locator) {
@@ -39,10 +49,16 @@ export function classifyDoor(status, body, locator) {
39
49
  return scopedRefusal(locator, failure.scope, failure.refusal);
40
50
  return failure;
41
51
  }
42
- export function classifyRead(status, body, locator) {
43
- if (doorRefusal(body)?.code === 'expired')
44
- return { kind: 'beyond-horizon' };
45
- return classifyDoor(status, body, locator);
52
+ export function keyedFailure(status, body) {
53
+ const failure = doorFailure(status, body);
54
+ if (failure === null)
55
+ return null;
56
+ if (failure.kind === 'refused')
57
+ return { kind: 'rejected', ...failure.refusal };
58
+ if (failure.kind !== 'room-not-readable')
59
+ return failure;
60
+ const refusal = doorRefusal(body);
61
+ return refusal === null ? answeredFailure(status, body) : { kind: 'rejected', ...refusal };
46
62
  }
47
63
  export function discoveryFailure(status, body) {
48
64
  const failure = doorFailure(status, body);
@@ -53,5 +69,5 @@ export function discoveryFailure(status, body) {
53
69
  if (failure.kind === 'refused') {
54
70
  return { kind: 'contract-unavailable', ...failure.refusal };
55
71
  }
56
- return { kind: 'transport-uncertainty' };
72
+ return failure.kind === 'transport-uncertainty' ? failure : answeredFailure(status, body);
57
73
  }
@@ -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;AASxB,wBAAsB,UAAU,CAC9B,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,EACvC,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,gBAAgB,CAAC,CAO3B;AAED,wBAAsB,SAAS,CAC7B,SAAS,EAAE,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,EAC3C,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,gBAAgB,CAAC,CAI3B"}
@@ -0,0 +1,48 @@
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
+ export async function houseQuery(transport, request) {
10
+ return queriedPage(await transport.door(houseDoorRoute('rooms/query'), {
11
+ room_ref: request.room,
12
+ query: request.query,
13
+ }));
14
+ }
15
+ export async function siteQuery(transport, request) {
16
+ const route = siteQueryRoute(request.room, request.query);
17
+ if (route.length > SITE_QUERY_ROUTE_CHARACTERS)
18
+ return TOO_LONG_FOR_AN_ADDRESS;
19
+ return queriedPage(await transport.read(route));
20
+ }
21
+ function queriedPage(answer) {
22
+ if (answer.status === 401)
23
+ return { kind: 'revoked-authorization' };
24
+ const refusal = doorRefusal(answer.body);
25
+ if (refusal !== null)
26
+ return { kind: 'rejected', ...refusal };
27
+ const { documents, groups, next, total, totalCapped, capped } = (answer.body ??
28
+ {});
29
+ if (answer.status !== 200 || !(Array.isArray(documents) || Array.isArray(groups))) {
30
+ return answeredFailure(answer.status, answer.body);
31
+ }
32
+ const continued = typeof next === 'string' ? { next } : {};
33
+ if (Array.isArray(groups)) {
34
+ return {
35
+ kind: 'groups',
36
+ groups: groups,
37
+ ...continued,
38
+ ...(capped === true ? { capped } : {}),
39
+ };
40
+ }
41
+ return {
42
+ kind: 'rows',
43
+ documents: documents,
44
+ ...continued,
45
+ ...(typeof total === 'number' ? { total } : {}),
46
+ ...(totalCapped === true ? { totalCapped } : {}),
47
+ };
48
+ }
@@ -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,17 @@
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 declare function exact<const S extends Shape>(shape: S): Check<Shaped<S>>;
16
+ export declare function anyOf<const C extends readonly Check<unknown>[]>(...checks: C): Check<Checked<C[number]>>;
17
+ 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 { 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").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").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").Shaped<{
19
+ readonly type: Check<"notice">;
20
+ readonly kind: Check<"compaction" | "error" | "info" | "mode" | "model" | "retry" | "warning">;
21
+ readonly text: Check<string>;
22
+ }>>;
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,59 @@
1
+ import { type Check, type Checked } from './check.js';
2
+ export 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
+ }>>;
8
+ export type Tokens = Checked<typeof TOKENS>;
9
+ declare const STATE: Check<import("./check.js").Shaped<{
10
+ readonly title: Check<string | null>;
11
+ readonly context: Check<import("./check.js").Shaped<{
12
+ readonly used: Check<number>;
13
+ readonly window: Check<number>;
14
+ readonly breakdown: Check<readonly import("./check.js").Shaped<{
15
+ readonly name: Check<string>;
16
+ readonly tokens: Check<number>;
17
+ }>[]>;
18
+ }> | null>;
19
+ readonly limits: Check<readonly import("./check.js").Shaped<{
20
+ readonly name: Check<string | null>;
21
+ readonly minutes: Check<number>;
22
+ readonly percent: Check<number>;
23
+ readonly resets: Check<string | null>;
24
+ }>[]>;
25
+ readonly cost: Check<import("./check.js").Shaped<{
26
+ readonly amount: Check<number>;
27
+ readonly currency: Check<string>;
28
+ }> | null>;
29
+ readonly tokens: Check<import("./check.js").Shaped<{
30
+ readonly input: Check<number>;
31
+ readonly output: Check<number>;
32
+ readonly cache_read: Check<number>;
33
+ readonly cache_write: Check<number>;
34
+ }> | null>;
35
+ readonly duration: Check<number | null>;
36
+ readonly files: Check<import("./check.js").Shaped<{
37
+ readonly count: Check<number>;
38
+ readonly added: Check<number>;
39
+ readonly removed: Check<number>;
40
+ }>>;
41
+ readonly branch: Check<string | null>;
42
+ readonly worktree: Check<string | null>;
43
+ readonly pull: Check<import("./check.js").Shaped<{
44
+ readonly number: Check<number>;
45
+ readonly url: Check<string>;
46
+ }> | null>;
47
+ readonly model: Check<string | null>;
48
+ readonly effort: Check<string | null>;
49
+ readonly mode: Check<string | null>;
50
+ readonly suggestion: Check<string | null>;
51
+ readonly running: Check<readonly import("./check.js").Shaped<{
52
+ readonly kind: Check<"monitor" | "schedule" | "shell" | "subagent" | "task">;
53
+ readonly count: Check<number>;
54
+ }>[]>;
55
+ }>>;
56
+ export type SessionState = Checked<typeof STATE>;
57
+ export declare const isState: Check<SessionState>;
58
+ export declare function standingState(state: SessionState, saved: string, ended: string | null): SessionState;
59
+ export {};
@@ -0,0 +1,137 @@
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").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").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").Shaped<{
23
+ readonly type: Check<"notice">;
24
+ readonly kind: Check<"compaction" | "error" | "info" | "mode" | "model" | "retry" | "warning">;
25
+ readonly text: Check<string>;
26
+ }>>;
27
+ }> | import("./check.js").Shaped<{
28
+ readonly op: Check<"append">;
29
+ readonly index: Check<number>;
30
+ readonly text: Check<string>;
31
+ }> | 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").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").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").Shaped<{
51
+ readonly type: Check<"notice">;
52
+ readonly kind: Check<"compaction" | "error" | "info" | "mode" | "model" | "retry" | "warning">;
53
+ readonly text: Check<string>;
54
+ }>>;
55
+ }>>;
56
+ export type Operation = Checked<typeof OPERATION>;
57
+ export declare const isOperation: Check<Operation>;
58
+ declare const TURN: Check<import("./check.js").Shaped<{
59
+ readonly parts: Check<readonly (import("./check.js").Shaped<{
60
+ readonly type: Check<"text">;
61
+ readonly text: Check<string>;
62
+ }> | import("./check.js").Shaped<{
63
+ readonly commands: Check<number>;
64
+ readonly edited: Check<number>;
65
+ readonly other: Check<number>;
66
+ readonly added: Check<number>;
67
+ readonly removed: Check<number>;
68
+ readonly failed: Check<number>;
69
+ readonly type: Check<"counts">;
70
+ }> | import("./check.js").Shaped<{
71
+ readonly type: Check<"image">;
72
+ readonly file: Check<string>;
73
+ readonly name: Check<string>;
74
+ readonly media_type: Check<string>;
75
+ }> | import("./check.js").Shaped<{
76
+ readonly type: Check<"notice">;
77
+ readonly kind: Check<"compaction" | "error" | "info" | "mode" | "model" | "retry" | "warning">;
78
+ readonly text: Check<string>;
79
+ }>)[]>;
80
+ readonly tokens: Check<import("./check.js").Shaped<{
81
+ readonly input: Check<number>;
82
+ readonly output: Check<number>;
83
+ readonly cache_read: Check<number>;
84
+ readonly cache_write: Check<number>;
85
+ }> | null>;
86
+ readonly state: Check<import("./check.js").Shaped<{
87
+ readonly title: Check<string | null>;
88
+ readonly context: Check<import("./check.js").Shaped<{
89
+ readonly used: Check<number>;
90
+ readonly window: Check<number>;
91
+ readonly breakdown: Check<readonly import("./check.js").Shaped<{
92
+ readonly name: Check<string>;
93
+ readonly tokens: Check<number>;
94
+ }>[]>;
95
+ }> | null>;
96
+ readonly limits: Check<readonly import("./check.js").Shaped<{
97
+ readonly name: Check<string | null>;
98
+ readonly minutes: Check<number>;
99
+ readonly percent: Check<number>;
100
+ readonly resets: Check<string | null>;
101
+ }>[]>;
102
+ readonly cost: Check<import("./check.js").Shaped<{
103
+ readonly amount: Check<number>;
104
+ readonly currency: Check<string>;
105
+ }> | null>;
106
+ readonly tokens: Check<import("./check.js").Shaped<{
107
+ readonly input: Check<number>;
108
+ readonly output: Check<number>;
109
+ readonly cache_read: Check<number>;
110
+ readonly cache_write: Check<number>;
111
+ }> | null>;
112
+ readonly duration: Check<number | null>;
113
+ readonly files: Check<import("./check.js").Shaped<{
114
+ readonly count: Check<number>;
115
+ readonly added: Check<number>;
116
+ readonly removed: Check<number>;
117
+ }>>;
118
+ readonly branch: Check<string | null>;
119
+ readonly worktree: Check<string | null>;
120
+ readonly pull: Check<import("./check.js").Shaped<{
121
+ readonly number: Check<number>;
122
+ readonly url: Check<string>;
123
+ }> | null>;
124
+ readonly model: Check<string | null>;
125
+ readonly effort: Check<string | null>;
126
+ readonly mode: Check<string | null>;
127
+ readonly suggestion: Check<string | null>;
128
+ readonly running: Check<readonly import("./check.js").Shaped<{
129
+ readonly kind: Check<"monitor" | "schedule" | "shell" | "subagent" | "task">;
130
+ readonly count: Check<number>;
131
+ }>[]>;
132
+ }>>;
133
+ }>>;
134
+ export type Turn = Checked<typeof TURN>;
135
+ export declare const isTurn: Check<Turn>;
136
+ export declare function applied(parts: readonly Part[], operation: Operation): readonly Part[] | null;
137
+ 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
3
  export declare function createSiteAdapter(transport: HouseSiteTransport, snapshot?: boolean): Adapter;
4
- //# sourceMappingURL=site.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../src/site.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAOR,MAAM,wBAAwB,CAAC;AA2BhC,OAAO,EAOL,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AAmCxB,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,EAAE,QAAQ,UAAQ,GAAG,OAAO,CA+Q1F"}
1
+ {"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../src/site.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,OAAO,EASR,MAAM,wBAAwB,CAAC;AAchC,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AAgCxB,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,EAAE,QAAQ,UAAQ,GAAG,OAAO,CA0K1F"}