@llui/agent 0.0.29

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 (151) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +210 -0
  3. package/dist/client/agentConfirm.d.ts +60 -0
  4. package/dist/client/agentConfirm.d.ts.map +1 -0
  5. package/dist/client/agentConfirm.js +66 -0
  6. package/dist/client/agentConfirm.js.map +1 -0
  7. package/dist/client/agentConnect.d.ts +125 -0
  8. package/dist/client/agentConnect.d.ts.map +1 -0
  9. package/dist/client/agentConnect.js +114 -0
  10. package/dist/client/agentConnect.js.map +1 -0
  11. package/dist/client/agentLog.d.ts +51 -0
  12. package/dist/client/agentLog.d.ts.map +1 -0
  13. package/dist/client/agentLog.js +53 -0
  14. package/dist/client/agentLog.js.map +1 -0
  15. package/dist/client/effect-handler.d.ts +15 -0
  16. package/dist/client/effect-handler.d.ts.map +1 -0
  17. package/dist/client/effect-handler.js +146 -0
  18. package/dist/client/effect-handler.js.map +1 -0
  19. package/dist/client/effects.d.ts +27 -0
  20. package/dist/client/effects.d.ts.map +1 -0
  21. package/dist/client/effects.js +2 -0
  22. package/dist/client/effects.js.map +1 -0
  23. package/dist/client/factory.d.ts +47 -0
  24. package/dist/client/factory.d.ts.map +1 -0
  25. package/dist/client/factory.js +105 -0
  26. package/dist/client/factory.js.map +1 -0
  27. package/dist/client/index.d.ts +7 -0
  28. package/dist/client/index.d.ts.map +1 -0
  29. package/dist/client/index.js +5 -0
  30. package/dist/client/index.js.map +1 -0
  31. package/dist/client/rpc/describe-context.d.ts +10 -0
  32. package/dist/client/rpc/describe-context.d.ts.map +1 -0
  33. package/dist/client/rpc/describe-context.js +8 -0
  34. package/dist/client/rpc/describe-context.js.map +1 -0
  35. package/dist/client/rpc/describe-visible-content.d.ts +22 -0
  36. package/dist/client/rpc/describe-visible-content.d.ts.map +1 -0
  37. package/dist/client/rpc/describe-visible-content.js +66 -0
  38. package/dist/client/rpc/describe-visible-content.js.map +1 -0
  39. package/dist/client/rpc/get-state.d.ts +15 -0
  40. package/dist/client/rpc/get-state.d.ts.map +1 -0
  41. package/dist/client/rpc/get-state.js +37 -0
  42. package/dist/client/rpc/get-state.js.map +1 -0
  43. package/dist/client/rpc/list-actions.d.ts +27 -0
  44. package/dist/client/rpc/list-actions.d.ts.map +1 -0
  45. package/dist/client/rpc/list-actions.js +38 -0
  46. package/dist/client/rpc/list-actions.js.map +1 -0
  47. package/dist/client/rpc/query-dom.d.ts +20 -0
  48. package/dist/client/rpc/query-dom.d.ts.map +1 -0
  49. package/dist/client/rpc/query-dom.js +37 -0
  50. package/dist/client/rpc/query-dom.js.map +1 -0
  51. package/dist/client/rpc/send-message.d.ts +28 -0
  52. package/dist/client/rpc/send-message.d.ts.map +1 -0
  53. package/dist/client/rpc/send-message.js +40 -0
  54. package/dist/client/rpc/send-message.js.map +1 -0
  55. package/dist/client/uuid.d.ts +2 -0
  56. package/dist/client/uuid.d.ts.map +1 -0
  57. package/dist/client/uuid.js +24 -0
  58. package/dist/client/uuid.js.map +1 -0
  59. package/dist/client/ws-client.d.ts +44 -0
  60. package/dist/client/ws-client.d.ts.map +1 -0
  61. package/dist/client/ws-client.js +176 -0
  62. package/dist/client/ws-client.js.map +1 -0
  63. package/dist/protocol.d.ts +319 -0
  64. package/dist/protocol.d.ts.map +1 -0
  65. package/dist/protocol.js +6 -0
  66. package/dist/protocol.js.map +1 -0
  67. package/dist/server/audit.d.ts +6 -0
  68. package/dist/server/audit.d.ts.map +1 -0
  69. package/dist/server/audit.js +6 -0
  70. package/dist/server/audit.js.map +1 -0
  71. package/dist/server/factory.d.ts +10 -0
  72. package/dist/server/factory.d.ts.map +1 -0
  73. package/dist/server/factory.js +69 -0
  74. package/dist/server/factory.js.map +1 -0
  75. package/dist/server/http/mint.d.ts +23 -0
  76. package/dist/server/http/mint.d.ts.map +1 -0
  77. package/dist/server/http/mint.js +63 -0
  78. package/dist/server/http/mint.js.map +1 -0
  79. package/dist/server/http/resume.d.ts +14 -0
  80. package/dist/server/http/resume.d.ts.map +1 -0
  81. package/dist/server/http/resume.js +89 -0
  82. package/dist/server/http/resume.js.map +1 -0
  83. package/dist/server/http/revoke.d.ts +11 -0
  84. package/dist/server/http/revoke.d.ts.map +1 -0
  85. package/dist/server/http/revoke.js +24 -0
  86. package/dist/server/http/revoke.js.map +1 -0
  87. package/dist/server/http/router.d.ts +13 -0
  88. package/dist/server/http/router.d.ts.map +1 -0
  89. package/dist/server/http/router.js +28 -0
  90. package/dist/server/http/router.js.map +1 -0
  91. package/dist/server/http/sessions.d.ts +8 -0
  92. package/dist/server/http/sessions.d.ts.map +1 -0
  93. package/dist/server/http/sessions.js +27 -0
  94. package/dist/server/http/sessions.js.map +1 -0
  95. package/dist/server/identity.d.ts +8 -0
  96. package/dist/server/identity.d.ts.map +1 -0
  97. package/dist/server/identity.js +41 -0
  98. package/dist/server/identity.js.map +1 -0
  99. package/dist/server/index.d.ts +11 -0
  100. package/dist/server/index.d.ts.map +1 -0
  101. package/dist/server/index.js +6 -0
  102. package/dist/server/index.js.map +1 -0
  103. package/dist/server/lap/confirm-result.d.ts +14 -0
  104. package/dist/server/lap/confirm-result.d.ts.map +1 -0
  105. package/dist/server/lap/confirm-result.js +60 -0
  106. package/dist/server/lap/confirm-result.js.map +1 -0
  107. package/dist/server/lap/describe.d.ts +22 -0
  108. package/dist/server/lap/describe.d.ts.map +1 -0
  109. package/dist/server/lap/describe.js +67 -0
  110. package/dist/server/lap/describe.js.map +1 -0
  111. package/dist/server/lap/forward.d.ts +24 -0
  112. package/dist/server/lap/forward.d.ts.map +1 -0
  113. package/dist/server/lap/forward.js +68 -0
  114. package/dist/server/lap/forward.js.map +1 -0
  115. package/dist/server/lap/message.d.ts +14 -0
  116. package/dist/server/lap/message.d.ts.map +1 -0
  117. package/dist/server/lap/message.js +97 -0
  118. package/dist/server/lap/message.js.map +1 -0
  119. package/dist/server/lap/router.d.ts +4 -0
  120. package/dist/server/lap/router.d.ts.map +1 -0
  121. package/dist/server/lap/router.js +37 -0
  122. package/dist/server/lap/router.js.map +1 -0
  123. package/dist/server/lap/wait.d.ts +14 -0
  124. package/dist/server/lap/wait.d.ts.map +1 -0
  125. package/dist/server/lap/wait.js +35 -0
  126. package/dist/server/lap/wait.js.map +1 -0
  127. package/dist/server/options.d.ts +41 -0
  128. package/dist/server/options.d.ts.map +1 -0
  129. package/dist/server/options.js +2 -0
  130. package/dist/server/options.js.map +1 -0
  131. package/dist/server/rate-limit.d.ts +14 -0
  132. package/dist/server/rate-limit.d.ts.map +1 -0
  133. package/dist/server/rate-limit.js +43 -0
  134. package/dist/server/rate-limit.js.map +1 -0
  135. package/dist/server/token-store.d.ts +27 -0
  136. package/dist/server/token-store.d.ts.map +1 -0
  137. package/dist/server/token-store.js +55 -0
  138. package/dist/server/token-store.js.map +1 -0
  139. package/dist/server/token.d.ts +24 -0
  140. package/dist/server/token.d.ts.map +1 -0
  141. package/dist/server/token.js +77 -0
  142. package/dist/server/token.js.map +1 -0
  143. package/dist/server/ws/pairing-registry.d.ts +53 -0
  144. package/dist/server/ws/pairing-registry.d.ts.map +1 -0
  145. package/dist/server/ws/pairing-registry.js +205 -0
  146. package/dist/server/ws/pairing-registry.js.map +1 -0
  147. package/dist/server/ws/upgrade.d.ts +23 -0
  148. package/dist/server/ws/upgrade.d.ts.map +1 -0
  149. package/dist/server/ws/upgrade.js +81 -0
  150. package/dist/server/ws/upgrade.js.map +1 -0
  151. package/package.json +57 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ws-client.js","sourceRoot":"","sources":["../../src/client/ws-client.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAqB,MAAM,oBAAoB,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAwB,MAAM,uBAAuB,CAAA;AAC/E,OAAO,EAAE,iBAAiB,EAAwB,MAAM,uBAAuB,CAAA;AAC/E,OAAO,EAAE,cAAc,EAAqB,MAAM,oBAAoB,CAAA;AACtE,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9D,IAAI,IAAI,KAAK,0BAA0B;QAAE,OAAO,sBAAsB,CAAA;IACtE,IAAI,IAAI,KAAK,WAAW,EAAE,CAAC;QACzB,MAAM,CAAC,GAAG,IAAgC,CAAA;QAC1C,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,WAAW,CAAA;IACvD,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import type {\n ClientFrame,\n ServerFrame,\n HelloFrame,\n LogEntry,\n LogKind,\n MessageAnnotations,\n} from '../protocol.js'\nimport { handleGetState, type GetStateHost } from './rpc/get-state.js'\nimport { handleSendMessage, type SendMessageHost } from './rpc/send-message.js'\nimport { handleListActions, type ListActionsHost } from './rpc/list-actions.js'\nimport { handleQueryDom, type QueryDomHost } from './rpc/query-dom.js'\nimport {\n handleDescribeVisibleContent,\n type DescribeVisibleHost,\n} from './rpc/describe-visible-content.js'\nimport { handleDescribeContext, type DescribeContextHost } from './rpc/describe-context.js'\n\nexport interface WsLike {\n send(data: string): void\n close(): void\n addEventListener(event: 'message', h: (e: { data: string | ArrayBuffer }) => void): void\n addEventListener(event: 'open' | 'close', h: () => void): void\n}\n\nexport type RpcHosts = GetStateHost &\n SendMessageHost &\n ListActionsHost &\n QueryDomHost &\n DescribeVisibleHost &\n DescribeContextHost\n\nexport type HelloBuilder = () => HelloFrame\n\nexport type WsClient = {\n /** Resolve a pending confirmation; emits confirm-resolved frame to the server. */\n resolveConfirm(\n confirmId: string,\n outcome: 'confirmed' | 'user-cancelled',\n stateAfter?: unknown,\n ): void\n /** Emit a state-update frame so the server can resolve waitForChange promises. */\n emitStateUpdate(path: string, stateAfter: unknown): void\n /** Emit a log-append frame so the server can mirror client-observed actions to the audit sink. */\n emitLogAppend(entry: LogEntry): void\n /** Close the socket cleanly. */\n close(): void\n}\n\nexport type WsClientOpts = {\n /** Called once when the server sends an `{t: 'active'}` frame. Idempotent. */\n onActivated?: () => void\n /**\n * Called with every LogEntry emitted by the ws-client (one per rpc\n * dispatched or errored). Used by the factory to mirror the entries\n * into the app's local `agent.log` slice so the UI can show activity.\n * The ws-client still sends the outbound `log-append` frame to the\n * server regardless.\n */\n onLogEntry?: (entry: LogEntry) => void\n}\n\n/**\n * Wires up a WebSocket to serve rpc requests from the server. See spec §9.4.\n */\nexport function attachWsClient(\n ws: WsLike,\n rpc: RpcHosts,\n hello: HelloBuilder,\n opts: WsClientOpts = {},\n): WsClient {\n let activated = false\n ws.addEventListener('open', () => {\n ws.send(JSON.stringify(hello()))\n })\n ws.addEventListener('message', async (ev) => {\n let frame: ServerFrame\n try {\n const raw = typeof ev.data === 'string' ? ev.data : new TextDecoder().decode(ev.data)\n frame = JSON.parse(raw) as ServerFrame\n } catch {\n return\n }\n if (frame.t === 'revoked') {\n ws.close()\n return\n }\n if (frame.t === 'active') {\n if (!activated) {\n activated = true\n opts.onActivated?.()\n }\n return\n }\n if (frame.t !== 'rpc') return\n let result: unknown\n let rpcErr: { code?: string; detail?: string } | null = null\n try {\n result = await dispatch(frame.tool, frame.args, rpc)\n const reply: ClientFrame = { t: 'rpc-reply', id: frame.id, result }\n ws.send(JSON.stringify(reply))\n } catch (e: unknown) {\n rpcErr = e as { code?: string; detail?: string }\n // When a plain JS exception bubbles up (TypeError, RangeError, etc.),\n // rpcErr has no .code/.detail. Enrich the detail with the actual\n // message + stack so the server/Claude can see the real cause.\n const detail =\n rpcErr.detail ??\n (e instanceof Error\n ? `${e.name}: ${e.message}${e.stack ? '\\n' + e.stack.split('\\n').slice(0, 5).join('\\n') : ''}`\n : undefined)\n const errFrame: ClientFrame = {\n t: 'rpc-error',\n id: frame.id,\n code: rpcErr.code ?? 'internal',\n detail,\n }\n ws.send(JSON.stringify(errFrame))\n // Also log to the browser console so operators see the real cause even\n // when the server/Claude just show \"internal\".\n console.error(`[llui-agent] rpc handler threw for ${frame.tool}:`, e)\n }\n const kind = getLogKindForTool(frame.tool, result, rpcErr)\n const logEntry: LogEntry = {\n id: frame.id,\n at: Date.now(),\n kind,\n variant: extractVariant(frame.tool, frame.args),\n intent: buildIntent(frame.tool, frame.args, rpc.getMsgAnnotations()),\n }\n opts.onLogEntry?.(logEntry)\n ws.send(JSON.stringify({ t: 'log-append', entry: logEntry } satisfies ClientFrame))\n })\n\n return {\n resolveConfirm(confirmId, outcome, stateAfter) {\n const frame: ClientFrame = {\n t: 'confirm-resolved',\n confirmId,\n outcome,\n stateAfter,\n }\n ws.send(JSON.stringify(frame))\n },\n emitStateUpdate(path, stateAfter) {\n const frame: ClientFrame = { t: 'state-update', path, stateAfter }\n ws.send(JSON.stringify(frame))\n },\n emitLogAppend(entry) {\n const frame: ClientFrame = { t: 'log-append', entry }\n ws.send(JSON.stringify(frame))\n },\n close() {\n ws.close()\n },\n }\n}\n\nasync function dispatch(tool: string, args: unknown, rpc: RpcHosts): Promise<unknown> {\n switch (tool) {\n case 'get_state':\n return handleGetState(rpc, (args ?? {}) as { path?: string })\n case 'list_actions':\n return handleListActions(rpc)\n case 'send_message':\n return handleSendMessage(rpc, args as never)\n case 'query_dom':\n return handleQueryDom(rpc, args as never)\n case 'describe_visible_content':\n return handleDescribeVisibleContent(rpc)\n case 'describe_context':\n return handleDescribeContext(rpc)\n default:\n throw { code: 'invalid', detail: `unknown tool: ${tool}` }\n }\n}\n\nconst READ_TOOLS = new Set([\n 'get_state',\n 'list_actions',\n 'describe_context',\n 'query_dom',\n 'describe_visible_content',\n])\n\nfunction getLogKindForTool(\n tool: string,\n result: unknown,\n err: { code?: string; detail?: string } | null,\n): LogKind {\n if (err !== null) return 'error'\n if (tool === 'send_message') {\n const r = result as { status?: string } | null\n const status = r?.status\n if (status === 'dispatched' || status === 'confirmed') return 'dispatched'\n if (status === 'pending-confirmation') return 'proposed'\n if (status === 'rejected') return 'blocked'\n return 'dispatched'\n }\n if (READ_TOOLS.has(tool)) return 'read'\n return 'read'\n}\n\nfunction extractVariant(tool: string, args: unknown): string | undefined {\n if (tool === 'send_message') {\n const a = args as { msg?: { type?: string } } | null\n const t = a?.msg?.type\n return typeof t === 'string' ? t : undefined\n }\n return undefined\n}\n\n// Human-readable label for each rpc. For send_message, prefer the @intent\n// annotation authored on the Msg union; fall back to the raw variant name.\n// For read tools, return a short fixed label so the activity feed doesn't\n// show opaque tool ids like \"describe_visible_content\".\nfunction buildIntent(\n tool: string,\n args: unknown,\n annotations: Record<string, MessageAnnotations> | null,\n): string {\n if (tool === 'send_message') {\n const a = args as { msg?: { type?: string } } | null\n const variant = typeof a?.msg?.type === 'string' ? a.msg.type : undefined\n const annotated = variant ? annotations?.[variant]?.intent : null\n if (annotated) return annotated\n return variant ?? 'Send message'\n }\n if (tool === 'get_state') return 'Read app state'\n if (tool === 'list_actions') return 'List available actions'\n if (tool === 'describe_context') return 'Read current context'\n if (tool === 'describe_visible_content') return 'Read visible content'\n if (tool === 'query_dom') {\n const a = args as { name?: string } | null\n return a?.name ? `Query DOM: ${a.name}` : 'Query DOM'\n }\n return tool\n}\n"]}
@@ -0,0 +1,319 @@
1
+ export type LapErrorCode = 'auth-failed' | 'revoked' | 'paused' | 'rate-limited' | 'invalid' | 'schema-error' | 'timeout' | 'internal';
2
+ export type LapError = {
3
+ error: {
4
+ code: LapErrorCode;
5
+ detail?: string;
6
+ retryAfterMs?: number;
7
+ };
8
+ };
9
+ export type MessageAnnotations = {
10
+ intent: string | null;
11
+ alwaysAffordable: boolean;
12
+ requiresConfirm: boolean;
13
+ humanOnly: boolean;
14
+ };
15
+ export type MessageSchemaEntry = {
16
+ payloadSchema: object;
17
+ annotations: MessageAnnotations;
18
+ };
19
+ export type LapDescribeResponse = {
20
+ name: string;
21
+ version: string;
22
+ stateSchema: object;
23
+ messages: Record<string, MessageSchemaEntry>;
24
+ docs: AgentDocs | null;
25
+ conventions: {
26
+ dispatchModel: 'TEA';
27
+ confirmationModel: 'runtime-mediated';
28
+ readSurfaces: readonly ('state' | 'query_dom' | 'describe_visible_content' | 'describe_context')[];
29
+ };
30
+ schemaHash: string;
31
+ };
32
+ export type LapStateRequest = {
33
+ path?: string;
34
+ };
35
+ export type LapStateResponse = {
36
+ state: unknown;
37
+ };
38
+ export type LapActionsResponse = {
39
+ actions: Array<{
40
+ variant: string;
41
+ intent: string;
42
+ requiresConfirm: boolean;
43
+ source: 'binding' | 'always-affordable';
44
+ selectorHint: string | null;
45
+ payloadHint: object | null;
46
+ }>;
47
+ };
48
+ export type LapMessageRequest = {
49
+ msg: {
50
+ type: string;
51
+ [k: string]: unknown;
52
+ };
53
+ reason?: string;
54
+ waitFor?: 'idle' | 'none';
55
+ timeoutMs?: number;
56
+ };
57
+ export type LapMessageRejectReason = 'humanOnly' | 'user-cancelled' | 'timeout' | 'invalid' | 'schema-error' | 'revoked' | 'paused';
58
+ export type LapMessageResponse = {
59
+ status: 'dispatched';
60
+ stateAfter: unknown;
61
+ } | {
62
+ status: 'pending-confirmation';
63
+ confirmId: string;
64
+ } | {
65
+ status: 'confirmed';
66
+ stateAfter: unknown;
67
+ } | {
68
+ status: 'rejected';
69
+ reason: LapMessageRejectReason;
70
+ detail?: string;
71
+ };
72
+ export type LapConfirmResultRequest = {
73
+ confirmId: string;
74
+ timeoutMs?: number;
75
+ };
76
+ export type LapConfirmResultResponse = {
77
+ status: 'confirmed';
78
+ stateAfter: unknown;
79
+ } | {
80
+ status: 'rejected';
81
+ reason: 'user-cancelled' | 'timeout';
82
+ } | {
83
+ status: 'still-pending';
84
+ };
85
+ export type LapWaitRequest = {
86
+ path?: string;
87
+ timeoutMs?: number;
88
+ };
89
+ export type LapWaitResponse = {
90
+ status: 'changed';
91
+ stateAfter: unknown;
92
+ } | {
93
+ status: 'timeout';
94
+ stateAfter: unknown;
95
+ };
96
+ export type LapQueryDomRequest = {
97
+ name: string;
98
+ multiple?: boolean;
99
+ };
100
+ export type LapQueryDomResponse = {
101
+ elements: Array<{
102
+ text: string;
103
+ attrs: Record<string, string>;
104
+ path: number[];
105
+ }>;
106
+ };
107
+ export type OutlineNode = {
108
+ kind: 'heading';
109
+ level: number;
110
+ text: string;
111
+ } | {
112
+ kind: 'text';
113
+ text: string;
114
+ } | {
115
+ kind: 'list';
116
+ items: OutlineNode[];
117
+ } | {
118
+ kind: 'item';
119
+ text: string;
120
+ children?: OutlineNode[];
121
+ } | {
122
+ kind: 'button';
123
+ text: string;
124
+ disabled: boolean;
125
+ actionVariant: string | null;
126
+ } | {
127
+ kind: 'input';
128
+ label: string | null;
129
+ value: string | null;
130
+ type: string;
131
+ } | {
132
+ kind: 'link';
133
+ text: string;
134
+ href: string;
135
+ };
136
+ export type LapDescribeVisibleResponse = {
137
+ outline: OutlineNode[];
138
+ };
139
+ export type AgentDocs = {
140
+ purpose: string;
141
+ overview?: string;
142
+ cautions?: string[];
143
+ };
144
+ export type AgentContext = {
145
+ summary: string;
146
+ hints?: string[];
147
+ cautions?: string[];
148
+ };
149
+ export type LapContextResponse = {
150
+ context: AgentContext;
151
+ };
152
+ export type LapEndpointMap = {
153
+ '/lap/v1/describe': {
154
+ req: null;
155
+ res: LapDescribeResponse;
156
+ };
157
+ '/lap/v1/state': {
158
+ req: LapStateRequest;
159
+ res: LapStateResponse;
160
+ };
161
+ '/lap/v1/actions': {
162
+ req: null;
163
+ res: LapActionsResponse;
164
+ };
165
+ '/lap/v1/message': {
166
+ req: LapMessageRequest;
167
+ res: LapMessageResponse;
168
+ };
169
+ '/lap/v1/confirm-result': {
170
+ req: LapConfirmResultRequest;
171
+ res: LapConfirmResultResponse;
172
+ };
173
+ '/lap/v1/wait': {
174
+ req: LapWaitRequest;
175
+ res: LapWaitResponse;
176
+ };
177
+ '/lap/v1/query-dom': {
178
+ req: LapQueryDomRequest;
179
+ res: LapQueryDomResponse;
180
+ };
181
+ '/lap/v1/describe-visible': {
182
+ req: null;
183
+ res: LapDescribeVisibleResponse;
184
+ };
185
+ '/lap/v1/context': {
186
+ req: null;
187
+ res: LapContextResponse;
188
+ };
189
+ };
190
+ export type LapPath = keyof LapEndpointMap;
191
+ export type LapRequest<P extends LapPath> = LapEndpointMap[P]['req'];
192
+ export type LapResponse<P extends LapPath> = LapEndpointMap[P]['res'];
193
+ export type LogKind = 'proposed' | 'dispatched' | 'confirmed' | 'rejected' | 'blocked' | 'read' | 'error';
194
+ export type LogEntry = {
195
+ id: string;
196
+ at: number;
197
+ kind: LogKind;
198
+ variant?: string;
199
+ intent?: string;
200
+ detail?: string;
201
+ };
202
+ export type HelloFrame = {
203
+ t: 'hello';
204
+ appName: string;
205
+ appVersion: string;
206
+ msgSchema: Record<string, MessageSchemaEntry>;
207
+ stateSchema: object;
208
+ affordancesSample: object[];
209
+ docs: AgentDocs | null;
210
+ schemaHash: string;
211
+ };
212
+ export type RpcReplyFrame = {
213
+ t: 'rpc-reply';
214
+ id: string;
215
+ result: unknown;
216
+ };
217
+ export type RpcErrorFrame = {
218
+ t: 'rpc-error';
219
+ id: string;
220
+ code: string;
221
+ detail?: string;
222
+ };
223
+ export type ConfirmResolvedFrame = {
224
+ t: 'confirm-resolved';
225
+ confirmId: string;
226
+ outcome: 'confirmed' | 'user-cancelled';
227
+ stateAfter?: unknown;
228
+ };
229
+ export type StateUpdateFrame = {
230
+ t: 'state-update';
231
+ path: string;
232
+ stateAfter: unknown;
233
+ };
234
+ export type LogAppendFrame = {
235
+ t: 'log-append';
236
+ entry: LogEntry;
237
+ };
238
+ export type ClientFrame = HelloFrame | RpcReplyFrame | RpcErrorFrame | ConfirmResolvedFrame | StateUpdateFrame | LogAppendFrame;
239
+ export type RpcFrame = {
240
+ t: 'rpc';
241
+ id: string;
242
+ tool: string;
243
+ args: unknown;
244
+ };
245
+ export type RevokedFrame = {
246
+ t: 'revoked';
247
+ };
248
+ export type ActiveFrame = {
249
+ t: 'active';
250
+ };
251
+ export type ServerFrame = RpcFrame | RevokedFrame | ActiveFrame;
252
+ declare const TokenBrand: unique symbol;
253
+ export type AgentToken = string & {
254
+ readonly [TokenBrand]: 'AgentToken';
255
+ };
256
+ export type TokenPayload = {
257
+ tid: string;
258
+ iat: number;
259
+ exp: number;
260
+ scope: 'agent';
261
+ };
262
+ export type TokenStatus = 'awaiting-ws' | 'awaiting-claude' | 'active' | 'pending-resume' | 'revoked';
263
+ export type TokenRecord = {
264
+ tid: string;
265
+ uid: string | null;
266
+ status: TokenStatus;
267
+ createdAt: number;
268
+ lastSeenAt: number;
269
+ pendingResumeUntil: number | null;
270
+ origin: string;
271
+ label: string | null;
272
+ };
273
+ export type AgentSession = {
274
+ tid: string;
275
+ label: string;
276
+ status: 'active' | 'pending-resume' | 'revoked';
277
+ createdAt: number;
278
+ lastSeenAt: number;
279
+ };
280
+ export type MintRequest = Record<string, never>;
281
+ export type MintResponse = {
282
+ token: AgentToken;
283
+ tid: string;
284
+ wsUrl: string;
285
+ lapUrl: string;
286
+ expiresAt: number;
287
+ };
288
+ export type ResumeListRequest = {
289
+ tids: string[];
290
+ };
291
+ export type ResumeListResponse = {
292
+ sessions: AgentSession[];
293
+ };
294
+ export type ResumeClaimRequest = {
295
+ tid: string;
296
+ };
297
+ export type ResumeClaimResponse = {
298
+ token: AgentToken;
299
+ wsUrl: string;
300
+ };
301
+ export type RevokeRequest = {
302
+ tid: string;
303
+ };
304
+ export type RevokeResponse = {
305
+ status: 'revoked';
306
+ };
307
+ export type SessionsResponse = {
308
+ sessions: AgentSession[];
309
+ };
310
+ export type AuditEvent = 'mint' | 'claim' | 'resume' | 'revoke' | 'lap-call' | 'msg-dispatched' | 'msg-blocked' | 'confirm-proposed' | 'confirm-approved' | 'confirm-rejected' | 'rate-limited' | 'auth-failed';
311
+ export type AuditEntry = {
312
+ at: number;
313
+ tid: string | null;
314
+ uid: string | null;
315
+ event: AuditEvent;
316
+ detail: object;
317
+ };
318
+ export {};
319
+ //# sourceMappingURL=protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,YAAY,GACpB,aAAa,GACb,SAAS,GACT,QA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M,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAAE,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAClD,MAAM,MAAM,kBAAkB,GAAG;IAAE,QAAQ,EAAE,YAAY,EAAE,CAAA;CAAE,CAAA;AAE7D,MAAM,MAAM,kBAAkB,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAChD,MAAM,MAAM,mBAAmB,GAAG;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAEtE,MAAM,MAAM,aAAa,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAC3C,MAAM,MAAM,cAAc,GAAG;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,CAAA;AAElD,MAAM,MAAM,gBAAgB,GAAG;IAAE,QAAQ,EAAE,YAAY,EAAE,CAAA;CAAE,CAAA;AAI3D,MAAM,MAAM,UAAU,GAClB,MAAM,GACN,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,gBAAgB,GAChB,aAAa,GACb,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,aAAa,CAAA;AAEjB,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,KAAK,EAAE,UAAU,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA"}
@@ -0,0 +1,6 @@
1
+ // ── LAP — LLui Agent Protocol ────────────────────────────────────
2
+ // JSON over HTTPS between the llui-agent bridge (MCP side) and the
3
+ // @llui/agent server library mounted in the developer's backend.
4
+ // See docs/superpowers/specs/2026-04-19-llui-agent-design.md §7.
5
+ export {};
6
+ //# sourceMappingURL=protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,mEAAmE;AACnE,iEAAiE;AACjE,iEAAiE","sourcesContent":["// ── LAP — LLui Agent Protocol ────────────────────────────────────\n// JSON over HTTPS between the llui-agent bridge (MCP side) and the\n// @llui/agent server library mounted in the developer's backend.\n// See docs/superpowers/specs/2026-04-19-llui-agent-design.md §7.\n\nexport type LapErrorCode =\n | 'auth-failed'\n | 'revoked'\n | 'paused'\n | 'rate-limited'\n | 'invalid'\n | 'schema-error'\n | 'timeout'\n | 'internal'\n\nexport type LapError = {\n error: {\n code: LapErrorCode\n detail?: string\n retryAfterMs?: number\n }\n}\n\nexport type MessageAnnotations = {\n intent: string | null\n alwaysAffordable: boolean\n requiresConfirm: boolean\n humanOnly: boolean\n}\n\nexport type MessageSchemaEntry = {\n payloadSchema: object\n annotations: MessageAnnotations\n}\n\nexport type LapDescribeResponse = {\n name: string\n version: string\n stateSchema: object\n messages: Record<string, MessageSchemaEntry>\n docs: AgentDocs | null\n conventions: {\n dispatchModel: 'TEA'\n confirmationModel: 'runtime-mediated'\n readSurfaces: readonly (\n | 'state'\n | 'query_dom'\n | 'describe_visible_content'\n | 'describe_context'\n )[]\n }\n schemaHash: string\n}\n\nexport type LapStateRequest = { path?: string }\nexport type LapStateResponse = { state: unknown }\n\nexport type LapActionsResponse = {\n actions: Array<{\n variant: string\n intent: string\n requiresConfirm: boolean\n source: 'binding' | 'always-affordable'\n selectorHint: string | null\n payloadHint: object | null\n }>\n}\n\nexport type LapMessageRequest = {\n msg: { type: string; [k: string]: unknown }\n reason?: string\n waitFor?: 'idle' | 'none'\n timeoutMs?: number\n}\n\nexport type LapMessageRejectReason =\n | 'humanOnly'\n | 'user-cancelled'\n | 'timeout'\n | 'invalid'\n | 'schema-error'\n | 'revoked'\n | 'paused'\n\nexport type LapMessageResponse =\n | { status: 'dispatched'; stateAfter: unknown }\n | { status: 'pending-confirmation'; confirmId: string }\n | { status: 'confirmed'; stateAfter: unknown }\n | { status: 'rejected'; reason: LapMessageRejectReason; detail?: string }\n\nexport type LapConfirmResultRequest = { confirmId: string; timeoutMs?: number }\nexport type LapConfirmResultResponse =\n | { status: 'confirmed'; stateAfter: unknown }\n | { status: 'rejected'; reason: 'user-cancelled' | 'timeout' }\n | { status: 'still-pending' }\n\nexport type LapWaitRequest = { path?: string; timeoutMs?: number }\nexport type LapWaitResponse =\n | { status: 'changed'; stateAfter: unknown }\n | { status: 'timeout'; stateAfter: unknown }\n\nexport type LapQueryDomRequest = { name: string; multiple?: boolean }\nexport type LapQueryDomResponse = {\n elements: Array<{ text: string; attrs: Record<string, string>; path: number[] }>\n}\n\nexport type OutlineNode =\n | { kind: 'heading'; level: number; text: string }\n | { kind: 'text'; text: string }\n | { kind: 'list'; items: OutlineNode[] }\n | { kind: 'item'; text: string; children?: OutlineNode[] }\n | { kind: 'button'; text: string; disabled: boolean; actionVariant: string | null }\n | { kind: 'input'; label: string | null; value: string | null; type: string }\n | { kind: 'link'; text: string; href: string }\n\nexport type LapDescribeVisibleResponse = { outline: OutlineNode[] }\n\n// ── App + context documentation ──────────────────────────────────\n// Static app-level docs (authored once on the component record) and\n// dynamic per-state context docs (pure function of state, served by\n// `/lap/v1/context`). See spec §5.4.\n\nexport type AgentDocs = {\n purpose: string\n overview?: string\n cautions?: string[]\n}\n\nexport type AgentContext = {\n summary: string\n hints?: string[]\n cautions?: string[]\n}\n\nexport type LapContextResponse = { context: AgentContext }\n\n// LAP endpoint catalog — a compile-time map binding each path to its\n// request/response shape. Useful for the bridge's dispatcher and for\n// typed test helpers.\nexport type LapEndpointMap = {\n '/lap/v1/describe': { req: null; res: LapDescribeResponse }\n '/lap/v1/state': { req: LapStateRequest; res: LapStateResponse }\n '/lap/v1/actions': { req: null; res: LapActionsResponse }\n '/lap/v1/message': { req: LapMessageRequest; res: LapMessageResponse }\n '/lap/v1/confirm-result': { req: LapConfirmResultRequest; res: LapConfirmResultResponse }\n '/lap/v1/wait': { req: LapWaitRequest; res: LapWaitResponse }\n '/lap/v1/query-dom': { req: LapQueryDomRequest; res: LapQueryDomResponse }\n '/lap/v1/describe-visible': { req: null; res: LapDescribeVisibleResponse }\n '/lap/v1/context': { req: null; res: LapContextResponse }\n}\n\nexport type LapPath = keyof LapEndpointMap\nexport type LapRequest<P extends LapPath> = LapEndpointMap[P]['req']\nexport type LapResponse<P extends LapPath> = LapEndpointMap[P]['res']\n\n// ── Relay WS frames ──────────────────────────────────────────────\n// Bidirectional framing between the LLui runtime in the browser and\n// the @llui/agent server over /agent/ws. See spec §10.5.\n\nexport type LogKind =\n | 'proposed'\n | 'dispatched'\n | 'confirmed'\n | 'rejected'\n | 'blocked'\n | 'read'\n | 'error'\n\nexport type LogEntry = {\n id: string\n at: number\n kind: LogKind\n variant?: string\n intent?: string\n detail?: string\n}\n\nexport type HelloFrame = {\n t: 'hello'\n appName: string\n appVersion: string\n msgSchema: Record<string, MessageSchemaEntry>\n stateSchema: object\n affordancesSample: object[]\n docs: AgentDocs | null\n schemaHash: string\n}\n\nexport type RpcReplyFrame = { t: 'rpc-reply'; id: string; result: unknown }\nexport type RpcErrorFrame = { t: 'rpc-error'; id: string; code: string; detail?: string }\nexport type ConfirmResolvedFrame = {\n t: 'confirm-resolved'\n confirmId: string\n outcome: 'confirmed' | 'user-cancelled'\n stateAfter?: unknown\n}\nexport type StateUpdateFrame = { t: 'state-update'; path: string; stateAfter: unknown }\nexport type LogAppendFrame = { t: 'log-append'; entry: LogEntry }\n\nexport type ClientFrame =\n | HelloFrame\n | RpcReplyFrame\n | RpcErrorFrame\n | ConfirmResolvedFrame\n | StateUpdateFrame\n | LogAppendFrame\n\nexport type RpcFrame = { t: 'rpc'; id: string; tool: string; args: unknown }\nexport type RevokedFrame = { t: 'revoked' }\nexport type ActiveFrame = { t: 'active' }\n\nexport type ServerFrame = RpcFrame | RevokedFrame | ActiveFrame\n\n// ── Tokens + pairing ─────────────────────────────────────────────\n\ndeclare const TokenBrand: unique symbol\nexport type AgentToken = string & { readonly [TokenBrand]: 'AgentToken' }\n\nexport type TokenPayload = {\n tid: string\n iat: number\n exp: number\n scope: 'agent'\n}\n\nexport type TokenStatus =\n | 'awaiting-ws'\n | 'awaiting-claude'\n | 'active'\n | 'pending-resume'\n | 'revoked'\n\nexport type TokenRecord = {\n tid: string\n uid: string | null\n status: TokenStatus\n createdAt: number\n lastSeenAt: number\n pendingResumeUntil: number | null\n origin: string\n label: string | null\n}\n\nexport type AgentSession = {\n tid: string\n label: string\n status: 'active' | 'pending-resume' | 'revoked'\n createdAt: number\n lastSeenAt: number\n}\n\n// HTTP envelopes for the mint/resume/revoke/sessions endpoints (non-LAP).\n\nexport type MintRequest = Record<string, never>\nexport type MintResponse = {\n token: AgentToken\n tid: string\n wsUrl: string\n lapUrl: string\n expiresAt: number\n}\n\nexport type ResumeListRequest = { tids: string[] }\nexport type ResumeListResponse = { sessions: AgentSession[] }\n\nexport type ResumeClaimRequest = { tid: string }\nexport type ResumeClaimResponse = { token: AgentToken; wsUrl: string }\n\nexport type RevokeRequest = { tid: string }\nexport type RevokeResponse = { status: 'revoked' }\n\nexport type SessionsResponse = { sessions: AgentSession[] }\n\n// ── Audit ────────────────────────────────────────────────────────\n\nexport type AuditEvent =\n | 'mint'\n | 'claim'\n | 'resume'\n | 'revoke'\n | 'lap-call'\n | 'msg-dispatched'\n | 'msg-blocked'\n | 'confirm-proposed'\n | 'confirm-approved'\n | 'confirm-rejected'\n | 'rate-limited'\n | 'auth-failed'\n\nexport type AuditEntry = {\n at: number\n tid: string | null\n uid: string | null\n event: AuditEvent\n detail: object\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import type { AuditEntry } from '../protocol.js';
2
+ export type AuditSink = {
3
+ write: (entry: AuditEntry) => void | Promise<void>;
4
+ };
5
+ export declare const consoleAuditSink: AuditSink;
6
+ //# sourceMappingURL=audit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/server/audit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACnD,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,SAI9B,CAAA"}
@@ -0,0 +1,6 @@
1
+ export const consoleAuditSink = {
2
+ write(entry) {
3
+ process.stdout.write(JSON.stringify(entry) + '\n');
4
+ },
5
+ };
6
+ //# sourceMappingURL=audit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/server/audit.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,gBAAgB,GAAc;IACzC,KAAK,CAAC,KAAK;QACT,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAA;IACpD,CAAC;CACF,CAAA","sourcesContent":["import type { AuditEntry } from '../protocol.js'\n\nexport type AuditSink = {\n write: (entry: AuditEntry) => void | Promise<void>\n}\n\nexport const consoleAuditSink: AuditSink = {\n write(entry) {\n process.stdout.write(JSON.stringify(entry) + '\\n')\n },\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import type { ServerOptions, AgentServerHandle } from './options.js';
2
+ /**
3
+ * Compose the server from its (defaulted) parts. Returns a handle with a
4
+ * `router` that dispatches `/agent/lap/v1/*` (LAP, checked first) then
5
+ * `/agent/*` (HTTP management), and a `wsUpgrade` for `/agent/ws`.
6
+ *
7
+ * Spec §10.1, §10.4.
8
+ */
9
+ export declare function createLluiAgentServer(opts: ServerOptions): AgentServerHandle;
10
+ //# sourceMappingURL=factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/server/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAWpE;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,aAAa,GAAG,iBAAiB,CA6D5E"}
@@ -0,0 +1,69 @@
1
+ import { InMemoryTokenStore } from './token-store.js';
2
+ import { consoleAuditSink } from './audit.js';
3
+ import { defaultRateLimiter } from './rate-limit.js';
4
+ import { createHttpRouter } from './http/router.js';
5
+ import { createLapRouter } from './lap/router.js';
6
+ import { WsPairingRegistry } from './ws/pairing-registry.js';
7
+ import { createWsUpgradeHandler } from './ws/upgrade.js';
8
+ const ANONYMOUS_RESOLVER = async () => null;
9
+ /**
10
+ * Compose the server from its (defaulted) parts. Returns a handle with a
11
+ * `router` that dispatches `/agent/lap/v1/*` (LAP, checked first) then
12
+ * `/agent/*` (HTTP management), and a `wsUpgrade` for `/agent/ws`.
13
+ *
14
+ * Spec §10.1, §10.4.
15
+ */
16
+ export function createLluiAgentServer(opts) {
17
+ if (!opts.signingKey) {
18
+ throw new Error('createLluiAgentServer: signingKey is required');
19
+ }
20
+ const tokenStore = opts.tokenStore ?? new InMemoryTokenStore();
21
+ const identityResolver = opts.identityResolver ?? ANONYMOUS_RESOLVER;
22
+ const auditSink = opts.auditSink ?? consoleAuditSink;
23
+ const rateLimiter = opts.rateLimiter ?? defaultRateLimiter({ perBucket: '30/minute' });
24
+ const lapBasePath = opts.lapBasePath ?? '/agent/lap/v1';
25
+ const registry = new WsPairingRegistry({
26
+ onLogAppend: (tid, entry) => {
27
+ void auditSink.write({
28
+ at: entry.at,
29
+ tid,
30
+ uid: null,
31
+ event: 'lap-call',
32
+ detail: {
33
+ source: 'client-log',
34
+ kind: entry.kind,
35
+ variant: entry.variant,
36
+ intent: entry.intent,
37
+ },
38
+ });
39
+ },
40
+ });
41
+ const httpRouter = createHttpRouter({
42
+ signingKey: opts.signingKey,
43
+ tokenStore,
44
+ identityResolver,
45
+ auditSink,
46
+ lapBasePath,
47
+ });
48
+ const lapRouter = createLapRouter({
49
+ signingKey: opts.signingKey,
50
+ tokenStore,
51
+ registry,
52
+ auditSink,
53
+ rateLimiter,
54
+ }, lapBasePath);
55
+ const router = async (req) => {
56
+ const lapRes = await lapRouter(req);
57
+ if (lapRes)
58
+ return lapRes;
59
+ return httpRouter(req);
60
+ };
61
+ const wsUpgrade = createWsUpgradeHandler({
62
+ signingKey: opts.signingKey,
63
+ tokenStore,
64
+ registry,
65
+ auditSink,
66
+ });
67
+ return { router, wsUpgrade };
68
+ }
69
+ //# sourceMappingURL=factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src/server/factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAExD,MAAM,kBAAkB,GAAG,KAAK,IAAI,EAAE,CAAC,IAAI,CAAA;AAE3C;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAmB;IACvD,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAA;IAClE,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,kBAAkB,EAAE,CAAA;IAC9D,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,IAAI,kBAAkB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AU,EAAE,IAAI,CAAC,UAAU;QAC3B,UAAU;QACV,QAAQ;QACR,SAAS;KACV,CAAC,CAAA;IAEF,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAA;AAC9B,CAAC","sourcesContent":["import type { ServerOptions, AgentServerHandle } from './options.js'\nimport { InMemoryTokenStore } from './token-store.js'\nimport { consoleAuditSink } from './audit.js'\nimport { defaultRateLimiter } from './rate-limit.js'\nimport { createHttpRouter } from './http/router.js'\nimport { createLapRouter } from './lap/router.js'\nimport { WsPairingRegistry } from './ws/pairing-registry.js'\nimport { createWsUpgradeHandler } from './ws/upgrade.js'\n\nconst ANONYMOUS_RESOLVER = async () => null\n\n/**\n * Compose the server from its (defaulted) parts. Returns a handle with a\n * `router` that dispatches `/agent/lap/v1/*` (LAP, checked first) then\n * `/agent/*` (HTTP management), and a `wsUpgrade` for `/agent/ws`.\n *\n * Spec §10.1, §10.4.\n */\nexport function createLluiAgentServer(opts: ServerOptions): AgentServerHandle {\n if (!opts.signingKey) {\n throw new Error('createLluiAgentServer: signingKey is required')\n }\n\n const tokenStore = opts.tokenStore ?? new InMemoryTokenStore()\n const identityResolver = opts.identityResolver ?? ANONYMOUS_RESOLVER\n const auditSink = opts.auditSink ?? consoleAuditSink\n const rateLimiter = opts.rateLimiter ?? defaultRateLimiter({ perBucket: '30/minute' })\n const lapBasePath = opts.lapBasePath ?? '/agent/lap/v1'\n\n const registry = new WsPairingRegistry({\n onLogAppend: (tid, entry) => {\n void auditSink.write({\n at: entry.at,\n tid,\n uid: null,\n event: 'lap-call',\n detail: {\n source: 'client-log',\n kind: entry.kind,\n variant: entry.variant,\n intent: entry.intent,\n },\n })\n },\n })\n\n const httpRouter = createHttpRouter({\n signingKey: opts.signingKey,\n tokenStore,\n identityResolver,\n auditSink,\n lapBasePath,\n })\n\n const lapRouter = createLapRouter(\n {\n signingKey: opts.signingKey,\n tokenStore,\n registry,\n auditSink,\n rateLimiter,\n },\n lapBasePath,\n )\n\n const router: AgentServerHandle['router'] = async (req) => {\n const lapRes = await lapRouter(req)\n if (lapRes) return lapRes\n return httpRouter(req)\n }\n\n const wsUpgrade = createWsUpgradeHandler({\n signingKey: opts.signingKey,\n tokenStore,\n registry,\n auditSink,\n })\n\n return { router, wsUpgrade }\n}\n"]}
@@ -0,0 +1,23 @@
1
+ import type { TokenStore } from '../token-store.js';
2
+ import type { IdentityResolver } from '../identity.js';
3
+ import type { AuditSink } from '../audit.js';
4
+ export type MintDeps = {
5
+ signingKey: string | Uint8Array;
6
+ tokenStore: TokenStore;
7
+ identityResolver: IdentityResolver;
8
+ auditSink: AuditSink;
9
+ lapBasePath: string;
10
+ /** Wall-clock in milliseconds; injectable for tests. */
11
+ now?: () => number;
12
+ /** UUID generator; injectable for tests. */
13
+ uuid?: () => string;
14
+ /** Hard-expiry window, default 24 h. */
15
+ hardExpiryMs?: number;
16
+ };
17
+ /**
18
+ * POST /agent/mint — creates a pairing record and returns the mint
19
+ * response. See spec §6.2. The caller is responsible for routing
20
+ * `/agent/mint` requests to this handler; `router.ts` composes that.
21
+ */
22
+ export declare function handleMint(req: Request, deps: MintDeps): Promise<Response>;
23
+ //# sourceMappingURL=mint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mint.d.ts","sourceRoot":"","sources":["../../../src/server/http/mint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAK5C,MAAM,MAAM,QAAQ,GAAG;IACrB,UAAU,EAAE,MAAM,GAAG,UAAU,CAAA;IAC/B,UAAU,EAAE,UAAU,CAAA;IACtB,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,SAAS,EAAE,SAAS,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,wDAAwD;IACxD,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;IAClB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,MAAM,CAAA;IACnB,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAwDhF"}
@@ -0,0 +1,63 @@
1
+ import { signToken } from '../token.js';
2
+ import { randomUUID } from 'node:crypto';
3
+ /**
4
+ * POST /agent/mint — creates a pairing record and returns the mint
5
+ * response. See spec §6.2. The caller is responsible for routing
6
+ * `/agent/mint` requests to this handler; `router.ts` composes that.
7
+ */
8
+ export async function handleMint(req, deps) {
9
+ if (req.method !== 'POST') {
10
+ return new Response(JSON.stringify({ error: { code: 'method-not-allowed' } }), {
11
+ status: 405,
12
+ headers: { 'content-type': 'application/json' },
13
+ });
14
+ }
15
+ const now = deps.now ?? (() => Date.now());
16
+ const uuid = deps.uuid ?? randomUUID;
17
+ const hardExpiryMs = deps.hardExpiryMs ?? 24 * 60 * 60 * 1000;
18
+ const uid = await deps.identityResolver(req);
19
+ const tid = uuid();
20
+ const nowMs = now();
21
+ const iat = Math.floor(nowMs / 1000);
22
+ const exp = Math.floor((nowMs + hardExpiryMs) / 1000);
23
+ const origin = new URL(req.url).origin;
24
+ const payload = { tid, iat, exp, scope: 'agent' };
25
+ const token = signToken(payload, deps.signingKey);
26
+ const record = {
27
+ tid,
28
+ uid,
29
+ status: 'awaiting-ws',
30
+ createdAt: nowMs,
31
+ lastSeenAt: nowMs,
32
+ pendingResumeUntil: null,
33
+ origin,
34
+ label: null,
35
+ };
36
+ await deps.tokenStore.create(record);
37
+ await deps.auditSink.write({
38
+ at: nowMs,
39
+ tid,
40
+ uid,
41
+ event: 'mint',
42
+ detail: { origin },
43
+ });
44
+ const wsUrl = toWsUrl(new URL(req.url).origin) + '/agent/ws';
45
+ const lapUrl = new URL(deps.lapBasePath, origin).toString();
46
+ const body = {
47
+ token,
48
+ tid,
49
+ wsUrl,
50
+ lapUrl,
51
+ expiresAt: exp,
52
+ };
53
+ return new Response(JSON.stringify(body), {
54
+ status: 200,
55
+ headers: { 'content-type': 'application/json' },
56
+ });
57
+ }
58
+ function toWsUrl(httpOrigin) {
59
+ return httpOrigin.startsWith('https://')
60
+ ? 'wss://' + httpOrigin.slice('https://'.length)
61
+ : 'ws://' + httpOrigin.slice('http://'.length);
62
+ }
63
+ //# sourceMappingURL=mint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mint.js","sourceRoot":"","sources":["../../../src/server/http/mint.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAgBxC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,GAAY,EAAE,IAAc;IAC3D,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QAC1B,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE,EAAE,CAAC,EAAE;YAC7E,MAAM,EAAE,GAAG;YACX,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;SAChD,CAAC,CAAA;IACJ,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAA;IAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,UAAU,CAAA;IACpC,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;IAE7D,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAA;IAC5C,M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L,MAAM;QACN,SAAS,EAAE,GAAG;KACf,CAAA;IACD,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;QACxC,MAAM,EAAE,GAAG;QACX,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;KAChD,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,UAAkB;IACjC,OAAO,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC;QACtC,CAAC,CAAC,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;QAChD,CAAC,CAAC,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;AAClD,CAAC","sourcesContent":["import type { TokenStore } from '../token-store.js'\nimport type { IdentityResolver } from '../identity.js'\nimport type { AuditSink } from '../audit.js'\nimport { signToken } from '../token.js'\nimport type { MintResponse, TokenPayload, TokenRecord } from '../../protocol.js'\nimport { randomUUID } from 'node:crypto'\n\nexport type MintDeps = {\n signingKey: string | Uint8Array\n tokenStore: TokenStore\n identityResolver: IdentityResolver\n auditSink: AuditSink\n lapBasePath: string\n /** Wall-clock in milliseconds; injectable for tests. */\n now?: () => number\n /** UUID generator; injectable for tests. */\n uuid?: () => string\n /** Hard-expiry window, default 24 h. */\n hardExpiryMs?: number\n}\n\n/**\n * POST /agent/mint — creates a pairing record and returns the mint\n * response. See spec §6.2. The caller is responsible for routing\n * `/agent/mint` requests to this handler; `router.ts` composes that.\n */\nexport async function handleMint(req: Request, deps: MintDeps): Promise<Response> {\n if (req.method !== 'POST') {\n return new Response(JSON.stringify({ error: { code: 'method-not-allowed' } }), {\n status: 405,\n headers: { 'content-type': 'application/json' },\n })\n }\n\n const now = deps.now ?? (() => Date.now())\n const uuid = deps.uuid ?? randomUUID\n const hardExpiryMs = deps.hardExpiryMs ?? 24 * 60 * 60 * 1000\n\n const uid = await deps.identityResolver(req)\n const tid = uuid()\n const nowMs = now()\n const iat = Math.floor(nowMs / 1000)\n const exp = Math.floor((nowMs + hardExpiryMs) / 1000)\n const origin = new URL(req.url).origin\n\n const payload: TokenPayload = { tid, iat, exp, scope: 'agent' }\n const token = signToken(payload, deps.signingKey)\n\n const record: TokenRecord = {\n tid,\n uid,\n status: 'awaiting-ws',\n createdAt: nowMs,\n lastSeenAt: nowMs,\n pendingResumeUntil: null,\n origin,\n label: null,\n }\n await deps.tokenStore.create(record)\n\n await deps.auditSink.write({\n at: nowMs,\n tid,\n uid,\n event: 'mint',\n detail: { origin },\n })\n\n const wsUrl = toWsUrl(new URL(req.url).origin) + '/agent/ws'\n const lapUrl = new URL(deps.lapBasePath, origin).toString()\n\n const body: MintResponse = {\n token,\n tid,\n wsUrl,\n lapUrl,\n expiresAt: exp,\n }\n return new Response(JSON.stringify(body), {\n status: 200,\n headers: { 'content-type': 'application/json' },\n })\n}\n\nfunction toWsUrl(httpOrigin: string): string {\n return httpOrigin.startsWith('https://')\n ? 'wss://' + httpOrigin.slice('https://'.length)\n : 'ws://' + httpOrigin.slice('http://'.length)\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import type { TokenStore } from '../token-store.js';
2
+ import type { IdentityResolver } from '../identity.js';
3
+ import type { AuditSink } from '../audit.js';
4
+ export type ResumeDeps = {
5
+ tokenStore: TokenStore;
6
+ identityResolver: IdentityResolver;
7
+ auditSink: AuditSink;
8
+ signingKey?: string | Uint8Array;
9
+ now?: () => number;
10
+ hardExpiryMs?: number;
11
+ };
12
+ export declare function handleResumeList(req: Request, deps: ResumeDeps): Promise<Response>;
13
+ export declare function handleResumeClaim(req: Request, deps: ResumeDeps): Promise<Response>;
14
+ //# sourceMappingURL=resume.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resume.d.ts","sourceRoot":"","sources":["../../../src/server/http/resume.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAW5C,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,EAAE,UAAU,CAAA;IACtB,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,SAAS,EAAE,SAAS,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;IAChC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,CAyBxF;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,CAoCzF"}