@conciv/protocol 0.0.2 → 0.0.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"bundler-types.d.ts","names":[],"sources":["../src/bundler-types.ts"],"mappings":";KAIY,aAAA;EACV,IAAA;EACA,IAAA;EACA,IAAA;EACA,OAAA;IAAU,IAAA;IAAc,WAAA;EAAA;EACxB,OAAA;AAAA;AAAA,KAGU,UAAA;EAAc,GAAA;EAAa,SAAA;EAAqB,eAAA;AAAA;AAAA,KAEhD,aAAA;EACV,EAAA;EACA,MAAA,IAAU,aAAA;EACV,OAAA,CAAQ,IAAA,UAAc,QAAA,YAAoB,OAAA;IAAS,EAAA;EAAA;EACnD,WAAA,CAAY,IAAA,WAAe,UAAA;EAC3B,SAAA,CAAU,GAAA,WAAc,OAAA;IAAS,IAAA;EAAA;EACjC,IAAA;IAAS,KAAA;IAAiB,OAAA;EAAA;EAC1B,MAAA,CAAO,IAAA,WAAe,OAAA;EACtB,OAAA,CAAQ,KAAA,aAAkB,OAAA;AAAA;AAAA,iBAGZ,mBAAA,WAA8B,aAAA,EAAe,MAAA,EAAQ,CAAA,GAAI,CAAA"}
1
+ {"version":3,"file":"bundler-types.d.ts","names":[],"sources":["../src/bundler-types.ts"],"mappings":";KAAY,aAAA;EACV,IAAA;EACA,IAAA;EACA,IAAA;EACA,OAAA;IAAU,IAAA;IAAc,WAAA;EAAA;EACxB,OAAA;AAAA;AAAA,KAGU,UAAA;EAAc,GAAA;EAAa,SAAA;EAAqB,eAAA;AAAA;AAAA,KAEhD,aAAA;EACV,EAAA;EACA,MAAA,IAAU,aAAA;EACV,OAAA,CAAQ,IAAA,UAAc,QAAA,YAAoB,OAAA;IAAS,EAAA;EAAA;EACnD,WAAA,CAAY,IAAA,WAAe,UAAA;EAC3B,SAAA,CAAU,GAAA,WAAc,OAAA;IAAS,IAAA;EAAA;EACjC,IAAA;IAAS,KAAA;IAAiB,OAAA;EAAA;EAC1B,MAAA,CAAO,IAAA,WAAe,OAAA;EACtB,OAAA,CAAQ,KAAA,aAAkB,OAAA;AAAA;AAAA,iBAGZ,mBAAA,WAA8B,aAAA,EAAe,MAAA,EAAQ,CAAA,GAAI,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"bundler-types.js","names":[],"sources":["../src/bundler-types.ts"],"sourcesContent":["// How the agent inspects + drives the live dev server (`conciv tools server …`). These ops\n// are bundler-specific, so core consumes this interface and each bundler implements it in its\n// own plugin package (e.g. viteBridge in @conciv/plugin) — core never imports a bundler.\n\nexport type BundlerConfig = {\n root: string\n base: string\n mode: string\n aliases: {find: string; replacement: string}[]\n plugins: string[]\n}\n\nexport type ModuleNode = {url: string; importers: string[]; importedModules: string[]}\n\nexport type BundlerBridge = {\n id: string // 'vite' | 'webpack' | …\n config(): BundlerConfig\n resolve(spec: string, importer?: string): Promise<{id: string | null}>\n moduleGraph(file: string): ModuleNode[]\n transform(url: string): Promise<{code: string | null}>\n urls(): {local: string[]; network: string[]}\n reload(file: string): Promise<void>\n restart(force?: boolean): Promise<void>\n}\n\nexport function defineBundlerBridge<T extends BundlerBridge>(bridge: T): T {\n if (!bridge.id) throw new Error('bundler bridge: id is required')\n return bridge\n}\n"],"mappings":";AAyBA,SAAgB,oBAA6C,QAAc;CACzE,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,MAAM,gCAAgC;CAChE,OAAO;AACT"}
1
+ {"version":3,"file":"bundler-types.js","names":[],"sources":["../src/bundler-types.ts"],"sourcesContent":["export type BundlerConfig = {\n root: string\n base: string\n mode: string\n aliases: {find: string; replacement: string}[]\n plugins: string[]\n}\n\nexport type ModuleNode = {url: string; importers: string[]; importedModules: string[]}\n\nexport type BundlerBridge = {\n id: string\n config(): BundlerConfig\n resolve(spec: string, importer?: string): Promise<{id: string | null}>\n moduleGraph(file: string): ModuleNode[]\n transform(url: string): Promise<{code: string | null}>\n urls(): {local: string[]; network: string[]}\n reload(file: string): Promise<void>\n restart(force?: boolean): Promise<void>\n}\n\nexport function defineBundlerBridge<T extends BundlerBridge>(bridge: T): T {\n if (!bridge.id) throw new Error('bundler bridge: id is required')\n return bridge\n}\n"],"mappings":";AAqBA,SAAgB,oBAA6C,QAAc;CACzE,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,MAAM,gCAAgC;CAChE,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"chat-types.d.ts","names":[],"sources":["../src/chat-types.ts"],"mappings":";;;;cAQa,qBAAA;AAAA,cAIA,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;;;;cAUrB,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;cAejB,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAUlB,WAAA,GAAc,CAAA,CAAE,KAAK,QAAQ,iBAAA;AAAA,KAC7B,WAAA,GAAc,CAAA,CAAE,KAAK,QAAQ,iBAAA;AAAA,cAI5B,SAAA,EAAS,CAAA,CAAA,IAAA,CAAA,WAAA,CAAA,CAAA,CAAA,SAAA;AAAA,KAIV,SAAA,GAAY,CAAA,CAAE,KAAK,QAAQ,SAAA;AAAA,iBAIvB,WAAA,CAAY,EAAA,YAAc,EAAA,IAAM,SAAS;AAAA,cAK5C,gBAAA,EAAgB,CAAA,CAAA,SAA6C;AAAA,cAG7D,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;KAYpB,aAAA,GAAgB,CAAA,CAAE,KAAK,QAAQ,mBAAA;AAAA,KAE/B,kBAAA,GAAqB,CAAA,CAAE,KAAK,QAAQ,mBAAA;AAAA,cAEnC,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;KACrB,cAAA,GAAiB,CAAA,CAAE,KAAK,QAAQ,oBAAA;AAAA,cAC/B,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;KACtB,eAAA,GAAkB,CAA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KAKjB,UAAA,GAAa,CAAA,CAAE,KAAK,QAAQ,gBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"chat-types.js","names":[],"sources":["../src/chat-types.ts"],"sourcesContent":["// Chat contracts. The streaming protocol is TanStack AI's own (AG-UI StreamChunk) — only the\n// request/session envelopes below are ours.\nimport {z} from 'zod'\nimport type {UIMessage} from '@tanstack/ai'\nimport {UsageSnapshotSchema} from './usage-types.js'\nexport type {StreamChunk, UIMessage, MessagePart} from '@tanstack/ai'\n\n// The HTTP header carrying our session id on every chat request.\nexport const CONCIV_SESSION_HEADER = 'conciv-session-id'\n\n// An inline content part on a posted message. Text carries `content`; image carries a base64\n// data `source` (mimeType matches @tanstack/ai's ContentPartDataSource field name).\nexport const ChatContentPartSchema = z\n .object({\n type: z.string(),\n content: z.string().optional(),\n source: z.object({type: z.string(), mimeType: z.string().optional(), value: z.string()}).loose().optional(),\n })\n .loose()\n\n// A posted message: parts-based UIMessage OR plain {role, content}. `content` is a string or an\n// array of content parts (text + image). .loose tolerates drift.\nexport const ChatMessageSchema = z\n .object({\n role: z.string(),\n content: z.union([z.string(), z.array(ChatContentPartSchema)]).optional(),\n parts: z.array(z.object({type: z.string(), content: z.string().optional()}).loose()).optional(),\n })\n .loose()\n\n// POST /api/chat body. The widget contributes the selected model via the connection body; TanStack\n// AI serializes that onto the AG-UI RunAgentInput under `forwardedProps`/`data` (not top-level), so\n// accept it in all three spots and let the route pick whichever is present.\n// The widget contributes per-turn extras (model, intent) via the connection body; TanStack AI nests\n// them under forwardedProps/data (not top-level), so accept them in all three spots.\nconst TurnIntent = z.enum(['chat', 'compact'])\nconst MetaCarrier = z.object({model: z.string().optional(), intent: TurnIntent.optional()}).loose().optional()\nexport const ChatRequestSchema = z.object({\n messages: z.array(ChatMessageSchema),\n model: z.string().optional(),\n // 'compact' → the turn compacts the resumed context (native where the harness supports it, else a\n // summarize-prompt fallback).\n intent: TurnIntent.optional(),\n forwardedProps: MetaCarrier,\n data: MetaCarrier,\n})\n\nexport type ChatMessage = z.infer<typeof ChatMessageSchema>\nexport type ChatRequest = z.infer<typeof ChatRequestSchema>\n\n// Our session id — minted by the server, conciv_ prefixed, branded so a raw harness id can't be\n// passed where ours is required.\nexport const SessionId = z\n .string()\n .regex(/^conciv_[A-Za-z0-9_-]{1,128}$/)\n .brand<'ConcivSessionId'>()\nexport type SessionId = z.infer<typeof SessionId>\n\n// Runtime guard — narrows an unknown/raw string to our branded SessionId. The one place to decide\n// \"is this ours\" so callers never hand-roll a `.startsWith('conciv_')` check.\nexport function isSessionId(id: unknown): id is SessionId {\n return SessionId.safeParse(id).success\n}\n\n// The harness's own session id (resume token). Charset-bounded for filesystem safety.\nexport const HarnessSessionId = z.string().regex(/^[A-Za-z0-9_-]{1,128}$/)\n\n// One consolidated, durable record per session — the single source of truth.\nexport const SessionRecordSchema = z.object({\n id: SessionId,\n harnessSessionId: z.string().nullable(), // resume token; null = never run\n harnessKind: z.string(), // 'claude' | 'codex' ... routes resume\n origin: z.enum(['chat', 'agent', 'external']),\n title: z.string().nullable(),\n model: z.string().nullable(),\n usage: UsageSnapshotSchema.nullable(),\n cwd: z.string(),\n createdAt: z.number(),\n updatedAt: z.number(),\n})\nexport type SessionRecord = z.infer<typeof SessionRecordSchema>\n// Raw shape accepted into the store (id is an unbranded string here; the schema brands it on parse).\nexport type SessionRecordInput = z.input<typeof SessionRecordSchema>\n\nexport const ResolveRequestSchema = z.object({id: z.string().optional()})\nexport type ResolveRequest = z.infer<typeof ResolveRequestSchema>\nexport const ResolveResponseSchema = z.object({sessionId: SessionId})\nexport type ResolveResponse = z.infer<typeof ResolveResponseSchema>\nexport const RenameResponseSchema = z.object({ok: z.boolean(), title: z.string()})\nexport type RenameResponse = z.infer<typeof RenameResponseSchema>\nexport const OkSchema = z.object({ok: z.boolean()})\nexport type Ok = z.infer<typeof OkSchema>\n\n// The decision posted from the permission approval gate.\nexport const PermissionDecisionSchema = z.object({approvalId: z.string(), approved: z.boolean()})\nexport type PermissionDecision = z.infer<typeof PermissionDecisionSchema>\n\n// GET /api/chat/session response.\nexport const ChatSessionSchema = z.object({\n sessionId: SessionId,\n // The harness resume token (display + resume), null until a turn mints one (= a \"new\" session).\n harnessSessionId: z.string().nullable(),\n // Human-readable session name from the transcript, or null when none is derivable yet.\n name: z.string().nullable(),\n // How this session came to exist; never the harness id.\n origin: z.enum(['chat', 'agent', 'external']),\n cwd: z.string(),\n lock: z.object({held: z.boolean(), role: z.enum(['iterate', 'chat']).nullable()}),\n // Last persisted usage for this session, so the tracker fills on open before any turn.\n usage: UsageSnapshotSchema.nullish(),\n // The active harness's identity + whether it supports \"open in <harness>\", so the widget can\n // label and gate the button before any click.\n harness: z.object({id: z.string(), name: z.string(), canLaunch: z.boolean()}),\n})\nexport type ChatSession = z.infer<typeof ChatSessionSchema>\n\n// GET /api/chat/models response — the active harness's models + the id to pre-select.\nexport const HarnessModelSchema = z.object({\n id: z.string(),\n name: z.string(),\n description: z.string().optional(),\n group: z.string().optional(),\n disabled: z.boolean().optional(),\n})\nexport const ChatModelsSchema = z.object({\n models: z.array(HarnessModelSchema),\n defaultModel: z.string().nullable(),\n // The active harness's identity + whether it supports \"open in <harness>\". Lives on this\n // non-session route so the widget can gate/label the launch button before resolving a session.\n harness: z.object({id: z.string(), name: z.string(), canLaunch: z.boolean()}),\n})\nexport type HarnessModelInfo = z.infer<typeof HarnessModelSchema>\nexport type ChatModels = z.infer<typeof ChatModelsSchema>\n\n// GET /api/chat/history response — TanStack's UIMessage[] (too rich to re-validate field by\n// field); validate array + object shape via z.custom, the sanctioned typed escape.\nexport const ChatHistorySchema = z.array(z.custom<UIMessage>((v) => v !== null && typeof v === 'object'))\nexport type ChatHistory = z.infer<typeof ChatHistorySchema>\n\n// One row in the session selector: our id (or a raw harness id for an unwrapped external row) +\n// its joined live/persisted state.\nexport const ChatSessionMetaSchema = z.object({\n id: z.string(),\n title: z.string(),\n updatedAt: z.number(),\n messageCount: z.number(),\n running: z.boolean(),\n origin: z.enum(['conciv', 'external']),\n usage: UsageSnapshotSchema.nullable(),\n})\nexport const ChatSessionsSchema = z.object({sessions: z.array(ChatSessionMetaSchema)})\nexport type ChatSessionMeta = z.infer<typeof ChatSessionMetaSchema>\nexport type ChatSessions = z.infer<typeof ChatSessionsSchema>\n\n// POST /api/chat/sessions/title body.\nexport const RenameSessionSchema = z.object({sessionId: SessionId, title: z.string().max(120)})\nexport type RenameSession = z.infer<typeof RenameSessionSchema>\n\n// POST /api/chat/launch body — the widget's current model, mirrored into the resumed terminal session.\nexport const ChatLaunchRequestSchema = z.object({model: z.string().optional()})\nexport type ChatLaunchRequest = z.infer<typeof ChatLaunchRequestSchema>\n\n// POST /api/chat/launch response. `supported` false → the active harness defines no interactive\n// launch. `opened` true → core launched the terminal; false → the widget copies `command` (the\n// paste-able resume command, null only when unsupported).\nexport const ChatLaunchSchema = z.object({\n supported: z.boolean(),\n opened: z.boolean(),\n command: z.string().nullable(),\n})\nexport type ChatLaunch = z.infer<typeof ChatLaunchSchema>\n"],"mappings":";;;AAQA,MAAa,wBAAwB;AAIrC,MAAa,wBAAwB,EAClC,OAAO;CACN,MAAM,EAAE,OAAO;CACf,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS;CAC7B,QAAQ,EAAE,OAAO;EAAC,MAAM,EAAE,OAAO;EAAG,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;EAAG,OAAO,EAAE,OAAO;CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS;AAC5G,CAAC,CAAC,CACD,MAAM;AAIT,MAAa,oBAAoB,EAC9B,OAAO;CACN,MAAM,EAAE,OAAO;CACf,SAAS,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,qBAAqB,CAAC,CAAC,CAAC,CAAC,SAAS;CACxE,OAAO,EAAE,MAAM,EAAE,OAAO;EAAC,MAAM,EAAE,OAAO;EAAG,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS;CAAC,CAAC,CAAC,CAAC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wBAAwB,EAAE,OAAO;CAC5C,IAAI,EAAE,OAAO;CACb,OAAO,EAAE,OAAO;CAChB,WAAW,EAAE,OAAO;CACpB,cAAc,EAAE,OAAO;CACvB,SAAS,EAAE,QAAQ;CACnB,QAAQ,EAAE,KAAK,CAAC,UAAU,UAAU,CAAC;CACrC,OAAO,oBAAoB,SAAS;AACtC,CAAC;AACD,MAAa,qBAAqB,EAAE,OAAO,EAAC,UAAU,EAAE,MAAM,qBAAqB,EAAC,CAAC;AAKrF,MAAa,sBAAsB,EAAE,OAAO;CAAC,WAAW;CAAW,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,GAAG;AAAC,CAAC;AAI9F,MAAa,0BAA0B,EAAE,OAAO,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,EAAC,CAAC;AAM9E,MAAa,mBAAmB,EAAE,OAAO;CACvC,WAAW,EAAE,QAAQ;CACrB,QAAQ,EAAE,QAAQ;CAClB,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS;AAC/B,CAAC"}
1
+ {"version":3,"file":"chat-types.js","names":[],"sources":["../src/chat-types.ts"],"sourcesContent":["import {z} from 'zod'\nimport type {UIMessage} from '@tanstack/ai'\nimport {UsageSnapshotSchema} from './usage-types.js'\nexport type {StreamChunk, UIMessage, MessagePart} from '@tanstack/ai'\n\nexport const CONCIV_SESSION_HEADER = 'conciv-session-id'\n\nexport const ChatContentPartSchema = z\n .object({\n type: z.string(),\n content: z.string().optional(),\n source: z.object({type: z.string(), mimeType: z.string().optional(), value: z.string()}).loose().optional(),\n })\n .loose()\n\nexport const ChatMessageSchema = z\n .object({\n role: z.string(),\n content: z.union([z.string(), z.array(ChatContentPartSchema)]).optional(),\n parts: z.array(z.object({type: z.string(), content: z.string().optional()}).loose()).optional(),\n })\n .loose()\n\nconst TurnIntent = z.enum(['chat', 'compact'])\nconst MetaCarrier = z.object({model: z.string().optional(), intent: TurnIntent.optional()}).loose().optional()\nexport const ChatRequestSchema = z.object({\n messages: z.array(ChatMessageSchema),\n model: z.string().optional(),\n\n intent: TurnIntent.optional(),\n forwardedProps: MetaCarrier,\n data: MetaCarrier,\n})\n\nexport type ChatMessage = z.infer<typeof ChatMessageSchema>\nexport type ChatRequest = z.infer<typeof ChatRequestSchema>\n\nexport const SessionId = z\n .string()\n .regex(/^conciv_[A-Za-z0-9_-]{1,128}$/)\n .brand<'ConcivSessionId'>()\nexport type SessionId = z.infer<typeof SessionId>\n\nexport function isSessionId(id: unknown): id is SessionId {\n return SessionId.safeParse(id).success\n}\n\nexport const HarnessSessionId = z.string().regex(/^[A-Za-z0-9_-]{1,128}$/)\n\nexport const SessionRecordSchema = z.object({\n id: SessionId,\n harnessSessionId: z.string().nullable(),\n harnessKind: z.string(),\n origin: z.enum(['chat', 'agent', 'external']),\n title: z.string().nullable(),\n model: z.string().nullable(),\n usage: UsageSnapshotSchema.nullable(),\n cwd: z.string(),\n createdAt: z.number(),\n updatedAt: z.number(),\n})\nexport type SessionRecord = z.infer<typeof SessionRecordSchema>\n\nexport type SessionRecordInput = z.input<typeof SessionRecordSchema>\n\nexport const ResolveRequestSchema = z.object({id: z.string().optional()})\nexport type ResolveRequest = z.infer<typeof ResolveRequestSchema>\nexport const ResolveResponseSchema = z.object({sessionId: SessionId})\nexport type ResolveResponse = z.infer<typeof ResolveResponseSchema>\nexport const RenameResponseSchema = z.object({ok: z.boolean(), title: z.string()})\nexport type RenameResponse = z.infer<typeof RenameResponseSchema>\nexport const OkSchema = z.object({ok: z.boolean()})\nexport type Ok = z.infer<typeof OkSchema>\n\nexport const PermissionDecisionSchema = z.object({approvalId: z.string(), approved: z.boolean()})\nexport type PermissionDecision = z.infer<typeof PermissionDecisionSchema>\n\nexport const ChatSessionSchema = z.object({\n sessionId: SessionId,\n\n harnessSessionId: z.string().nullable(),\n\n name: z.string().nullable(),\n\n origin: z.enum(['chat', 'agent', 'external']),\n cwd: z.string(),\n lock: z.object({held: z.boolean(), role: z.enum(['iterate', 'chat']).nullable()}),\n\n usage: UsageSnapshotSchema.nullish(),\n\n harness: z.object({id: z.string(), name: z.string(), canLaunch: z.boolean()}),\n})\nexport type ChatSession = z.infer<typeof ChatSessionSchema>\n\nexport const HarnessModelSchema = z.object({\n id: z.string(),\n name: z.string(),\n description: z.string().optional(),\n group: z.string().optional(),\n disabled: z.boolean().optional(),\n})\nexport const ChatModelsSchema = z.object({\n models: z.array(HarnessModelSchema),\n defaultModel: z.string().nullable(),\n\n harness: z.object({id: z.string(), name: z.string(), canLaunch: z.boolean()}),\n})\nexport type HarnessModelInfo = z.infer<typeof HarnessModelSchema>\nexport type ChatModels = z.infer<typeof ChatModelsSchema>\n\nexport const ChatHistorySchema = z.array(z.custom<UIMessage>((v) => v !== null && typeof v === 'object'))\nexport type ChatHistory = z.infer<typeof ChatHistorySchema>\n\nexport const ChatSessionMetaSchema = z.object({\n id: z.string(),\n title: z.string(),\n updatedAt: z.number(),\n messageCount: z.number(),\n running: z.boolean(),\n origin: z.enum(['conciv', 'external']),\n usage: UsageSnapshotSchema.nullable(),\n})\nexport const ChatSessionsSchema = z.object({sessions: z.array(ChatSessionMetaSchema)})\nexport type ChatSessionMeta = z.infer<typeof ChatSessionMetaSchema>\nexport type ChatSessions = z.infer<typeof ChatSessionsSchema>\n\nexport const RenameSessionSchema = z.object({sessionId: SessionId, title: z.string().max(120)})\nexport type RenameSession = z.infer<typeof RenameSessionSchema>\n\nexport const ChatLaunchRequestSchema = z.object({model: z.string().optional()})\nexport type ChatLaunchRequest = z.infer<typeof ChatLaunchRequestSchema>\n\nexport const ChatLaunchSchema = z.object({\n supported: z.boolean(),\n opened: z.boolean(),\n command: z.string().nullable(),\n})\nexport type ChatLaunch = z.infer<typeof ChatLaunchSchema>\n"],"mappings":";;;AAKA,MAAa,wBAAwB;AAErC,MAAa,wBAAwB,EAClC,OAAO;CACN,MAAM,EAAE,OAAO;CACf,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS;CAC7B,QAAQ,EAAE,OAAO;EAAC,MAAM,E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CACjC,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,UAAU,EAAE,QAAQ,CAAC,CAAC,SAAS;AACjC,CAAC;AACD,MAAa,mBAAmB,EAAE,OAAO;CACvC,QAAQ,EAAE,MAAM,kBAAkB;CAClC,cAAc,EAAE,OAAO,CAAC,CAAC,SAAS;CAElC,SAAS,EAAE,OAAO;EAAC,IAAI,EAAE,OAAO;EAAG,MAAM,EAAE,OAAO;EAAG,WAAW,EAAE,QAAQ;CAAC,CAAC;AAC9E,CAAC;AAID,MAAa,oBAAoB,EAAE,MAAM,EAAE,QAAmB,MAAM,MAAM,QAAQ,OAAO,MAAM,QAAQ,CAAC;AAGxG,MAAa,wBAAwB,EAAE,OAAO;CAC5C,IAAI,EAAE,OAAO;CACb,OAAO,EAAE,OAAO;CAChB,WAAW,EAAE,OAAO;CACpB,cAAc,EAAE,OAAO;CACvB,SAAS,EAAE,QAAQ;CACnB,QAAQ,EAAE,KAAK,CAAC,UAAU,UAAU,CAAC;CACrC,OAAO,oBAAoB,SAAS;AACtC,CAAC;AACD,MAAa,qBAAqB,EAAE,OAAO,EAAC,UAAU,EAAE,MAAM,qBAAqB,EAAC,CAAC;AAIrF,MAAa,sBAAsB,EAAE,OAAO;CAAC,WAAW;CAAW,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,GAAG;AAAC,CAAC;AAG9F,MAAa,0BAA0B,EAAE,OAAO,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,EAAC,CAAC;AAG9E,MAAa,mBAAmB,EAAE,OAAO;CACvC,WAAW,EAAE,QAAQ;CACrB,QAAQ,EAAE,QAAQ;CAClB,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS;AAC/B,CAAC"}
@@ -1,41 +1,28 @@
1
1
  //#region src/config-types.d.ts
2
2
  type TriggerPosition = 'top-left' | 'top-right' | 'middle-left' | 'middle-right' | 'bottom-left' | 'bottom-right';
3
3
  interface ModalConfig {
4
- /** Initial trigger position. The user can drag it; it snaps to a preset and persists. Default 'bottom-right'. */
5
4
  position?: TriggerPosition;
6
5
  }
7
6
  interface QuickTerminalConfig {
8
- /** Hotkey(s) toggling the quick terminal. One binding or many (e.g. ['Mod+`', 'Control+k']). Default 'Mod+`'. */
9
7
  hotkey?: string | string[];
10
8
  }
11
9
  interface WidgetConfig {
12
- /** Bottom-right corner modal. On by default; `false` disables it, an object configures it. */
13
10
  modal?: boolean | ModalConfig;
14
- /** Top drop-down quick terminal. On by default; `false` disables it, an object sets the hotkey(s). */
15
11
  quickTerminal?: boolean | QuickTerminalConfig;
16
12
  }
17
13
  interface ExtensionConfigRegistry {}
18
14
  interface ConcivConfig {
19
15
  enabled?: boolean;
20
- /** Per-extension config, keyed + typed by each extension's declaration-merged ExtensionConfigRegistry entry. */
21
16
  extensions?: { [Name in keyof ExtensionConfigRegistry]?: ExtensionConfigRegistry[Name] };
22
17
  widgetUrl?: string;
23
- /** Widget layouts + their options. Both layouts are enabled by default. */
24
18
  widget?: WidgetConfig;
25
19
  stateRoot?: string;
26
20
  harness?: string;
27
21
  harnessBin?: string;
28
22
  sessionId?: string;
29
- /** Fixed engine port. Used by the Next.js integration so server boot + client widget agree. */
30
23
  port?: number;
31
- /**
32
- * Our minimal chat grounding prompt. `true`/omitted injects it (default); `false` opts out
33
- * entirely (you take full control of the agent); a string replaces it with your own.
34
- */
35
24
  systemPrompt?: string | boolean;
36
- /** @deprecated use harnessBin */
37
25
  claudePath?: string;
38
- /** @deprecated use sessionId */
39
26
  claudeSessionId?: string;
40
27
  }
41
28
  declare function defineConfig<T extends ConcivConfig>(config: T): T;
@@ -1 +1 @@
1
- {"version":3,"file":"config-types.d.ts","names":[],"sources":["../src/config-types.ts"],"mappings":";KAIY,eAAA;AAAA,UAEK,WAAA;EAFU;EAIzB,QAAA,GAAW,eAAe;AAAA;AAAA,UAGX,mBAAA;EALA;EAOf,MAAM;AAAA;AAAA,UAGS,YAAA;EARW;EAU1B,KAAA,aAAkB,WAAA;EAPgB;EASlC,aAAA,aAA0B,mBAAmB;AAAA;AAAA,UAG9B,uBAAA;AAAA,UAEA,YAAA;EACf,OAAA;EAN6C;EAQ7C,UAAA,oBAA6B,uBAAA,IAA2B,uBAAA,CAAwB,IAAA;EAChF,SAAA;EAT6C;EAW7C,MAAA,GAAS,YAAA;EACT,SAAA;EACA,OAAA;EACA,UAAA;EACA,SAAA;EAZsC;EActC,IAAA;EAZ2B;;;;EAiB3B,YAAA;EAXS;EAYyB,UAAA;EAZb;EAaY,eAAA;AAAA;AAAA,iBAGnB,YAAA,WAAuB,YAAA,EAAc,MAAA,EAAQ,CAAA,GAAI,CAAA"}
1
+ {"version":3,"file":"config-types.d.ts","names":[],"sources":["../src/config-types.ts"],"mappings":";KAAY,eAAA;AAAA,UAEK,WAAA;EACf,QAAA,GAAW,eAAe;AAAA;AAAA,UAGX,mBAAA;EACf,MAAM;AAAA;AAAA,UAGS,YAAA;EACf,KAAA,aAAkB,WAAA;EAElB,aAAA,aAA0B,mBAAmB;AAAA;AAAA,UAG9B,uBAAA;AAAA,UAEA,YAAA;EACf,OAAA;EAEA,UAAA,oBAA6B,uBAAA,IAA2B,uBAAA,CAAwB,IAAA;EAChF,SAAA;EAEA,MAAA,GAAS,YAAA;EACT,SAAA;EACA,OAAA;EACA,UAAA;EACA,SAAA;EAEA,IAAA;EAEA,YAAA;EACA,UAAA;EACA,eAAA;AAAA;AAAA,iBAGc,YAAA,WAAuB,YAAA,EAAc,MAAA,EAAQ,CAAA,GAAI,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"config-types.js","names":[],"sources":["../src/config-types.ts"],"sourcesContent":["// The public conciv config contract, shared by the engine + every plugin entry. Zero-runtime:\n// the type + an identity typed factory (mirrors defineHarness/defineRunner). Resolution + env\n// fallbacks live in @conciv/core/config.\n// Where the corner-modal trigger button sits. Draggable at runtime; this is the initial spot.\nexport type TriggerPosition = 'top-left' | 'top-right' | 'middle-left' | 'middle-right' | 'bottom-left' | 'bottom-right'\n\nexport interface ModalConfig {\n /** Initial trigger position. The user can drag it; it snaps to a preset and persists. Default 'bottom-right'. */\n position?: TriggerPosition\n}\n\nexport interface QuickTerminalConfig {\n /** Hotkey(s) toggling the quick terminal. One binding or many (e.g. ['Mod+`', 'Control+k']). Default 'Mod+`'. */\n hotkey?: string | string[]\n}\n\nexport interface WidgetConfig {\n /** Bottom-right corner modal. On by default; `false` disables it, an object configures it. */\n modal?: boolean | ModalConfig\n /** Top drop-down quick terminal. On by default; `false` disables it, an object sets the hotkey(s). */\n quickTerminal?: boolean | QuickTerminalConfig\n}\n\nexport interface ExtensionConfigRegistry {}\n\nexport interface ConcivConfig {\n enabled?: boolean\n /** Per-extension config, keyed + typed by each extension's declaration-merged ExtensionConfigRegistry entry. */\n extensions?: {[Name in keyof ExtensionConfigRegistry]?: ExtensionConfigRegistry[Name]}\n widgetUrl?: string\n /** Widget layouts + their options. Both layouts are enabled by default. */\n widget?: WidgetConfig\n stateRoot?: string\n harness?: string\n harnessBin?: string\n sessionId?: string\n /** Fixed engine port. Used by the Next.js integration so server boot + client widget agree. */\n port?: number\n /**\n * Our minimal chat grounding prompt. `true`/omitted injects it (default); `false` opts out\n * entirely (you take full control of the agent); a string replaces it with your own.\n */\n systemPrompt?: string | boolean\n /** @deprecated use harnessBin */ claudePath?: string\n /** @deprecated use sessionId */ claudeSessionId?: string\n}\n\nexport function defineConfig<T extends ConcivConfig>(config: T): T {\n return config\n}\n"],"mappings":";AA+CA,SAAgB,aAAqC,QAAc;CACjE,OAAO;AACT"}
1
+ {"version":3,"file":"config-types.js","names":[],"sources":["../src/config-types.ts"],"sourcesContent":["export type TriggerPosition = 'top-left' | 'top-right' | 'middle-left' | 'middle-right' | 'bottom-left' | 'bottom-right'\n\nexport interface ModalConfig {\n position?: TriggerPosition\n}\n\nexport interface QuickTerminalConfig {\n hotkey?: string | string[]\n}\n\nexport interface WidgetConfig {\n modal?: boolean | ModalConfig\n\n quickTerminal?: boolean | QuickTerminalConfig\n}\n\nexport interface ExtensionConfigRegistry {}\n\nexport interface ConcivConfig {\n enabled?: boolean\n\n extensions?: {[Name in keyof ExtensionConfigRegistry]?: ExtensionConfigRegistry[Name]}\n widgetUrl?: string\n\n widget?: WidgetConfig\n stateRoot?: string\n harness?: string\n harnessBin?: string\n sessionId?: string\n\n port?: number\n\n systemPrompt?: string | boolean\n claudePath?: string\n claudeSessionId?: string\n}\n\nexport function defineConfig<T extends ConcivConfig>(config: T): T {\n return config\n}\n"],"mappings":";AAqCA,SAAgB,aAAqC,QAAc;CACjE,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"done-types.d.ts","names":[],"sources":["../src/done-types.ts"],"mappings":";;;cAMa,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;;KAWf,QAAA,GAAW,CAAA,CAAE,KAAK,QAAQ,cAAA"}
1
+ {"version":3,"file":"done-types.d.ts","names":[],"sources":["../src/done-types.ts"],"mappings":";;;cAEa,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;;KAUf,QAAA,GAAW,CAAA,CAAE,KAAK,QAAQ,cAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"done-types.js","names":[],"sources":["../src/done-types.ts"],"sourcesContent":["import {z} from 'zod'\n\n// The agent-authored \"done\" summary. This is the structured-output contract: claude/codex emit it\n// at the end of a turn (Plan D), the widget renders it as the done card. Every field is REQUIRED and\n// additionalProperties is false, because codex's OpenAI-strict response_format rejects optional keys\n// (verified live); \"optional\" fields are required-but-emptyable (filesChanged: [], summary: '').\nexport const DoneCardSchema = z\n .object({\n // The conversational reply, rendered as the turn's normal text. The rest is the structured roll-up.\n message: z.string(),\n summary: z.string(),\n filesChanged: z.array(z.string()),\n pageActions: z.array(z.string()),\n testsPassed: z.boolean(),\n })\n .strict()\n\nexport type DoneCard = z.infer<typeof DoneCardSchema>\n"],"mappings":";;AAMA,MAAa,iBAAiB,EAC3B,OAAO;CAEN,SAAS,EAAE,OAAO;CAClB,SAAS,EAAE,OAAO;CAClB,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC;CAChC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC;CAC/B,aAAa,EAAE,QAAQ;AACzB,CAAC,CAAC,CACD,OAAO"}
1
+ {"version":3,"file":"done-types.js","names":[],"sources":["../src/done-types.ts"],"sourcesContent":["import {z} from 'zod'\n\nexport const DoneCardSchema = z\n .object({\n message: z.string(),\n summary: z.string(),\n filesChanged: z.array(z.string()),\n pageActions: z.array(z.string()),\n testsPassed: z.boolean(),\n })\n .strict()\n\nexport type DoneCard = z.infer<typeof DoneCardSchema>\n"],"mappings":";;AAEA,MAAa,iBAAiB,EAC3B,OAAO;CACN,SAAS,EAAE,OAAO;CAClB,SAAS,EAAE,OAAO;CAClB,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC;CAChC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC;CAC/B,aAAa,EAAE,QAAQ;AACzB,CAAC,CAAC,CACD,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"editor-types.d.ts","names":[],"sources":["../src/editor-types.ts"],"mappings":";;;cAIa,gBAAA,EAAgB,CAAA,CAAA,SAAA;;;;KACjB,UAAA,GAAa,CAAA,CAAE,KAAK,QAAQ,gBAAA"}
1
+ {"version":3,"file":"editor-types.d.ts","names":[],"sources":["../src/editor-types.ts"],"mappings":";;;cAEa,gBAAA,EAAgB,CAAA,CAAA,SAAA;;;;KACjB,UAAA,GAAa,CAAA,CAAE,KAAK,QAAQ,gBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"editor-types.js","names":[],"sources":["../src/editor-types.ts"],"sourcesContent":["import {z} from 'zod'\n\n// POST /api/editor/open body — \"open this file at this line\". Shared by core (validation) and the\n// widget transport (typing).\nexport const EditorOpenSchema = z.object({file: z.string().min(1), line: z.number().optional()})\nexport type EditorOpen = z.infer<typeof EditorOpenSchema>\n"],"mappings":";;AAIA,MAAa,mBAAmB,EAAE,OAAO;CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAAG,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;AAAC,CAAC"}
1
+ {"version":3,"file":"editor-types.js","names":[],"sources":["../src/editor-types.ts"],"sourcesContent":["import {z} from 'zod'\n\nexport const EditorOpenSchema = z.object({file: z.string().min(1), line: z.number().optional()})\nexport type EditorOpen = z.infer<typeof EditorOpenSchema>\n"],"mappings":";;AAEA,MAAa,mBAAmB,EAAE,OAAO;CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAAG,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;AAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"harness-types.d.ts","names":[],"sources":["../src/harness-types.ts"],"mappings":";;;;;KAOY,mBAAA;EACV,MAAA;EACA,cAAA;EACA,iBAAA;EAIA,UAAA;EACA,YAAA;EACA,GAAA;EAIA,UAAA;AAAA;AAAA,KAIU,YAAA;EAAgB,SAAA;EAAmB,UAAU;AAAA;AAAA,KAI7C,YAAA;EAAgB,EAAA;EAAY,IAAA;EAAc,WAAA;EAAsB,KAAA;EAAgB,QAAA;AAAA;AAAA,KAIhF,aAAA,GAAgB,YAAA,YAAwB,YAAA,KAAiB,OAAA,CAAQ,YAAA;AAAA,KAEjE,WAAA;EACV,MAAA;EACA,GAAA;EACA,eAAA;EACA,YAAA;EACA,aAAA;EACA,MAAA;EAGA,SAAA;EACA,MAAA,GAAS,YAAY;EAErB,KAAA;EAGA,IAAA;AAAA;AAAA,KAGU,YAAA;EAAgB,GAAA;EAAa,MAAA,EAAQ,QAAA;EAAU,MAAA,EAAQ,QAAA;EAAU,KAAA,GAAQ,QAAA;EAAU,IAAA;AAAA;AAAA,KAKnF,mBAAA;EAAuB,MAAA;EAAiB,OAAO;AAAA;AAAA,KAC/C,oBAAA;EACV,GAAA;EACA,SAAA;EACA,KAAA;EACA,MAAA;EAGA,YAAA,CAAa,IAAA,aAAiB,OAAA,CAAQ,mBAAA;EACtC,OAAA,CAAQ,GAAA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A;EACA,WAAA;EACA,SAAA;AAAA;AAAA,KAGU,cAAA;EACV,cAAA,CAAe,GAAA,UAAa,SAAA;EAC5B,KAAA,CAAM,GAAA,WAAc,SAAA;EAEpB,kBAAA,EAAoB,GAAA;EAEpB,IAAA,EAAM,GAAA,UAAa,IAAA,YAAgB,kBAAA,KAAuB,OAAA,CAAQ,kBAAA;AAAA;AAAA,KAG/D,kBAAA;EACH,EAAA;EACA,OAAA;EAEA,WAAA;EAEA,MAAA,GAAS,aAAA;EACT,SAAA,EAAW,kBAAA;EAEX,gBAAA,GAAmB,kBAAA;EACnB,MAAA,EAAQ,cAAA;EACR,YAAA,GAAe,mBAAA;EACf,GAAA,GAAM,UAAA;EACN,QAAA,gBAAwB,OAAA;EAExB,MAAA,GAAS,aAAA;EACT,YAAA;AAAA;AAAA,KAGU,cAAA,GAAiB,kBAAA;EAEtB,YAAA,EAAc,mBAAA;IAAuB,iBAAA;EAAA;EAA0B,OAAA,EAAS,cAAA;AAAA;EACxE,YAAA,EAAc,mBAAA;IAAuB,iBAAA;EAAA;EAA2B,OAAA;AAAA;EAGhE,YAAA,EAAc,mBAAA;IAAuB,UAAA;EAAA;EAAmB,gBAAA,EAAkB,kBAAA;AAAA;EAC1E,YAAA,EAAc,mBAAA;IAAuB,UAAA;EAAA;EAAoB,gBAAA;AAAA;AAAA,iBAGhD,aAAA,WAAwB,cAAA,EAAgB,OAAA,EAAS,CAAA,GAAI,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"harness-types.js","names":[],"sources":["../src/harness-types.ts"],"sourcesContent":["import type {Readable, Writable} from 'node:stream'\nimport type {StreamChunk, UIMessage} from '@tanstack/ai'\nimport type {UsageSnapshot} from './usage-types.js'\n\n// A harness is the underlying coding agent CLI (claude, codex, …). Core resolves a\n// HarnessAdapter and feature-detects by capability, degrading gracefully when one is absent.\n\nexport type HarnessCapabilities = {\n resume: boolean\n permissionGate: 'hook' | 'callback' | 'none'\n transcriptHistory: boolean\n // Native context compaction (the agent rewrites its own context to a summary, freeing the window).\n // true → the adapter must supply `buildCompactArgs` (type-enforced below). false → core falls back\n // to a summarize-prompt turn, which produces a summary but does not free the resumed context.\n compaction: boolean\n systemPrompt: 'file' | 'flag' | 'none'\n mcp: 'http' | 'stdio' | 'none'\n // 'native' → ingests image content blocks (claude: --input-format stream-json on stdin)\n // 'fileRef' → no vision channel; server writes temp files + appends path refs to the prompt\n // false → no image support\n imageInput: 'native' | 'fileRef' | false\n}\n\n// An image content part carried from chat()'s messages to the harness (base64 data source).\nexport type HarnessImage = {mediaType: string; dataBase64: string}\n\n// A model the harness can run. `id` is what the CLI receives (e.g. claude --model <id>); `name`\n// is the display label; `group` buckets the combobox by provider/family.\nexport type HarnessModel = {id: string; name: string; description?: string; group?: string; disabled?: boolean}\n\n// A harness's models: either a static list or a (possibly async) resolver, so an adapter that\n// can enumerate its CLI's models at runtime returns a function instead of a literal array.\nexport type HarnessModels = HarnessModel[] | (() => HarnessModel[] | Promise<HarnessModel[]>)\n\nexport type HarnessTurn = {\n prompt: string\n cwd: string\n resumeSessionId: string | null\n systemPrompt: string\n permissionUrl?: string\n mcpUrl?: string\n // The conciv chat session this turn runs in; rides the MCP config as a header so session-scoped\n // tools (canvas.draw, comments) resolve the same room the widget joined.\n sessionId?: string\n images?: HarnessImage[]\n // The selected model id, forwarded by buildArgs to the CLI's model flag. Absent → CLI default.\n model?: string\n // 'compact' → core wants this turn to compact the resumed context, not chat. The adapter's\n // buildCompactArgs builds it (only reached for compaction-capable harnesses). Default 'chat'.\n kind?: 'chat' | 'compact'\n}\n\nexport type HarnessChild = {pid: number; stdout: Readable; stderr: Readable; stdin?: Writable; kill(): void}\n\n// \"Open in <harness>\": reopen a chat session as the harness's own interactive CLI in a terminal.\n// Core owns the open logic (OS detection, cwd, shell quoting, spawning) and hands it to the harness\n// via the context's open* methods; the harness only builds the interactive argv.\nexport type HarnessLaunchResult = {opened: boolean; command: string}\nexport type HarnessLaunchContext = {\n cwd: string\n sessionId: string | null\n model: string | null // the model the widget currently has selected, mirrored from the chat turn\n mcpUrl: string | null // the conciv MCP-over-HTTP endpoint, for tool parity (null if not http-capable)\n // Run `argv` in an interactive terminal at cwd. Core shell-quotes it, prepends `cd`, spawns the\n // per-OS terminal, and returns {opened, command} — command is the resolved paste-able fallback.\n openTerminal(argv: string[]): Promise<HarnessLaunchResult>\n openUrl(url: string): Promise<HarnessLaunchResult>\n}\nexport type HarnessLaunch = (ctx: HarnessLaunchContext) => HarnessLaunchResult | Promise<HarnessLaunchResult>\n\n// Builds the CLI argv for one turn.\nexport type HarnessArgsBuilder = (turn: HarnessTurn) => string[]\n\n// In-process turn runner (SDK transport): core branches to this in place of buildArgs/spawn/decode.\nexport type HarnessRunContext = {\n sessionId: string\n env: Record<string, string | undefined>\n onSessionId(id: string): void\n onUsage?(usage: UsageSnapshot): void\n signal: AbortSignal\n decide(toolName: string, input: unknown, toolUseId: string): Promise<'allow' | 'deny'>\n runId?: string\n threadId?: string\n logger?: HarnessDecodeLogger\n}\nexport type HarnessRun = (turn: HarnessTurn, ctx: HarnessRunContext) => AsyncGenerator<StreamChunk>\n\n// Optional: write the turn's input to the child after spawn (e.g. claude native images →\n// a stream-json user message on stdin). Harnesses that take everything via argv omit it.\nexport type HarnessDeliverInput = (child: HarnessChild, turn: HarnessTurn) => void | Promise<void>\n\n// Minimal logger shape the adapter threads in (matches @tanstack/ai InternalLogger surface we use).\nexport type HarnessDecodeLogger = {provider(msg: string, meta?: unknown): void}\n\nexport type HarnessDecodeOpts = {\n onSessionId(id: string): void\n // Live usage as the harness learns it mid-turn (claude message_start carries full context at the\n // start of the response). Core injects it onto the stream for the widget's tracker.\n onUsage?(usage: UsageSnapshot): void\n runId?: string\n threadId?: string\n logger?: HarnessDecodeLogger\n}\n\n// Turns the harness's raw stdout lines into the AG-UI StreamChunk stream, surfacing the session id.\nexport type HarnessDecoder = (lines: AsyncIterable<string>, opts: HarnessDecodeOpts) => AsyncGenerator<StreamChunk>\n\n// One enumerated session from a harness's transcript store (for the session selector list). The\n// enrichment fields (gathered when cheap) are joined onto selector rows / persisted onto the record.\nexport type HarnessSessionMeta = {\n id: string\n derivedTitle: string\n updatedAt: number\n messageCount: number\n model?: string | null\n totalTokens?: number\n lastMessage?: string | null\n createdAt?: number\n}\n\n// Where a harness persists a session's transcript, and how to parse it into UIMessages.\nexport type HarnessHistory = {\n transcriptPath(cwd: string, sessionId: string): string\n parse(raw: string): UIMessage[]\n // Optional human-readable session name derived from the transcript (e.g. claude's `summary`\n // record). Harnesses that omit it fall back to a short id in the UI.\n nameFromTranscript?(raw: string): string | null\n // Enumerate the cwd's sessions, newest first, bounded. `home` is injectable for testing. Optional\n // so a transcript adapter without enumeration still typechecks (the selector just stays empty).\n list?(cwd: string, home?: string): HarnessSessionMeta[] | Promise<HarnessSessionMeta[]>\n}\n\ntype HarnessAdapterBase = {\n id: string\n binName: string\n // Human label for \"Open in <displayName>\" and other UI; falls back to id when absent.\n displayName?: string\n // How to reopen a session as this harness's interactive CLI. Absent → \"open in <harness>\" is\n // unavailable (core reports unsupported, the widget hides the button).\n launch?: HarnessLaunch\n buildArgs: HarnessArgsBuilder\n // Builds the argv for a compaction turn. Present iff capabilities.compaction (enforced by the\n // adapter union below), mirroring how transcriptHistory enforces `history`.\n buildCompactArgs?: HarnessArgsBuilder\n decode: HarnessDecoder\n deliverInput?: HarnessDeliverInput\n run?: HarnessRun\n shutdown?: () => void | Promise<void>\n // Models this harness can run + the id to pre-select. Both optional: a harness with no model\n // choice omits them and the widget hides its selector.\n models?: HarnessModels\n defaultModel?: string\n}\n\n// `history` is present iff `capabilities.transcriptHistory` and `buildCompactArgs` iff\n// `capabilities.compaction` — the type enforces both, so there is no runtime check: a\n// transcriptHistory:true adapter without a history (or a compaction:true adapter without\n// buildCompactArgs) is a compile error.\nexport type HarnessAdapter = HarnessAdapterBase &\n (\n | {capabilities: HarnessCapabilities & {transcriptHistory: true}; history: HarnessHistory}\n | {capabilities: HarnessCapabilities & {transcriptHistory: false}; history?: undefined}\n ) &\n (\n | {capabilities: HarnessCapabilities & {compaction: true}; buildCompactArgs: HarnessArgsBuilder}\n | {capabilities: HarnessCapabilities & {compaction: false}; buildCompactArgs?: undefined}\n )\n\nexport function defineHarness<T extends HarnessAdapter>(adapter: T): T {\n return adapter\n}\n"],"mappings":";AAwKA,SAAgB,cAAwC,SAAe;CACrE,OAAO;AACT"}
1
+ {"version":3,"file":"harness-types.js","names":[],"sources":["../src/harness-types.ts"],"sourcesContent":["import type {Readable, Writable} from 'node:stream'\nimport type {StreamChunk, UIMessage} from '@tanstack/ai'\nimport type {UsageSnapshot} from './usage-types.js'\n\nexport type HarnessCapabilities = {\n resume: boolean\n permissionGate: 'hook' | 'callback' | 'none'\n transcriptHistory: boolean\n\n compaction: boolean\n systemPrompt: 'file' | 'flag' | 'none'\n mcp: 'http' | 'stdio' | 'none'\n\n imageInput: 'native' | 'fileRef' | false\n}\n\nexport type HarnessImage = {mediaType: string; dataBase64: string}\n\nexport type HarnessModel = {id: string; name: string; description?: string; group?: string; disabled?: boolean}\n\nexport type HarnessModels = HarnessModel[] | (() => HarnessModel[] | Promise<HarnessModel[]>)\n\nexport type HarnessTurn = {\n prompt: string\n cwd: string\n resumeSessionId: string | null\n systemPrompt: string\n permissionUrl?: string\n mcpUrl?: string\n\n sessionId?: string\n images?: HarnessImage[]\n\n model?: string\n\n kind?: 'chat' | 'compact'\n}\n\nexport type HarnessChild = {pid: number; stdout: Readable; stderr: Readable; stdin?: Writable; kill(): void}\n\nexport type HarnessLaunchResult = {opened: boolean; command: string}\nexport type HarnessLaunchContext = {\n cwd: string\n sessionId: string | null\n model: string | null\n mcpUrl: string | null\n\n openTerminal(argv: string[]): Promise<HarnessLaunchResult>\n openUrl(url: string): Promise<HarnessLaunchResult>\n}\nexport type HarnessLaunch = (ctx: HarnessLaunchContext) => HarnessLaunchResult | Promise<HarnessLaunchResult>\n\nexport type HarnessArgsBuilder = (turn: HarnessTurn) => string[]\n\nexport type HarnessRunContext = {\n sessionId: string\n env: Record<string, string | undefined>\n onSessionId(id: string): void\n onUsage?(usage: UsageSnapshot): void\n signal: AbortSignal\n decide(toolName: string, input: unknown, toolUseId: string): Promise<'allow' | 'deny'>\n runId?: string\n threadId?: string\n logger?: HarnessDecodeLogger\n}\nexport type HarnessRun = (turn: HarnessTurn, ctx: HarnessRunContext) => AsyncGenerator<StreamChunk>\n\nexport type HarnessDeliverInput = (child: HarnessChild, turn: HarnessTurn) => void | Promise<void>\n\nexport type HarnessDecodeLogger = {provider(msg: string, meta?: unknown): void}\n\nexport type HarnessDecodeOpts = {\n onSessionId(id: string): void\n\n onUsage?(usage: UsageSnapshot): void\n runId?: string\n threadId?: string\n logger?: HarnessDecodeLogger\n}\n\nexport type HarnessDecoder = (lines: AsyncIterable<string>, opts: HarnessDecodeOpts) => AsyncGenerator<StreamChunk>\n\nexport type HarnessSessionMeta = {\n id: string\n derivedTitle: string\n updatedAt: number\n messageCount: number\n model?: string | null\n totalTokens?: number\n lastMessage?: string | null\n createdAt?: number\n}\n\nexport type HarnessHistory = {\n transcriptPath(cwd: string, sessionId: string): string\n parse(raw: string): UIMessage[]\n\n nameFromTranscript?(raw: string): string | null\n\n list?(cwd: string, home?: string): HarnessSessionMeta[] | Promise<HarnessSessionMeta[]>\n}\n\ntype HarnessAdapterBase = {\n id: string\n binName: string\n\n displayName?: string\n\n launch?: HarnessLaunch\n buildArgs: HarnessArgsBuilder\n\n buildCompactArgs?: HarnessArgsBuilder\n decode: HarnessDecoder\n deliverInput?: HarnessDeliverInput\n run?: HarnessRun\n shutdown?: () => void | Promise<void>\n\n models?: HarnessModels\n defaultModel?: string\n}\n\nexport type HarnessAdapter = HarnessAdapterBase &\n (\n | {capabilities: HarnessCapabilities & {transcriptHistory: true}; history: HarnessHistory}\n | {capabilities: HarnessCapabilities & {transcriptHistory: false}; history?: undefined}\n ) &\n (\n | {capabilities: HarnessCapabilities & {compaction: true}; buildCompactArgs: HarnessArgsBuilder}\n | {capabilities: HarnessCapabilities & {compaction: false}; buildCompactArgs?: undefined}\n )\n\nexport function defineHarness<T extends HarnessAdapter>(adapter: T): T {\n return adapter\n}\n"],"mappings":";AAmIA,SAAgB,cAAwC,SAAe;CACrE,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"page-introspect-types.d.ts","names":[],"sources":["../src/page-introspect-types.ts"],"mappings":";KACY,QAAA;EAAY,QAAA;EAAmB,IAAA;EAAe,MAAA;EAAiB,EAAA;AAAA;AAAA,KAC/D,SAAA;EAAa,IAAA;EAAc,IAAA;EAAc,MAAA;AAAA;AAAA,KACzC,KAAA;EAAS,SAAA;EAAmB,GAAG;AAAA;AAAA,KAC/B,YAAA;EACV,SAAA;EACA,KAAA;EACA,MAAA,EAAQ,QAAA;EACR,MAAA,EAAQ,KAAA;EAGR,MAAA,GAAS,SAAA;AAAA;AAAA,KAEC,QAAA;EAAY,SAAA;EAAmB,GAAA;EAAa,QAAA,EAAU,QAAQ;EAAI,SAAA;AAAA;AAAA,KAClE,QAAA;EAAY,EAAA;EAAY,IAAA;EAAc,KAAA;EAAgB,QAAA;AAAA;AAAA,KACtD,IAAA;EAAQ,CAAA;EAAW,CAAA;EAAW,CAAA;EAAW,CAAA;AAAA;AAAA,KACzC,aAAA;EACV,SAAA;EACA,KAAA;EACA,KAAA;EACA,KAAA,EAAO,QAAA;EAGP,IAAA,EAAM,IAAI;AAAA;AAAA,KAEA,UAAA;EAAc,KAAA,EAAO,QAAQ;EAAI,SAAA;AAAA"}
1
+ {"version":3,"file":"page-introspect-types.d.ts","names":[],"sources":["../src/page-introspect-types.ts"],"mappings":";KAAY,QAAA;EAAY,QAAA;EAAmB,IAAA;EAAe,MAAA;EAAiB,EAAA;AAAA;AAAA,KAC/D,SAAA;EAAa,IAAA;EAAc,IAAA;EAAc,MAAA;AAAA;AAAA,KACzC,KAAA;EAAS,SAAA;EAAmB,GAAG;AAAA;AAAA,KAC/B,YAAA;EACV,SAAA;EACA,KAAA;EACA,MAAA,EAA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AAK,QAAQ,eAAA;AAAA,cAE1B,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KACrB,cAAA,GAAiB,CAAA,CAAE,KAAK,QAAQ,oBAAA;AAAA,cAE/B,eAAA,EAAe,CAAA,CAAA,SAAA;;;;KAChB,SAAA,GAAY,CAAA,CAAE,KAAK,QAAQ,eAAA;AAAA,KAE3B,UAAA,GAAa,MAAM;AAAA,iBAEf,EAAA,CAAG,IAAA,GAAM,MAAA,oBAA+B,UAAU;AAAA,iBAGlD,GAAA,CAAI,OAAA,WAAkB,UAAU;AAAA,iBAGhC,OAAA,CAAQ,MAAkB,EAAV,UAAU;AAAA,iBAK1B,UAAA,CAAW,IAAY;AAAA,cAI1B,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;cAMd,gBAAA,EAAgB,CAAA,CAAA,SAAA;;;;;;;;cAChB,sBAAA,EAAsB,CAAA,CAAA,SAAA;;;;;;;KACvB,gBAAA,GAAmB,CAAA,CAAE,KAAK,QAAQ,sBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"page-types.js","names":[],"sources":["../src/page-types.ts"],"sourcesContent":["import {z} from 'zod'\n\n// The single source of truth for the page-bus contract, shared by core (server) and the\n// widget (browser). The kind union is derived from a runtime array so a contract test can\n// assert the verb table + handler registry never drift from it.\nexport const PAGE_QUERY_KINDS = [\n 'route',\n 'dom',\n 'query',\n 'console',\n 'text',\n 'value',\n 'attr',\n 'exists',\n 'snapshot',\n 'locate',\n 'tree',\n 'inspect',\n 'override',\n 'find',\n 'track',\n 'effect',\n 'wait',\n 'click',\n 'fill',\n 'select',\n 'check',\n 'uncheck',\n 'press',\n 'hover',\n 'scroll',\n 'submit',\n 'setattr',\n 'removeattr',\n 'addclass',\n 'removeclass',\n 'setstyle',\n 'settext',\n 'sethtml',\n 'remove',\n 'insert',\n 'css',\n 'eval',\n] as const\n\nexport type PageQueryKind = (typeof PAGE_QUERY_KINDS)[number]\n\nexport const MUTATING_KINDS = [\n 'override',\n 'click',\n 'fill',\n 'select',\n 'check',\n 'uncheck',\n 'press',\n 'hover',\n 'scroll',\n 'submit',\n 'setattr',\n 'removeattr',\n 'addclass',\n 'removeclass',\n 'setstyle',\n 'settext',\n 'sethtml',\n 'remove',\n 'insert',\n 'css',\n 'eval',\n] as const satisfies readonly PageQueryKind[]\n\n// Visual action verbs that move/affect a visible element — the ones worth mirroring on the real page\n// (cursor glide + ring) and flagging in the tool card. Shared so the widget's page-mirror and the\n// tool-ui card never drift on which actions claim \"shown on your page\". Non-visual reads are excluded.\nexport const MIRROR_KINDS = [\n 'click',\n 'fill',\n 'select',\n 'check',\n 'uncheck',\n 'press',\n 'hover',\n 'scroll',\n 'submit',\n] as const satisfies readonly PageQueryKind[]\n\nexport function mirrorsKind(kind: PageQueryKind): boolean {\n return (MIRROR_KINDS as readonly PageQueryKind[]).includes(kind)\n}\n\nexport const PageQueryKindSchema = z.enum(PAGE_QUERY_KINDS)\nexport const PagePositionSchema = z.enum(['before', 'after', 'prepend', 'append'])\nexport const PageWaitStateSchema = z.enum(['visible', 'hidden'])\n\nexport type PagePosition = z.infer<typeof PagePositionSchema>\nexport type PageWaitState = z.infer<typeof PageWaitStateSchema>\n\nexport const PageQuerySchema = z.object({\n requestId: z.string().optional(),\n kind: PageQueryKindSchema,\n selector: z.string().optional(),\n ref: z.string().optional(),\n since: z.coerce.number().optional(),\n value: z.string().optional(),\n name: z.string().optional(),\n class: z.string().optional(),\n prop: z.string().optional(),\n text: z.string().optional(),\n html: z.string().optional(),\n key: z.string().optional(),\n position: PagePositionSchema.optional(),\n state: PageWaitStateSchema.optional(),\n timeout: z.coerce.number().optional(),\n code: z.string().optional(),\n // Dot-path into an inspect result for drill-down, e.g. \"props.user.address\" or \"hooks.0.value\".\n // Numeric segments index arrays. Stays a plain string so it rides the query-string + MCP alike.\n path: z.string().optional(),\n // override verb: which slice to edit, the hook id (from inspect's hooks tree), and the new value\n // as a JSON-encoded string (so `42`, `\"text\"`, `{\"a\":1}` are unambiguous over query-string + MCP).\n target: z.enum(['props', 'state', 'hooks', 'context']).optional(),\n hookId: z.coerce.number().optional(),\n json: z.string().optional(),\n effect: z.string().optional(),\n action: z.enum(['start', 'stop', 'report', 'enable', 'disable', 'toggle', 'list']).optional(),\n})\n\nexport type PageQuery = z.infer<typeof PageQuerySchema>\n\nexport const PageQueryInputSchema = PageQuerySchema.omit({kind: true, requestId: true})\nexport type PageQueryInput = z.infer<typeof PageQueryInputSchema>\n\n// POST /api/page/reply body — the widget's answer to a pushed PageQuery. Shared by core (validation)\n// and the widget transport (typing) so the two ends can't drift.\nexport const PageReplySchema = z.object({requestId: z.string(), data: z.record(z.string(), z.unknown()).default({})})\nexport type PageReply = z.infer<typeof PageReplySchema>\n\n// A reply is always a plain JSON object: either an error or some data (often {ok:true}).\nexport type PageResult = Record<string, unknown>\n\nexport function ok(data: Record<string, unknown> = {}): PageResult {\n return {ok: true, ...data}\n}\nexport function err(message: string): PageResult {\n return {error: message}\n}\nexport function isError(result: PageResult): boolean {\n return typeof result.error === 'string'\n}\n\nconst MUTATING = new Set<string>(MUTATING_KINDS)\nexport function isMutating(kind: string): boolean {\n return MUTATING.has(kind)\n}\n\nexport const RawFrameSchema = z.object({\n fileName: z.string().optional(),\n line: z.number().optional(),\n column: z.number().optional(),\n fn: z.string().optional(),\n})\nexport const OpenSourceSchema = z.object({frames: z.array(RawFrameSchema)})\nexport const OpenSourceResultSchema = z.object({status: z.enum(['opened', 'no-source', 'failed'])})\nexport type OpenSourceResult = z.infer<typeof OpenSourceResultSchema>['status']\n"],"mappings":";;AAKA,MAAa,mBAAmB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAIA,MAAa,i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{z} from 'zod'\n\nexport const PAGE_QUERY_KINDS = [\n 'route',\n 'dom',\n 'query',\n 'console',\n 'text',\n 'value',\n 'attr',\n 'exists',\n 'snapshot',\n 'locate',\n 'tree',\n 'inspect',\n 'override',\n 'find',\n 'track',\n 'effect',\n 'wait',\n 'click',\n 'fill',\n 'select',\n 'check',\n 'uncheck',\n 'press',\n 'hover',\n 'scroll',\n 'submit',\n 'setattr',\n 'removeattr',\n 'addclass',\n 'removeclass',\n 'setstyle',\n 'settext',\n 'sethtml',\n 'remove',\n 'insert',\n 'css',\n 'eval',\n] as const\n\nexport type PageQueryKind = (typeof PAGE_QUERY_KINDS)[number]\n\nexport const MUTATING_KINDS = [\n 'override',\n 'click',\n 'fill',\n 'select',\n 'check',\n 'uncheck',\n 'press',\n 'hover',\n 'scroll',\n 'submit',\n 'setattr',\n 'removeattr',\n 'addclass',\n 'removeclass',\n 'setstyle',\n 'settext',\n 'sethtml',\n 'remove',\n 'insert',\n 'css',\n 'eval',\n] as const satisfies readonly PageQueryKind[]\n\nexport const MIRROR_KINDS = [\n 'click',\n 'fill',\n 'select',\n 'check',\n 'uncheck',\n 'press',\n 'hover',\n 'scroll',\n 'submit',\n] as const satisfies readonly PageQueryKind[]\n\nexport function mirrorsKind(kind: PageQueryKind): boolean {\n return (MIRROR_KINDS as readonly PageQueryKind[]).includes(kind)\n}\n\nexport const PageQueryKindSchema = z.enum(PAGE_QUERY_KINDS)\nexport const PagePositionSchema = z.enum(['before', 'after', 'prepend', 'append'])\nexport const PageWaitStateSchema = z.enum(['visible', 'hidden'])\n\nexport type PagePosition = z.infer<typeof PagePositionSchema>\nexport type PageWaitState = z.infer<typeof PageWaitStateSchema>\n\nexport const PageQuerySchema = z.object({\n requestId: z.string().optional(),\n kind: PageQueryKindSchema,\n selector: z.string().optional(),\n ref: z.string().optional(),\n since: z.coerce.number().optional(),\n value: z.string().optional(),\n name: z.string().optional(),\n class: z.string().optional(),\n prop: z.string().optional(),\n text: z.string().optional(),\n html: z.string().optional(),\n key: z.string().optional(),\n position: PagePositionSchema.optional(),\n state: PageWaitStateSchema.optional(),\n timeout: z.coerce.number().optional(),\n code: z.string().optional(),\n\n path: z.string().optional(),\n\n target: z.enum(['props', 'state', 'hooks', 'context']).optional(),\n hookId: z.coerce.number().optional(),\n json: z.string().optional(),\n effect: z.string().optional(),\n action: z.enum(['start', 'stop', 'report', 'enable', 'disable', 'toggle', 'list']).optional(),\n})\n\nexport type PageQuery = z.infer<typeof PageQuerySchema>\n\nexport const PageQueryInputSchema = PageQuerySchema.omit({kind: true, requestId: true})\nexport type PageQueryInput = z.infer<typeof PageQueryInputSchema>\n\nexport const PageReplySchema = z.object({requestId: z.string(), data: z.record(z.string(), z.unknown()).default({})})\nexport type PageReply = z.infer<typeof PageReplySchema>\n\nexport type PageResult = Record<string, unknown>\n\nexport function ok(data: Record<string, unknown> = {}): PageResult {\n return {ok: true, ...data}\n}\nexport function err(message: string): PageResult {\n return {error: message}\n}\nexport function isError(result: PageResult): boolean {\n return typeof result.error === 'string'\n}\n\nconst MUTATING = new Set<string>(MUTATING_KINDS)\nexport function isMutating(kind: string): boolean {\n return MUTATING.has(kind)\n}\n\nexport const RawFrameSchema = z.object({\n fileName: z.string().optional(),\n line: z.number().optional(),\n column: z.number().optional(),\n fn: z.string().optional(),\n})\nexport const OpenSourceSchema = z.object({frames: z.array(RawFrameSchema)})\nexport const OpenSourceResultSchema = z.object({status: z.enum(['opened', 'no-source', 'failed'])})\nexport type OpenSourceResult = z.infer<typeof OpenSourceResultSchema>['status']\n"],"mappings":";;AAEA,MAAa,mBAAmB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAIA,MAAa,iBAAiB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA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