@agimon-ai/doompi-computer-use 0.0.1-alpha.50 → 0.0.1-alpha.52

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.
@@ -18,6 +18,7 @@ const Error = typebox.Type.Object({
18
18
  const Artifact = typebox.Type.Object({
19
19
  artifactId: S,
20
20
  status: values(["ready", "failed"]),
21
+ sizeBytes: O(N),
21
22
  downloadUrl: O(S),
22
23
  previewUrl: O(S),
23
24
  actionCount: O(N),
@@ -95,6 +96,26 @@ const apiContracts = (0, _agimon_ai_doompi_core_apiContracts.defineApiContract)(
95
96
  version: 1,
96
97
  dynamic: ["Desktop provider target extensions, observations and operation results are runtime-defined JSON."],
97
98
  http: [
99
+ {
100
+ id: "computer.activation.state",
101
+ scope: "session",
102
+ basePath: "computer-use",
103
+ path: "/activate",
104
+ method: "GET",
105
+ authentication: "owner",
106
+ description: "Read state as the matching pending requester or approved recording reader.",
107
+ responses: (0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(ComputerStateSchema)
108
+ },
109
+ {
110
+ id: "computer.activation.cancel",
111
+ scope: "session",
112
+ basePath: "computer-use",
113
+ path: "/activate",
114
+ method: "DELETE",
115
+ authentication: "owner",
116
+ description: "Cancel only the matching requester pending activation.",
117
+ responses: (0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(ComputerStateSchema, 202)
118
+ },
98
119
  {
99
120
  id: "computer.activate",
100
121
  scope: "session",
@@ -102,15 +123,15 @@ const apiContracts = (0, _agimon_ai_doompi_core_apiContracts.defineApiContract)(
102
123
  path: "/activate",
103
124
  method: "POST",
104
125
  authentication: "owner",
105
- description: "Request confirmed Desktop access with admitted caller and remote step-up context.",
126
+ description: "Request confirmed Desktop access with admitted caller and remote step-up context. A remote caller may omit target so the local Mac selects the window.",
106
127
  body: {
107
128
  required: true,
108
129
  contentType: "application/json",
109
130
  schema: typebox.Type.Object({
110
- target: typebox.Type.Object({
131
+ target: O(typebox.Type.Object({
111
132
  windowId: S,
112
133
  bundleId: S
113
- }),
134
+ })),
114
135
  durationMs: typebox.Type.Integer({
115
136
  minimum: 1e3,
116
137
  maximum: 18e5
@@ -119,6 +140,31 @@ const apiContracts = (0, _agimon_ai_doompi_core_apiContracts.defineApiContract)(
119
140
  },
120
141
  responses: (0, _agimon_ai_doompi_core_apiContracts.jsonApiResponses)(ComputerStateSchema, 202)
121
142
  },
143
+ {
144
+ id: "computer.artifact",
145
+ scope: "session",
146
+ basePath: "computer-use",
147
+ path: "/artifact",
148
+ method: "GET",
149
+ authentication: "owner",
150
+ description: "Read at most 1 MiB of a recording belonging to this session and approved caller.",
151
+ parameters: [{
152
+ name: "artifactId",
153
+ in: "query",
154
+ required: true,
155
+ schema: S
156
+ }, {
157
+ name: "offset",
158
+ in: "query",
159
+ required: true,
160
+ schema: typebox.Type.Integer({ minimum: 0 })
161
+ }],
162
+ responses: { 206: {
163
+ description: "Bounded recording bytes.",
164
+ contentType: "video/mp4",
165
+ schema: typebox.Type.String({ format: "binary" })
166
+ } }
167
+ },
122
168
  internal("GET", "/agent/state", ComputerStateSchema),
123
169
  internal("GET", "/hub/state", ComputerStateSchema),
124
170
  internal("POST", "/agent/observe", Json),
@@ -1 +1 @@
1
- {"version":3,"file":"apiContracts.cjs","names":["Type","jsonApiResponses","defineApiContract"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract, jsonApiResponses, type DoomHttpContract } from '@agimon-ai/doompi-core/apiContracts';\nimport { Type } from 'typebox';\n\nconst S = Type.String();\nconst N = Type.Number();\nconst O = Type.Optional;\nconst values = <T extends string>(items: T[]) => Type.Union(items.map((item) => Type.Literal(item)));\nconst Json = Type.Unknown({\n description:\n 'Desktop provider JSON value. Targets, observations and action results are supplied by the admitted Desktop provider.',\n});\nconst Target = Type.Record(S, Json);\nconst Error = Type.Object({ code: S, message: S });\nconst Artifact = Type.Object({\n artifactId: S,\n status: values(['ready', 'failed']),\n downloadUrl: O(S),\n previewUrl: O(S),\n actionCount: O(N),\n completedAt: O(S),\n failure: O(Error),\n});\nexport const ComputerStateSchema = Type.Object({\n sessionId: S,\n revision: N,\n wake: N,\n phase: values(['inactive', 'awaiting_confirmation', 'activating', 'active', 'stopping', 'failed']),\n requestId: O(S),\n target: O(Target),\n durationMs: O(N),\n expiresAt: O(N),\n failure: O(Error),\n artifact: O(Artifact),\n});\nconst Reference = { snapshotId: Type.String({ minLength: 1 }), elementRef: Type.String({ minLength: 1 }) };\nexport const ComputerActionSchema = Type.Union([\n Type.Object({ kind: values(['press', 'focus']), ...Reference }, { additionalProperties: false }),\n Type.Object({ kind: Type.Literal('set_value'), ...Reference, value: S }, { additionalProperties: false }),\n Type.Object(\n {\n kind: Type.Literal('scroll'),\n ...Reference,\n direction: values(['up', 'down', 'left', 'right']),\n amount: values(['line', 'page']),\n },\n { additionalProperties: false },\n ),\n]);\nconst internal = (\n method: 'GET' | 'POST',\n path: string,\n output: object,\n body?: object,\n status = 200,\n): DoomHttpContract => ({\n id: `computer.${path.slice(1).replaceAll('/', '.')}`,\n scope: 'session',\n basePath: 'computer-use',\n path,\n method,\n authentication: 'owner',\n description: `Computer use broker ${path}. Requires the host-issued ${path.startsWith('/agent/') ? 'agent' : 'hub'} bearer token.`,\n availability: 'Internal broker route; ordinary browser credentials are insufficient.',\n parameters: [{ name: 'Authorization', in: 'header', required: true, schema: Type.String({ pattern: '^Bearer .+' }) }],\n ...(body ? { body: { required: true, contentType: 'application/json', schema: body } } : {}),\n responses: jsonApiResponses(output, status),\n});\nexport const apiContracts = defineApiContract({\n version: 1,\n dynamic: ['Desktop provider target extensions, observations and operation results are runtime-defined JSON.'],\n http: [\n {\n id: 'computer.activate',\n scope: 'session',\n basePath: 'computer-use',\n path: '/activate',\n method: 'POST',\n authentication: 'owner',\n description: 'Request confirmed Desktop access with admitted caller and remote step-up context.',\n body: {\n required: true,\n contentType: 'application/json',\n schema: Type.Object({\n target: Type.Object({ windowId: S, bundleId: S }),\n durationMs: Type.Integer({ minimum: 1000, maximum: 1800000 }),\n }),\n },\n responses: jsonApiResponses(ComputerStateSchema, 202),\n },\n internal('GET', '/agent/state', ComputerStateSchema),\n internal('GET', '/hub/state', ComputerStateSchema),\n internal('POST', '/agent/observe', Json),\n internal('POST', '/agent/action', Json, ComputerActionSchema),\n internal('POST', '/agent/stop', ComputerStateSchema, undefined, 202),\n internal(\n 'GET',\n '/hub/activation',\n Type.Union([\n Type.Null(),\n Type.Object({\n requestId: S,\n target: Target,\n durationSeconds: N,\n createdAt: N,\n confirmationExpiresAt: N,\n caller: Type.Object({ locality: values(['local', 'remote']), stepUp: S }),\n }),\n ]),\n ),\n internal('GET', '/hub/authorization', Type.Union([Type.Null(), Type.Object({ grantId: S, expiresAt: O(N) })])),\n internal(\n 'GET',\n '/hub/next',\n Type.Union([\n Type.Null(),\n Type.Object({ id: S, operation: values(['observe', 'act']), payload: O(Json), grantId: S, sequence: O(N) }),\n ]),\n ),\n internal('POST', '/hub/complete', ComputerStateSchema, Type.Object({ id: S, error: O(S), result: O(Json) })),\n internal(\n 'POST',\n '/hub/stop',\n ComputerStateSchema,\n Type.Object({ error: O(S), host: O(Type.Object({ grantId: S, expiresAt: N })), artifact: O(Artifact) }),\n ),\n ],\n sockets: (['global', 'workspace'] as const).flatMap((scope) => [\n {\n id: 'computer.state',\n scope,\n service: 'doompi.hub.v1',\n member: 'computer_use_state',\n kind: 'channel',\n direction: 'server-to-client',\n description: 'Computer use channel payload.',\n input: Type.Object({ state: ComputerStateSchema, targets: Type.Array(Target), busy: O(Type.Literal(true)) }),\n },\n {\n id: 'computer.command',\n scope,\n service: 'doompi.hub.v1',\n member: 'computer_use_state',\n kind: 'channel',\n direction: 'client-to-server',\n description: 'Computer use browser channel command.',\n input: Type.Object({ action: values(['status', 'targets', 'stop', 'artifacts']) }),\n },\n ]),\n});\nexport default apiContracts;\n"],"mappings":";;;;;;;AAGA,MAAM,IAAIA,QAAAA,KAAK,OAAO;AACtB,MAAM,IAAIA,QAAAA,KA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EAAE,CAAC,CACxG;CACF;CACA,SAAU,CAAC,UAAU,WAAW,CAAC,CAAW,SAAS,UAAU,CAC7D;EACE,IAAI;EACJ;EACA,SAAS;EACT,QAAQ;EACR,MAAM;EACN,WAAW;EACX,aAAa;EACb,OAAOA,QAAAA,KAAK,OAAO;GAAE,OAAO;GAAqB,SAASA,QAAAA,KAAK,MAAM,MAAM;GAAG,MAAM,EAAEA,QAAAA,KAAK,QAAQ,IAAI,CAAC;EAAE,CAAC;CAC7G,GACA;EACE,IAAI;EACJ;EACA,SAAS;EACT,QAAQ;EACR,MAAM;EACN,WAAW;EACX,aAAa;EACb,OAAOA,QAAAA,KAAK,OAAO,EAAE,QAAQ,OAAO;GAAC;GAAU;GAAW;GAAQ;EAAW,CAAC,EAAE,CAAC;CACnF,CACF,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"apiContracts.cjs","names":["Type","jsonApiResponses","defineApiContract"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract, jsonApiResponses, type DoomHttpContract } from '@agimon-ai/doompi-core/apiContracts';\nimport { Type } from 'typebox';\n\nconst S = Type.String();\nconst N = Type.Number();\nconst O = Type.Optional;\nconst values = <T extends string>(items: T[]) => Type.Union(items.map((item) => Type.Literal(item)));\nconst Json = Type.Unknown({\n description:\n 'Desktop provider JSON value. Targets, observations and action results are supplied by the admitted Desktop provider.',\n});\nconst Target = Type.Record(S, Json);\nconst Error = Type.Object({ code: S, message: S });\nconst Artifact = Type.Object({\n artifactId: S,\n status: values(['ready', 'failed']),\n sizeBytes: O(N),\n downloadUrl: O(S),\n previewUrl: O(S),\n actionCount: O(N),\n completedAt: O(S),\n failure: O(Error),\n});\nexport const ComputerStateSchema = Type.Object({\n sessionId: S,\n revision: N,\n wake: N,\n phase: values(['inactive', 'awaiting_confirmation', 'activating', 'active', 'stopping', 'failed']),\n requestId: O(S),\n target: O(Target),\n durationMs: O(N),\n expiresAt: O(N),\n failure: O(Error),\n artifact: O(Artifact),\n});\nconst Reference = { snapshotId: Type.String({ minLength: 1 }), elementRef: Type.String({ minLength: 1 }) };\nexport const ComputerActionSchema = Type.Union([\n Type.Object({ kind: values(['press', 'focus']), ...Reference }, { additionalProperties: false }),\n Type.Object({ kind: Type.Literal('set_value'), ...Reference, value: S }, { additionalProperties: false }),\n Type.Object(\n {\n kind: Type.Literal('scroll'),\n ...Reference,\n direction: values(['up', 'down', 'left', 'right']),\n amount: values(['line', 'page']),\n },\n { additionalProperties: false },\n ),\n]);\nconst internal = (\n method: 'GET' | 'POST',\n path: string,\n output: object,\n body?: object,\n status = 200,\n): DoomHttpContract => ({\n id: `computer.${path.slice(1).replaceAll('/', '.')}`,\n scope: 'session',\n basePath: 'computer-use',\n path,\n method,\n authentication: 'owner',\n description: `Computer use broker ${path}. Requires the host-issued ${path.startsWith('/agent/') ? 'agent' : 'hub'} bearer token.`,\n availability: 'Internal broker route; ordinary browser credentials are insufficient.',\n parameters: [{ name: 'Authorization', in: 'header', required: true, schema: Type.String({ pattern: '^Bearer .+' }) }],\n ...(body ? { body: { required: true, contentType: 'application/json', schema: body } } : {}),\n responses: jsonApiResponses(output, status),\n});\nexport const apiContracts = defineApiContract({\n version: 1,\n dynamic: ['Desktop provider target extensions, observations and operation results are runtime-defined JSON.'],\n http: [\n {\n id: 'computer.activation.state',\n scope: 'session',\n basePath: 'computer-use',\n path: '/activate',\n method: 'GET',\n authentication: 'owner',\n description: 'Read state as the matching pending requester or approved recording reader.',\n responses: jsonApiResponses(ComputerStateSchema),\n },\n {\n id: 'computer.activation.cancel',\n scope: 'session',\n basePath: 'computer-use',\n path: '/activate',\n method: 'DELETE',\n authentication: 'owner',\n description: 'Cancel only the matching requester pending activation.',\n responses: jsonApiResponses(ComputerStateSchema, 202),\n },\n {\n id: 'computer.activate',\n scope: 'session',\n basePath: 'computer-use',\n path: '/activate',\n method: 'POST',\n authentication: 'owner',\n description:\n 'Request confirmed Desktop access with admitted caller and remote step-up context. A remote caller may omit target so the local Mac selects the window.',\n body: {\n required: true,\n contentType: 'application/json',\n schema: Type.Object({\n target: O(Type.Object({ windowId: S, bundleId: S })),\n durationMs: Type.Integer({ minimum: 1000, maximum: 1800000 }),\n }),\n },\n responses: jsonApiResponses(ComputerStateSchema, 202),\n },\n {\n id: 'computer.artifact',\n scope: 'session',\n basePath: 'computer-use',\n path: '/artifact',\n method: 'GET',\n authentication: 'owner',\n description: 'Read at most 1 MiB of a recording belonging to this session and approved caller.',\n parameters: [\n { name: 'artifactId', in: 'query', required: true, schema: S },\n { name: 'offset', in: 'query', required: true, schema: Type.Integer({ minimum: 0 }) },\n ],\n responses: {\n 206: {\n description: 'Bounded recording bytes.',\n contentType: 'video/mp4',\n schema: Type.String({ format: 'binary' }),\n },\n },\n },\n internal('GET', '/agent/state', ComputerStateSchema),\n internal('GET', '/hub/state', ComputerStateSchema),\n internal('POST', '/agent/observe', Json),\n internal('POST', '/agent/action', Json, ComputerActionSchema),\n internal('POST', '/agent/stop', ComputerStateSchema, undefined, 202),\n internal(\n 'GET',\n '/hub/activation',\n Type.Union([\n Type.Null(),\n Type.Object({\n requestId: S,\n target: Target,\n durationSeconds: N,\n createdAt: N,\n confirmationExpiresAt: N,\n caller: Type.Object({ locality: values(['local', 'remote']), stepUp: S }),\n }),\n ]),\n ),\n internal('GET', '/hub/authorization', Type.Union([Type.Null(), Type.Object({ grantId: S, expiresAt: O(N) })])),\n internal(\n 'GET',\n '/hub/next',\n Type.Union([\n Type.Null(),\n Type.Object({ id: S, operation: values(['observe', 'act']), payload: O(Json), grantId: S, sequence: O(N) }),\n ]),\n ),\n internal('POST', '/hub/complete', ComputerStateSchema, Type.Object({ id: S, error: O(S), result: O(Json) })),\n internal(\n 'POST',\n '/hub/stop',\n ComputerStateSchema,\n Type.Object({ error: O(S), host: O(Type.Object({ grantId: S, expiresAt: N })), artifact: O(Artifact) }),\n ),\n ],\n sockets: (['global', 'workspace'] as const).flatMap((scope) => [\n {\n id: 'computer.state',\n scope,\n service: 'doompi.hub.v1',\n member: 'computer_use_state',\n kind: 'channel',\n direction: 'server-to-client',\n description: 'Computer use channel payload.',\n input: Type.Object({ state: ComputerStateSchema, targets: Type.Array(Target), busy: O(Type.Literal(true)) }),\n },\n {\n id: 'computer.command',\n scope,\n service: 'doompi.hub.v1',\n member: 'computer_use_state',\n kind: 'channel',\n direction: 'client-to-server',\n description: 'Computer use browser channel command.',\n input: Type.Object({ action: values(['status', 'targets', 'stop', 'artifacts']) }),\n },\n ]),\n});\nexport default apiContracts;\n"],"mappings":";;;;;;;AAGA,MAAM,IAAIA,QAAAA,KAAK,OAAO;AACtB,MAAM,IAAIA,QAAAA,KAAK,OAAO;AACtB,MAAM,IAAIA,QAAAA,KAAK;AACf,MAAM,UAA4B,UAAeA,QAAAA,KAAK,MAAM,MAAM,KAAK,SAASA,QAAAA,KAAK,QAAQ,IAAI,CAAC,CAAC;AACnG,MAAM,OAAOA,QAAAA,KAAK,QAAQ,EACxB,aACE,uHACJ,CAAC;AACD,MAAM,SAASA,QAAAA,KAAK,OAAO,GAAG,IAAI;AAClC,MAAM,QAAQA,QAAAA,KAAK,OAAO;CAAE,MAAM;CAAG,SAAS;AAAE,CAAC;AACjD,MAAM,WAAWA,QAAAA,KAAK,OAAO;CAC3B,YAAY;CACZ,QAAQ,OAAO,CAAC,SAAS,QAAQ,CAAC;CAClC,WAAW,EAAE,CAAC;CACd,aAAa,EAAE,CAAC;CAChB,YAAY,EAAE,CAAC;CACf,aAAa,EAAE,CAAC;CAChB,aAAa,EAAE,CAAC;CAChB,SAAS,EAAE,KAAK;AAClB,CAAC;AACD,MAAa,sBAAsBA,QAAAA,KAAK,OAAO;CAC7C,WAAW;CACX,UAAU;CACV,MAAM;CACN,OAAO,OAAO;EAAC;EAAY;EAAyB;EAAc;EAAU;EAAY;CAAQ,CAAC;CACjG,WAAW,EAAE,CAAC;CACd,QAAQ,EAAE,MAAM;CAChB,YAAY,EAAE,CAAC;CACf,WAAW,EAAE,CAAC;CACd,SAAS,EAAE,KA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;EACR,MAAM;EACN,WAAW;EACX,aAAa;EACb,OAAOA,QAAAA,KAAK,OAAO;GAAE,OAAO;GAAqB,SAASA,QAAAA,KAAK,MAAM,MAAM;GAAG,MAAM,EAAEA,QAAAA,KAAK,QAAQ,IAAI,CAAC;EAAE,CAAC;CAC7G,GACA;EACE,IAAI;EACJ;EACA,SAAS;EACT,QAAQ;EACR,MAAM;EACN,WAAW;EACX,aAAa;EACb,OAAOA,QAAAA,KAAK,OAAO,EAAE,QAAQ,OAAO;GAAC;GAAU;GAAW;GAAQ;EAAW,CAAC,EAAE,CAAC;CACnF,CACF,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBAmEa"}
1
+ {"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBAoEa"}
@@ -14,6 +14,7 @@ const Error = Type.Object({
14
14
  const Artifact = Type.Object({
15
15
  artifactId: S,
16
16
  status: values(["ready", "failed"]),
17
+ sizeBytes: O(N),
17
18
  downloadUrl: O(S),
18
19
  previewUrl: O(S),
19
20
  actionCount: O(N),
@@ -91,6 +92,26 @@ const apiContracts = defineApiContract({
91
92
  version: 1,
92
93
  dynamic: ["Desktop provider target extensions, observations and operation results are runtime-defined JSON."],
93
94
  http: [
95
+ {
96
+ id: "computer.activation.state",
97
+ scope: "session",
98
+ basePath: "computer-use",
99
+ path: "/activate",
100
+ method: "GET",
101
+ authentication: "owner",
102
+ description: "Read state as the matching pending requester or approved recording reader.",
103
+ responses: jsonApiResponses(ComputerStateSchema)
104
+ },
105
+ {
106
+ id: "computer.activation.cancel",
107
+ scope: "session",
108
+ basePath: "computer-use",
109
+ path: "/activate",
110
+ method: "DELETE",
111
+ authentication: "owner",
112
+ description: "Cancel only the matching requester pending activation.",
113
+ responses: jsonApiResponses(ComputerStateSchema, 202)
114
+ },
94
115
  {
95
116
  id: "computer.activate",
96
117
  scope: "session",
@@ -98,15 +119,15 @@ const apiContracts = defineApiContract({
98
119
  path: "/activate",
99
120
  method: "POST",
100
121
  authentication: "owner",
101
- description: "Request confirmed Desktop access with admitted caller and remote step-up context.",
122
+ description: "Request confirmed Desktop access with admitted caller and remote step-up context. A remote caller may omit target so the local Mac selects the window.",
102
123
  body: {
103
124
  required: true,
104
125
  contentType: "application/json",
105
126
  schema: Type.Object({
106
- target: Type.Object({
127
+ target: O(Type.Object({
107
128
  windowId: S,
108
129
  bundleId: S
109
- }),
130
+ })),
110
131
  durationMs: Type.Integer({
111
132
  minimum: 1e3,
112
133
  maximum: 18e5
@@ -115,6 +136,31 @@ const apiContracts = defineApiContract({
115
136
  },
116
137
  responses: jsonApiResponses(ComputerStateSchema, 202)
117
138
  },
139
+ {
140
+ id: "computer.artifact",
141
+ scope: "session",
142
+ basePath: "computer-use",
143
+ path: "/artifact",
144
+ method: "GET",
145
+ authentication: "owner",
146
+ description: "Read at most 1 MiB of a recording belonging to this session and approved caller.",
147
+ parameters: [{
148
+ name: "artifactId",
149
+ in: "query",
150
+ required: true,
151
+ schema: S
152
+ }, {
153
+ name: "offset",
154
+ in: "query",
155
+ required: true,
156
+ schema: Type.Integer({ minimum: 0 })
157
+ }],
158
+ responses: { 206: {
159
+ description: "Bounded recording bytes.",
160
+ contentType: "video/mp4",
161
+ schema: Type.String({ format: "binary" })
162
+ } }
163
+ },
118
164
  internal("GET", "/agent/state", ComputerStateSchema),
119
165
  internal("GET", "/hub/state", ComputerStateSchema),
120
166
  internal("POST", "/agent/observe", Json),
@@ -1 +1 @@
1
- {"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract, jsonApiResponses, type DoomHttpContract } from '@agimon-ai/doompi-core/apiContracts';\nimport { Type } from 'typebox';\n\nconst S = Type.String();\nconst N = Type.Number();\nconst O = Type.Optional;\nconst values = <T extends string>(items: T[]) => Type.Union(items.map((item) => Type.Literal(item)));\nconst Json = Type.Unknown({\n description:\n 'Desktop provider JSON value. Targets, observations and action results are supplied by the admitted Desktop provider.',\n});\nconst Target = Type.Record(S, Json);\nconst Error = Type.Object({ code: S, message: S });\nconst Artifact = Type.Object({\n artifactId: S,\n status: values(['ready', 'failed']),\n downloadUrl: O(S),\n previewUrl: O(S),\n actionCount: O(N),\n completedAt: O(S),\n failure: O(Error),\n});\nexport const ComputerStateSchema = Type.Object({\n sessionId: S,\n revision: N,\n wake: N,\n phase: values(['inactive', 'awaiting_confirmation', 'activating', 'active', 'stopping', 'failed']),\n requestId: O(S),\n target: O(Target),\n durationMs: O(N),\n expiresAt: O(N),\n failure: O(Error),\n artifact: O(Artifact),\n});\nconst Reference = { snapshotId: Type.String({ minLength: 1 }), elementRef: Type.String({ minLength: 1 }) };\nexport const ComputerActionSchema = Type.Union([\n Type.Object({ kind: values(['press', 'focus']), ...Reference }, { additionalProperties: false }),\n Type.Object({ kind: Type.Literal('set_value'), ...Reference, value: S }, { additionalProperties: false }),\n Type.Object(\n {\n kind: Type.Literal('scroll'),\n ...Reference,\n direction: values(['up', 'down', 'left', 'right']),\n amount: values(['line', 'page']),\n },\n { additionalProperties: false },\n ),\n]);\nconst internal = (\n method: 'GET' | 'POST',\n path: string,\n output: object,\n body?: object,\n status = 200,\n): DoomHttpContract => ({\n id: `computer.${path.slice(1).replaceAll('/', '.')}`,\n scope: 'session',\n basePath: 'computer-use',\n path,\n method,\n authentication: 'owner',\n description: `Computer use broker ${path}. Requires the host-issued ${path.startsWith('/agent/') ? 'agent' : 'hub'} bearer token.`,\n availability: 'Internal broker route; ordinary browser credentials are insufficient.',\n parameters: [{ name: 'Authorization', in: 'header', required: true, schema: Type.String({ pattern: '^Bearer .+' }) }],\n ...(body ? { body: { required: true, contentType: 'application/json', schema: body } } : {}),\n responses: jsonApiResponses(output, status),\n});\nexport const apiContracts = defineApiContract({\n version: 1,\n dynamic: ['Desktop provider target extensions, observations and operation results are runtime-defined JSON.'],\n http: [\n {\n id: 'computer.activate',\n scope: 'session',\n basePath: 'computer-use',\n path: '/activate',\n method: 'POST',\n authentication: 'owner',\n description: 'Request confirmed Desktop access with admitted caller and remote step-up context.',\n body: {\n required: true,\n contentType: 'application/json',\n schema: Type.Object({\n target: Type.Object({ windowId: S, bundleId: S }),\n durationMs: Type.Integer({ minimum: 1000, maximum: 1800000 }),\n }),\n },\n responses: jsonApiResponses(ComputerStateSchema, 202),\n },\n internal('GET', '/agent/state', ComputerStateSchema),\n internal('GET', '/hub/state', ComputerStateSchema),\n internal('POST', '/agent/observe', Json),\n internal('POST', '/agent/action', Json, ComputerActionSchema),\n internal('POST', '/agent/stop', ComputerStateSchema, undefined, 202),\n internal(\n 'GET',\n '/hub/activation',\n Type.Union([\n Type.Null(),\n Type.Object({\n requestId: S,\n target: Target,\n durationSeconds: N,\n createdAt: N,\n confirmationExpiresAt: N,\n caller: Type.Object({ locality: values(['local', 'remote']), stepUp: S }),\n }),\n ]),\n ),\n internal('GET', '/hub/authorization', Type.Union([Type.Null(), Type.Object({ grantId: S, expiresAt: O(N) })])),\n internal(\n 'GET',\n '/hub/next',\n Type.Union([\n Type.Null(),\n Type.Object({ id: S, operation: values(['observe', 'act']), payload: O(Json), grantId: S, sequence: O(N) }),\n ]),\n ),\n internal('POST', '/hub/complete', ComputerStateSchema, Type.Object({ id: S, error: O(S), result: O(Json) })),\n internal(\n 'POST',\n '/hub/stop',\n ComputerStateSchema,\n Type.Object({ error: O(S), host: O(Type.Object({ grantId: S, expiresAt: N })), artifact: O(Artifact) }),\n ),\n ],\n sockets: (['global', 'workspace'] as const).flatMap((scope) => [\n {\n id: 'computer.state',\n scope,\n service: 'doompi.hub.v1',\n member: 'computer_use_state',\n kind: 'channel',\n direction: 'server-to-client',\n description: 'Computer use channel payload.',\n input: Type.Object({ state: ComputerStateSchema, targets: Type.Array(Target), busy: O(Type.Literal(true)) }),\n },\n {\n id: 'computer.command',\n scope,\n service: 'doompi.hub.v1',\n member: 'computer_use_state',\n kind: 'channel',\n direction: 'client-to-server',\n description: 'Computer use browser channel command.',\n input: Type.Object({ action: values(['status', 'targets', 'stop', 'artifacts']) }),\n },\n ]),\n});\nexport default apiContracts;\n"],"mappings":";;;AAGA,MAAM,IAAI,KAAK,OAAO;AACtB,MAAM,IAAI,KAAK,OAAO;AACtB,MAAM,IAAI,KAAK;AACf,MAAM,UAA4B,UAAe,KAAK,MAAM,MAAM,KAAK,SAAS,KAAK,QAAQ,IAAI,CAAC,CAAC;AACnG,MAAM,OAAO,KAAK,QAAQ,EACxB,aACE,uHACJ,CAAC;AACD,MAAM,SAAS,KAAK,OAAO,GAAG,IAAI;AAClC,MAAM,QAAQ,KAAK,OAAO;CAAE,MAAM;CAAG,SAAS;AAAE,CAAC;AACjD,MAAM,WAAW,KAAK,OAAO;CAC3B,YAAY;CACZ,QAAQ,OAAO,CAAC,SAAS,QAAQ,CAAC;CAClC,aAAa,EAAE,CAAC;CAChB,YAAY,EAAE,CAAC;CACf,aAAa,EAAE,CAAC;CAChB,aAAa,EAAE,CAAC;CAChB,SAAS,EAAE,KAAK;AAClB,CAAC;AACD,MAAa,sBAAsB,KAAK,OAAO;CAC7C,WAAW;CACX,UAAU;CACV,MAAM;CACN,OAAO,OAAO;EAAC;EAAY;EAAyB;EAAc;EAAU;EAAY;CAAQ,CAAC;CACjG,WAAW,EAAE,CAAC;CACd,QAAQ,EAAE,MAAM;CAChB,YAAY,EAAE,CAAC;CACf,WAAW,EAAE,CAAC;CACd,SAAS,EAAE,KAAK;CAChB,UAAU,EAAE,QAAQ;AACtB,CAAC;AACD,MAAM,YAAY;CAAE,YAAY,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;CAAG,YAAY,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;AAAE;AACzG,MAAa,uBAAuB,KAAK,MAAM;CAC7C,KAAK,OAAO;EAAE,MAAM,OAAO,CAAC,SAAS,OAAO,CAAC;EAAG,GAAG;CAAU,GAAG,EAAE,sBAAsB,MAAM,CAAC;C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AAO,KAAK,OAAO;GAAE,OAAO;GAAqB,SAAS,KAAK,MAAM,MAAM;GAAG,MAAM,EAAE,KAAK,QAAQ,IAAI,CAAC;EAAE,CAAC;CAC7G,GACA;EACE,IAAI;EACJ;EACA,SAAS;EACT,QAAQ;EACR,MAAM;EACN,WAAW;EACX,aAAa;EACb,OAAO,KAAK,OAAO,EAAE,QAAQ,OAAO;GAAC;GAAU;GAAW;GAAQ;EAAW,CAAC,EAAE,CAAC;CACnF,CACF,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract, jsonApiResponses, type DoomHttpContract } from '@agimon-ai/doompi-core/apiContracts';\nimport { Type } from 'typebox';\n\nconst S = Type.String();\nconst N = Type.Number();\nconst O = Type.Optional;\nconst values = <T extends string>(items: T[]) => Type.Union(items.map((item) => Type.Literal(item)));\nconst Json = Type.Unknown({\n description:\n 'Desktop provider JSON value. Targets, observations and action results are supplied by the admitted Desktop provider.',\n});\nconst Target = Type.Record(S, Json);\nconst Error = Type.Object({ code: S, message: S });\nconst Artifact = Type.Object({\n artifactId: S,\n status: values(['ready', 'failed']),\n sizeBytes: O(N),\n downloadUrl: O(S),\n previewUrl: O(S),\n actionCount: O(N),\n completedAt: O(S),\n failure: O(Error),\n});\nexport const ComputerStateSchema = Type.Object({\n sessionId: S,\n revision: N,\n wake: N,\n phase: values(['inactive', 'awaiting_confirmation', 'activating', 'active', 'stopping', 'failed']),\n requestId: O(S),\n target: O(Target),\n durationMs: O(N),\n expiresAt: O(N),\n failure: O(Error),\n artifact: O(Artifact),\n});\nconst Reference = { snapshotId: Type.String({ minLength: 1 }), elementRef: Type.String({ minLength: 1 }) };\nexport const ComputerActionSchema = Type.Union([\n Type.Object({ kind: values(['press', 'focus']), ...Reference }, { additionalProperties: false }),\n Type.Object({ kind: Type.Literal('set_value'), ...Reference, value: S }, { additionalProperties: false }),\n Type.Object(\n {\n kind: Type.Literal('scroll'),\n ...Reference,\n direction: values(['up', 'down', 'left', 'right']),\n amount: values(['line', 'page']),\n },\n { additionalProperties: false },\n ),\n]);\nconst internal = (\n method: 'GET' | 'POST',\n path: string,\n output: object,\n body?: object,\n status = 200,\n): DoomHttpContract => ({\n id: `computer.${path.slice(1).replaceAll('/', '.')}`,\n scope: 'session',\n basePath: 'computer-use',\n path,\n method,\n authentication: 'owner',\n description: `Computer use broker ${path}. Requires the host-issued ${path.startsWith('/agent/') ? 'agent' : 'hub'} bearer token.`,\n availability: 'Internal broker route; ordinary browser credentials are insufficient.',\n parameters: [{ name: 'Authorization', in: 'header', required: true, schema: Type.String({ pattern: '^Bearer .+' }) }],\n ...(body ? { body: { required: true, contentType: 'application/json', schema: body } } : {}),\n responses: jsonApiResponses(output, status),\n});\nexport const apiContracts = defineApiContract({\n version: 1,\n dynamic: ['Desktop provider target extensions, observations and operation results are runtime-defined JSON.'],\n http: [\n {\n id: 'computer.activation.state',\n scope: 'session',\n basePath: 'computer-use',\n path: '/activate',\n method: 'GET',\n authentication: 'owner',\n description: 'Read state as the matching pending requester or approved recording reader.',\n responses: jsonApiResponses(ComputerStateSchema),\n },\n {\n id: 'computer.activation.cancel',\n scope: 'session',\n basePath: 'computer-use',\n path: '/activate',\n method: 'DELETE',\n authentication: 'owner',\n description: 'Cancel only the matching requester pending activation.',\n responses: jsonApiResponses(ComputerStateSchema, 202),\n },\n {\n id: 'computer.activate',\n scope: 'session',\n basePath: 'computer-use',\n path: '/activate',\n method: 'POST',\n authentication: 'owner',\n description:\n 'Request confirmed Desktop access with admitted caller and remote step-up context. A remote caller may omit target so the local Mac selects the window.',\n body: {\n required: true,\n contentType: 'application/json',\n schema: Type.Object({\n target: O(Type.Object({ windowId: S, bundleId: S })),\n durationMs: Type.Integer({ minimum: 1000, maximum: 1800000 }),\n }),\n },\n responses: jsonApiResponses(ComputerStateSchema, 202),\n },\n {\n id: 'computer.artifact',\n scope: 'session',\n basePath: 'computer-use',\n path: '/artifact',\n method: 'GET',\n authentication: 'owner',\n description: 'Read at most 1 MiB of a recording belonging to this session and approved caller.',\n parameters: [\n { name: 'artifactId', in: 'query', required: true, schema: S },\n { name: 'offset', in: 'query', required: true, schema: Type.Integer({ minimum: 0 }) },\n ],\n responses: {\n 206: {\n description: 'Bounded recording bytes.',\n contentType: 'video/mp4',\n schema: Type.String({ format: 'binary' }),\n },\n },\n },\n internal('GET', '/agent/state', ComputerStateSchema),\n internal('GET', '/hub/state', ComputerStateSchema),\n internal('POST', '/agent/observe', Json),\n internal('POST', '/agent/action', Json, ComputerActionSchema),\n internal('POST', '/agent/stop', ComputerStateSchema, undefined, 202),\n internal(\n 'GET',\n '/hub/activation',\n Type.Union([\n Type.Null(),\n Type.Object({\n requestId: S,\n target: Target,\n durationSeconds: N,\n createdAt: N,\n confirmationExpiresAt: N,\n caller: Type.Object({ locality: values(['local', 'remote']), stepUp: S }),\n }),\n ]),\n ),\n internal('GET', '/hub/authorization', Type.Union([Type.Null(), Type.Object({ grantId: S, expiresAt: O(N) })])),\n internal(\n 'GET',\n '/hub/next',\n Type.Union([\n Type.Null(),\n Type.Object({ id: S, operation: values(['observe', 'act']), payload: O(Json), grantId: S, sequence: O(N) }),\n ]),\n ),\n internal('POST', '/hub/complete', ComputerStateSchema, Type.Object({ id: S, error: O(S), result: O(Json) })),\n internal(\n 'POST',\n '/hub/stop',\n ComputerStateSchema,\n Type.Object({ error: O(S), host: O(Type.Object({ grantId: S, expiresAt: N })), artifact: O(Artifact) }),\n ),\n ],\n sockets: (['global', 'workspace'] as const).flatMap((scope) => [\n {\n id: 'computer.state',\n scope,\n service: 'doompi.hub.v1',\n member: 'computer_use_state',\n kind: 'channel',\n direction: 'server-to-client',\n description: 'Computer use channel payload.',\n input: Type.Object({ state: ComputerStateSchema, targets: Type.Array(Target), busy: O(Type.Literal(true)) }),\n },\n {\n id: 'computer.command',\n scope,\n service: 'doompi.hub.v1',\n member: 'computer_use_state',\n kind: 'channel',\n direction: 'client-to-server',\n description: 'Computer use browser channel command.',\n input: Type.Object({ action: values(['status', 'targets', 'stop', 'artifacts']) }),\n },\n ]),\n});\nexport default apiContracts;\n"],"mappings":";;;AAGA,MAAM,IAAI,KAAK,OAAO;AACtB,MAAM,IAAI,KAAK,OAAO;AACtB,MAAM,IAAI,KAAK;AACf,MAAM,UAA4B,UAAe,KAAK,MAAM,MAAM,KAAK,SAAS,KAAK,QAAQ,IAAI,CAAC,CAAC;AACnG,MAAM,OAAO,KAAK,QAAQ,EACxB,aACE,uHACJ,CAAC;AACD,MAAM,SAAS,KAAK,OAAO,GAAG,IAAI;AAClC,MAAM,QAAQ,KAAK,OAAO;CAAE,MAAM;CAAG,SAAS;AAAE,CAAC;AACjD,MAAM,WAAW,KAAK,OAAO;CAC3B,YAAY;CACZ,QAAQ,OAAO,CAAC,SAAS,QAAQ,CAAC;CAClC,WAAW,EAAE,CAAC;CACd,aAAa,EAAE,CAAC;CAChB,YAAY,EAAE,CAAC;CACf,aAAa,EAAE,CAAC;CAChB,aAAa,EAAE,CAAC;CAChB,SAAS,EAAE,KAAK;AAClB,CAAC;AACD,MAAa,sBAAsB,KAAK,OAAO;CAC7C,WAAW;CACX,UAAU;CACV,MAAM;CACN,OAAO,OAAO;EAAC;EAAY;EAAyB;EAAc;EAAU;EAAY;CAAQ,CAAC;CACjG,WAAW,EAAE,CAAC;CACd,QAAQ,EAAE,MAAM;CAChB,YAAY,EAAE,CAAC;CACf,WAAW,EAAE,CAAC;CACd,SAAS,EAAE,KAAK;CAChB,UAAU,EAAE,QAAQ;AACtB,CAAC;AACD,MAAM,YAAY;CAAE,YAAY,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;CAAG,YAAY,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;AAAE;AACzG,MAAa,uBAAuB,KAAK,MAAM;CAC7C,KAAK,OAAO;EAAE,MAAM,OAAO,CAAC,SAAS,OAAO,CAAC;EAAG,GAAG;CAAU,GAAG,EAAE,sBAAsB,MAAM,CAA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,MAAM,CACT,KAAK,KAAK,GACV,KAAK,OAAO;GAAE,IAAI;GAAG,WAAW,OAAO,CAAC,WAAW,KAAK,CAAC;GAAG,SAAS,EAAE,IAAI;GAAG,SAAS;GAAG,UAAU,EAAE,CAAC;EAAE,CAAC,CAC5G,CAAC,CACH;EACA,SAAS,QAAQ,iBAAiB,qBAAqB,KAAK,OAAO;GAAE,IAAI;GAAG,OAAO,EAAE,CAAC;GAAG,QAAQ,EAAE,IAAI;EAAE,CAAC,CAAC;EAC3G,SACE,QACA,aACA,qBACA,KAAK,OAAO;GAAE,OAAO,EAAE,CAAC;GAAG,MAAM,EAAE,KAAK,OAAO;IAAE,SAAS;IAAG,WAAW;GAAE,CAAC,CAAC;GAAG,UAAU,EAAE,QAAQ;EAAE,CAAC,CACxG;CACF;CACA,SAAU,CAAC,UAAU,WAAW,CAAC,CAAW,SAAS,UAAU,CAC7D;EACE,IAAI;EACJ;EACA,SAAS;EACT,QAAQ;EACR,MAAM;EACN,WAAW;EACX,aAAa;EACb,OAAO,KAAK,OAAO;GAAE,OAAO;GAAqB,SAAS,KAAK,MAAM,MAAM;GAAG,MAAM,EAAE,KAAK,QAAQ,IAAI,CAAC;EAAE,CAAC;CAC7G,GACA;EACE,IAAI;EACJ;EACA,SAAS;EACT,QAAQ;EACR,MAAM;EACN,WAAW;EACX,aAAa;EACb,OAAO,KAAK,OAAO,EAAE,QAAQ,OAAO;GAAC;GAAU;GAAW;GAAQ;EAAW,CAAC,EAAE,CAAC;CACnF,CACF,CAAC;AACH,CAAC"}
@@ -16,6 +16,7 @@ const COMPUTER_USE_CONFIRMATION_WINDOW_MS = 12e4;
16
16
  */
17
17
  const COMPUTER_USE_ROUTES = {
18
18
  activate: "/activate",
19
+ artifact: "/artifact",
19
20
  agentState: "/agent/state",
20
21
  agentObserve: "/agent/observe",
21
22
  agentAction: "/agent/action",
@@ -213,4 +214,4 @@ Object.defineProperty(exports, "modeState", {
213
214
  }
214
215
  });
215
216
 
216
- //# sourceMappingURL=computerUseMode-KnoOWve4.cjs.map
217
+ //# sourceMappingURL=computerUseMode-C1Cj1ZlK.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computerUseMode-C1Cj1ZlK.cjs","names":["ComputerScriptExecutionError","COMPUTER_USE_TOOL_NAMES"],"sources":["../src/types/computerUseApi.ts","../src/services/computerToolOutput/index.ts","../src/models/computerUseMode.ts"],"sourcesContent":["import type { DoomApiCaller } from '@agimon-ai/doompi-core/packageApi';\n\nexport const API_BASE_PATH = 'computer-use';\nexport const computerUseChannelType = 'computer_use_state';\nexport const COMPUTER_USE_MODE_ID = 'computer-use';\nexport const COMPUTER_USE_STATUS_KEY = 'doom-computer-use';\nexport const COMPUTER_USE_MODE_STATUS_KEY = 'doom-computer-use-mode';\nexport const COMPUTER_USE_MAX_DURATION_MS = 1_800 * 1_000;\nexport const COMPUTER_USE_DEFAULT_DURATION_MS = 300 * 1_000;\nexport const COMPUTER_USE_CONFIRMATION_WINDOW_MS = 2 * 60 * 1_000;\n\n/**\n * Every path this API answers on, below its mount.\n *\n * The typed route table in `./apiRoutes` is built from this, the dispatcher\n * reads that table, and the hub channel addresses the broker with these same\n * strings, so a route cannot move on one side alone.\n */\nexport const COMPUTER_USE_ROUTES = {\n activate: '/activate',\n artifact: '/artifact',\n agentState: '/agent/state',\n agentObserve: '/agent/observe',\n agentAction: '/agent/action',\n agentStop: '/agent/stop',\n hubState: '/hub/state',\n hubActivation: '/hub/activation',\n hubAuthorization: '/hub/authorization',\n hubNext: '/hub/next',\n hubComplete: '/hub/complete',\n hubStop: '/hub/stop',\n} as const;\n\nexport const COMPUTER_USE_WAKE_LIMIT = 1_000_000;\n\nexport interface ComputerUseArtifactView {\n readonly artifactId: string;\n readonly status: 'ready' | 'failed';\n readonly sizeBytes?: number;\n readonly downloadUrl?: string;\n readonly previewUrl?: string;\n readonly actionCount?: number;\n readonly completedAt?: string;\n readonly failure?: { readonly code: string; readonly message: string };\n}\n\nexport interface ComputerUseSessionView {\n readonly sessionId: string;\n readonly revision: number;\n readonly wake: number;\n readonly phase: 'inactive' | 'awaiting_confirmation' | 'activating' | 'active' | 'stopping' | 'failed';\n readonly requestId?: string;\n readonly target?: Record<string, unknown>;\n readonly durationMs?: number;\n readonly expiresAt?: number;\n readonly failure?: { readonly code: string; readonly message: string };\n readonly artifact?: ComputerUseArtifactView;\n}\n\nexport interface ComputerUseActivationRequest {\n readonly requestId: string;\n readonly target?: Record<string, unknown>;\n readonly durationSeconds: number;\n readonly createdAt: number;\n readonly confirmationExpiresAt: number;\n readonly caller: DoomApiCaller;\n}\n\nexport interface ComputerUseBrokerRequest {\n readonly id: string;\n readonly operation: 'observe' | 'act';\n readonly payload?: unknown;\n readonly grantId: string;\n readonly sequence?: number;\n}\n\nexport interface ComputerUseChannelPayload {\n readonly state: ComputerUseSessionView;\n readonly targets: readonly Record<string, unknown>[];\n readonly busy?: true;\n}\n\nexport type ComputerUseBrowserCommand = { readonly action: 'status' | 'targets' | 'stop' | 'artifacts' };\n","import type { DoomHeadlessToolResult } from '@agimon-ai/doompi-core/headless';\n\nimport type { ComputerScriptExecutionResult } from '../../types/computerScript';\nimport type { ComputerUseObservation } from '../../types/computerUse';\nimport { ComputerScriptExecutionError } from '../computerScriptRunner';\n\nconst MAX_TEXT_BYTES = 256 * 1024;\nconst MAX_IMAGE_DATA_LENGTH = 8 * 1024 * 1024;\n\nfunction content(value: unknown, observation: ComputerUseObservation): DoomHeadlessToolResult['content'] {\n const text = JSON.stringify(value);\n if (Buffer.byteLength(text) > MAX_TEXT_BYTES) throw new Error('Computer-use text response exceeds the size limit.');\n const screenshot = observation.screenshot;\n if (screenshot && (screenshot.mimeType !== 'image/png' || screenshot.data.length > MAX_IMAGE_DATA_LENGTH)) {\n throw new Error('Computer-use screenshot exceeds the image limit.');\n }\n return [\n { type: 'text', text },\n ...(screenshot ? [{ type: 'image' as const, mimeType: screenshot.mimeType, data: screenshot.data }] : []),\n ];\n}\n\nexport function computerObservationOutput(observation: ComputerUseObservation) {\n return { content: content({ ...observation, screenshot: undefined }, observation), details: observation };\n}\n\nexport function computerScriptOutput(result: ComputerScriptExecutionResult) {\n try {\n return {\n content: content(\n { ...result, observation: { ...result.observation, screenshot: undefined } },\n result.observation,\n ),\n details: result,\n };\n } catch (error) {\n if (result.metrics === undefined) throw error;\n // Formatting happens after the actions complete. Preserve that progress so a caller does not replay them.\n throw new ComputerScriptExecutionError(\n error instanceof Error ? error.message : String(error),\n result.metrics.actions,\n false,\n );\n }\n}\n\nexport function computerScriptFailure(error: unknown) {\n const details = {\n error: (error instanceof Error ? error.message : String(error)).slice(0, 1024),\n ...(error instanceof ComputerScriptExecutionError\n ? {\n completedActions: error.completedActions,\n outcomeUncertain: error.outcomeUncertain,\n }\n : {}),\n };\n return { content: [{ type: 'text' as const, text: JSON.stringify(details) }], details, isError: true };\n}\n","import type { DoomToolRestriction } from '@agimon-ai/doompi-core/toolSurface';\nimport type { MinorModeState } from '@agimon-ai/doompi-minor-mode';\n\nimport { COMPUTER_USE_TOOL_NAMES } from '../constants/computerUse';\nimport type { ComputerUseSessionView } from '../types/computerUseApi';\nexport function modeState(state?: ComputerUseSessionView, enabled = false): MinorModeState {\n const phase = state?.phase ?? 'inactive';\n const running = phase !== 'inactive' && phase !== 'failed';\n const modeEnabled = enabled || running;\n const activation = modeEnabled\n ? phase === 'stopping'\n ? 'deactivating'\n : phase === 'awaiting_confirmation' || phase === 'activating'\n ? 'activating'\n : 'active'\n : 'inactive';\n return {\n activation,\n condition:\n phase === 'awaiting_confirmation'\n ? 'blocked'\n : phase === 'failed'\n ? 'failed'\n : phase === 'activating' || phase === 'stopping'\n ? 'queued'\n : 'ready',\n ...(modeEnabled && phase === 'inactive' ? { detail: 'configure computer use in Activity' } : {}),\n ...(phase === 'awaiting_confirmation' ? { detail: 'awaiting confirmation in Activity' } : {}),\n actions: [\n {\n id: 'activate',\n enabled: !modeEnabled,\n ...(!modeEnabled ? {} : { disabledReason: 'Computer use is already enabled.' }),\n },\n {\n id: 'deactivate',\n enabled: modeEnabled,\n ...(modeEnabled ? {} : { disabledReason: 'Computer use is not enabled.' }),\n },\n { id: 'doctor', enabled: true },\n ],\n };\n}\n\n/**\n * Hides the computer-use tools while the mode is off.\n *\n * The arbiter starts from every registered tool, so an active mode only has to\n * return the list untouched: nothing has to add the tools back.\n */\nexport function computerUseRestriction(active: boolean): DoomToolRestriction {\n const owned = new Set<string>(COMPUTER_USE_TOOL_NAMES);\n return (incoming) => (active ? incoming : incoming.filter((name) => !owned.has(name)));\n}\n"],"mappings":";;AAEA,MAAa,gBAAgB;AAC7B,MAAa,yBAAyB;AACtC,MAAa,uBAAuB;AACpC,MAAa,0BAA0B;AACvC,MAAa,+BAA+B;AAC5C,MAAa,+BAA+B;AAE5C,MAAa,sCAAsC;;;;;;;;AASnD,MAAa,sBAAsB;CACjC,UAAU;CACV,UAAU;CACV,YAAY;CACZ,cAAc;CACd,aAAa;CACb,WAAW;CACX,UAAU;CACV,eAAe;CACf,kBAAkB;CAClB,SAAS;CACT,aAAa;CACb,SAAS;AACX;AAEA,MAAa,0BAA0B;;;AC3BvC,MAAM,iBAAiB;AACvB,MAAM,wBAAwB;AAE9B,SAAS,QAAQ,OAAgB,aAAwE;CACvG,MAAM,OAAO,KAAK,UAAU,KAAK;CACjC,IAAI,OAAO,WAAW,IAAI,IAAI,gBAAgB,MAAM,IAAI,MAAM,oDAAoD;CAClH,MAAM,aAAa,YAAY;CAC/B,IAAI,eAAe,WAAW,aAAa,eAAe,WAAW,KAAK,SAAS,wBACjF,MAAM,IAAI,MAAM,kDAAkD;CAEpE,OAAO,CACL;EAAE,MAAM;EAAQ;CAAK,GACrB,GAAI,aAAa,CAAC;EAAE,MAAM;EAAkB,UAAU,WAAW;EAAU,MAAM,WAAW;CAAK,CAAC,IAAI,CAAC,CACzG;AACF;AAEA,SAAgB,0BAA0B,aAAqC;CAC7E,OAAO;EAAE,SAAS,QAAQ;GAAE,GAAG;GAAa,YAAY,KAAA;EAAU,G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C/E;GACA;IACE,IAAI;IACJ,SAAS;IACT,GAAI,cAAc,CAAC,IAAI,EAAE,gBAAgB,+BAA+B;GAC1E;GACA;IAAE,IAAI;IAAU,SAAS;GAAK;EAChC;CACF;AACF;;;;;;;AAQA,SAAgB,uBAAuB,QAAsC;CAC3E,MAAM,QAAQ,IAAI,IAAYC,yBAAAA,uBAAuB;CACrD,QAAQ,aAAc,SAAS,WAAW,SAAS,QAAQ,SAAS,CAAC,MAAM,IAAI,IAAI,CAAC;AACtF"}
@@ -16,6 +16,7 @@ const COMPUTER_USE_CONFIRMATION_WINDOW_MS = 12e4;
16
16
  */
17
17
  const COMPUTER_USE_ROUTES = {
18
18
  activate: "/activate",
19
+ artifact: "/artifact",
19
20
  agentState: "/agent/state",
20
21
  agentObserve: "/agent/observe",
21
22
  agentAction: "/agent/action",
@@ -130,4 +131,4 @@ function computerUseRestriction(active) {
130
131
  //#endregion
131
132
  export { computerScriptOutput as a, COMPUTER_USE_MAX_DURATION_MS as c, COMPUTER_USE_ROUTES as d, COMPUTER_USE_STATUS_KEY as f, computerScriptFailure as i, COMPUTER_USE_MODE_ID as l, computerUseChannelType as m, modeState as n, API_BASE_PATH as o, COMPUTER_USE_WAKE_LIMIT as p, computerObservationOutput as r, COMPUTER_USE_CONFIRMATION_WINDOW_MS as s, computerUseRestriction as t, COMPUTER_USE_MODE_STATUS_KEY as u };
132
133
 
133
- //# sourceMappingURL=computerUseMode-C1r5mG7K.mjs.map
134
+ //# sourceMappingURL=computerUseMode-QSRNQAYf.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computerUseMode-QSRNQAYf.mjs","names":[],"sources":["../src/types/computerUseApi.ts","../src/services/computerToolOutput/index.ts","../src/models/computerUseMode.ts"],"sourcesContent":["import type { DoomApiCaller } from '@agimon-ai/doompi-core/packageApi';\n\nexport const API_BASE_PATH = 'computer-use';\nexport const computerUseChannelType = 'computer_use_state';\nexport const COMPUTER_USE_MODE_ID = 'computer-use';\nexport const COMPUTER_USE_STATUS_KEY = 'doom-computer-use';\nexport const COMPUTER_USE_MODE_STATUS_KEY = 'doom-computer-use-mode';\nexport const COMPUTER_USE_MAX_DURATION_MS = 1_800 * 1_000;\nexport const COMPUTER_USE_DEFAULT_DURATION_MS = 300 * 1_000;\nexport const COMPUTER_USE_CONFIRMATION_WINDOW_MS = 2 * 60 * 1_000;\n\n/**\n * Every path this API answers on, below its mount.\n *\n * The typed route table in `./apiRoutes` is built from this, the dispatcher\n * reads that table, and the hub channel addresses the broker with these same\n * strings, so a route cannot move on one side alone.\n */\nexport const COMPUTER_USE_ROUTES = {\n activate: '/activate',\n artifact: '/artifact',\n agentState: '/agent/state',\n agentObserve: '/agent/observe',\n agentAction: '/agent/action',\n agentStop: '/agent/stop',\n hubState: '/hub/state',\n hubActivation: '/hub/activation',\n hubAuthorization: '/hub/authorization',\n hubNext: '/hub/next',\n hubComplete: '/hub/complete',\n hubStop: '/hub/stop',\n} as const;\n\nexport const COMPUTER_USE_WAKE_LIMIT = 1_000_000;\n\nexport interface ComputerUseArtifactView {\n readonly artifactId: string;\n readonly status: 'ready' | 'failed';\n readonly sizeBytes?: number;\n readonly downloadUrl?: string;\n readonly previewUrl?: string;\n readonly actionCount?: number;\n readonly completedAt?: string;\n readonly failure?: { readonly code: string; readonly message: string };\n}\n\nexport interface ComputerUseSessionView {\n readonly sessionId: string;\n readonly revision: number;\n readonly wake: number;\n readonly phase: 'inactive' | 'awaiting_confirmation' | 'activating' | 'active' | 'stopping' | 'failed';\n readonly requestId?: string;\n readonly target?: Record<string, unknown>;\n readonly durationMs?: number;\n readonly expiresAt?: number;\n readonly failure?: { readonly code: string; readonly message: string };\n readonly artifact?: ComputerUseArtifactView;\n}\n\nexport interface ComputerUseActivationRequest {\n readonly requestId: string;\n readonly target?: Record<string, unknown>;\n readonly durationSeconds: number;\n readonly createdAt: number;\n readonly confirmationExpiresAt: number;\n readonly caller: DoomApiCaller;\n}\n\nexport interface ComputerUseBrokerRequest {\n readonly id: string;\n readonly operation: 'observe' | 'act';\n readonly payload?: unknown;\n readonly grantId: string;\n readonly sequence?: number;\n}\n\nexport interface ComputerUseChannelPayload {\n readonly state: ComputerUseSessionView;\n readonly targets: readonly Record<string, unknown>[];\n readonly busy?: true;\n}\n\nexport type ComputerUseBrowserCommand = { readonly action: 'status' | 'targets' | 'stop' | 'artifacts' };\n","import type { DoomHeadlessToolResult } from '@agimon-ai/doompi-core/headless';\n\nimport type { ComputerScriptExecutionResult } from '../../types/computerScript';\nimport type { ComputerUseObservation } from '../../types/computerUse';\nimport { ComputerScriptExecutionError } from '../computerScriptRunner';\n\nconst MAX_TEXT_BYTES = 256 * 1024;\nconst MAX_IMAGE_DATA_LENGTH = 8 * 1024 * 1024;\n\nfunction content(value: unknown, observation: ComputerUseObservation): DoomHeadlessToolResult['content'] {\n const text = JSON.stringify(value);\n if (Buffer.byteLength(text) > MAX_TEXT_BYTES) throw new Error('Computer-use text response exceeds the size limit.');\n const screenshot = observation.screenshot;\n if (screenshot && (screenshot.mimeType !== 'image/png' || screenshot.data.length > MAX_IMAGE_DATA_LENGTH)) {\n throw new Error('Computer-use screenshot exceeds the image limit.');\n }\n return [\n { type: 'text', text },\n ...(screenshot ? [{ type: 'image' as const, mimeType: screenshot.mimeType, data: screenshot.data }] : []),\n ];\n}\n\nexport function computerObservationOutput(observation: ComputerUseObservation) {\n return { content: content({ ...observation, screenshot: undefined }, observation), details: observation };\n}\n\nexport function computerScriptOutput(result: ComputerScriptExecutionResult) {\n try {\n return {\n content: content(\n { ...result, observation: { ...result.observation, screenshot: undefined } },\n result.observation,\n ),\n details: result,\n };\n } catch (error) {\n if (result.metrics === undefined) throw error;\n // Formatting happens after the actions complete. Preserve that progress so a caller does not replay them.\n throw new ComputerScriptExecutionError(\n error instanceof Error ? error.message : String(error),\n result.metrics.actions,\n false,\n );\n }\n}\n\nexport function computerScriptFailure(error: unknown) {\n const details = {\n error: (error instanceof Error ? error.message : String(error)).slice(0, 1024),\n ...(error instanceof ComputerScriptExecutionError\n ? {\n completedActions: error.completedActions,\n outcomeUncertain: error.outcomeUncertain,\n }\n : {}),\n };\n return { content: [{ type: 'text' as const, text: JSON.stringify(details) }], details, isError: true };\n}\n","import type { DoomToolRestriction } from '@agimon-ai/doompi-core/toolSurface';\nimport type { MinorModeState } from '@agimon-ai/doompi-minor-mode';\n\nimport { COMPUTER_USE_TOOL_NAMES } from '../constants/computerUse';\nimport type { ComputerUseSessionView } from '../types/computerUseApi';\nexport function modeState(state?: ComputerUseSessionView, enabled = false): MinorModeState {\n const phase = state?.phase ?? 'inactive';\n const running = phase !== 'inactive' && phase !== 'failed';\n const modeEnabled = enabled || running;\n const activation = modeEnabled\n ? phase === 'stopping'\n ? 'deactivating'\n : phase === 'awaiting_confirmation' || phase === 'activating'\n ? 'activating'\n : 'active'\n : 'inactive';\n return {\n activation,\n condition:\n phase === 'awaiting_confirmation'\n ? 'blocked'\n : phase === 'failed'\n ? 'failed'\n : phase === 'activating' || phase === 'stopping'\n ? 'queued'\n : 'ready',\n ...(modeEnabled && phase === 'inactive' ? { detail: 'configure computer use in Activity' } : {}),\n ...(phase === 'awaiting_confirmation' ? { detail: 'awaiting confirmation in Activity' } : {}),\n actions: [\n {\n id: 'activate',\n enabled: !modeEnabled,\n ...(!modeEnabled ? {} : { disabledReason: 'Computer use is already enabled.' }),\n },\n {\n id: 'deactivate',\n enabled: modeEnabled,\n ...(modeEnabled ? {} : { disabledReason: 'Computer use is not enabled.' }),\n },\n { id: 'doctor', enabled: true },\n ],\n };\n}\n\n/**\n * Hides the computer-use tools while the mode is off.\n *\n * The arbiter starts from every registered tool, so an active mode only has to\n * return the list untouched: nothing has to add the tools back.\n */\nexport function computerUseRestriction(active: boolean): DoomToolRestriction {\n const owned = new Set<string>(COMPUTER_USE_TOOL_NAMES);\n return (incoming) => (active ? incoming : incoming.filter((name) => !owned.has(name)));\n}\n"],"mappings":";;AAEA,MAAa,gBAAgB;AAC7B,MAAa,yBAAyB;AACtC,MAAa,uB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CACpD,MAAM,UAAU;EACd,QAAQ,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,EAAA,CAAG,MAAM,GAAG,IAAI;EAC7E,GAAI,iBAAiB,+BACjB;GACE,kBAAkB,MAAM;GACxB,kBAAkB,MAAM;EAC1B,IACA,CAAC;CACP;CACA,OAAO;EAAE,SAAS,CAAC;GAAE,MAAM;GAAiB,MAAM,KAAK,UAAU,OAAO;EAAE,CAAC;EAAG;EAAS,SAAS;CAAK;AACvG;;;ACpDA,SAAgB,UAAU,OAAgC,UAAU,OAAuB;CACzF,MAAM,QAAQ,OAAO,SAAS;CAE9B,MAAM,cAAc,WADJ,UAAU,cAAc,UAAU;CASlD,OAAO;EACL,YARiB,cACf,UAAU,aACR,iBACA,UAAU,2BAA2B,UAAU,eAC7C,eACA,WACJ;EAGF,WACE,UAAU,0BACN,YACA,UAAU,WACR,WACA,UAAU,gBAAgB,UAAU,aAClC,WACA;EACV,GAAI,eAAe,UAAU,aAAa,EAAE,QAAQ,qCAAqC,IAAI,CAAC;EAC9F,GAAI,UAAU,0BAA0B,EAAE,QAAQ,oCAAoC,IAAI,CAAC;EAC3F,SAAS;GACP;IACE,IAAI;IACJ,SAAS,CAAC;IACV,GAAI,CAAC,cAAc,CAAC,IAAI,EAAE,gBAAgB,mCAAmC;GAC/E;GACA;IACE,IAAI;IACJ,SAAS;IACT,GAAI,cAAc,CAAC,IAAI,EAAE,gBAAgB,+BAA+B;GAC1E;GACA;IAAE,IAAI;IAAU,SAAS;GAAK;EAChC;CACF;AACF;;;;;;;AAQA,SAAgB,uBAAuB,QAAsC;CAC3E,MAAM,QAAQ,IAAI,IAAY,uBAAuB;CACrD,QAAQ,aAAc,SAAS,WAAW,SAAS,QAAQ,SAAS,CAAC,MAAM,IAAI,IAAI,CAAC;AACtF"}
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.cjs","names":["defineRoutedContribution","defineRoutedContribution","defineRoutedContribution","defineMcpPlugin","toolComputerAction","toolComputerExec","toolComputerState"],"sources":["../../src/types/computerUseApi.ts","../../src/services/mcpTools/index.ts","../../src/extensions/workspaces/sessions/(backend)/tool/computer_action.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/computer_exec.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/computer_state.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import type { DoomApiCaller } from '@agimon-ai/doompi-core/packageApi';\n\nexport const API_BASE_PATH = 'computer-use';\nexport const computerUseChannelType = 'computer_use_state';\nexport const COMPUTER_USE_MODE_ID = 'computer-use';\nexport const COMPUTER_USE_STATUS_KEY = 'doom-computer-use';\nexport const COMPUTER_USE_MODE_STATUS_KEY = 'doom-computer-use-mode';\nexport const COMPUTER_USE_MAX_DURATION_MS = 1_800 * 1_000;\nexport const COMPUTER_USE_DEFAULT_DURATION_MS = 300 * 1_000;\nexport const COMPUTER_USE_CONFIRMATION_WINDOW_MS = 2 * 60 * 1_000;\n\n/**\n * Every path this API answers on, below its mount.\n *\n * The typed route table in `./apiRoutes` is built from this, the dispatcher\n * reads that table, and the hub channel addresses the broker with these same\n * strings, so a route cannot move on one side alone.\n */\nexport const COMPUTER_USE_ROUTES = {\n activate: '/activate',\n agentState: '/agent/state',\n agentObserve: '/agent/observe',\n agentAction: '/agent/action',\n agentStop: '/agent/stop',\n hubState: '/hub/state',\n hubActivation: '/hub/activation',\n hubAuthorization: '/hub/authorization',\n hubNext: '/hub/next',\n hubComplete: '/hub/complete',\n hubStop: '/hub/stop',\n} as const;\n\nexport const COMPUTER_USE_WAKE_LIMIT = 1_000_000;\n\nexport interface ComputerUseArtifactView {\n readonly artifactId: string;\n readonly status: 'ready' | 'failed';\n readonly downloadUrl?: string;\n readonly previewUrl?: string;\n readonly actionCount?: number;\n readonly completedAt?: string;\n readonly failure?: { readonly code: string; readonly message: string };\n}\n\nexport interface ComputerUseSessionView {\n readonly sessionId: string;\n readonly revision: number;\n readonly wake: number;\n readonly phase: 'inactive' | 'awaiting_confirmation' | 'activating' | 'active' | 'stopping' | 'failed';\n readonly requestId?: string;\n readonly target?: Record<string, unknown>;\n readonly durationMs?: number;\n readonly expiresAt?: number;\n readonly failure?: { readonly code: string; readonly message: string };\n readonly artifact?: ComputerUseArtifactView;\n}\n\nexport interface ComputerUseActivationRequest {\n readonly requestId: string;\n readonly target: Record<string, unknown>;\n readonly durationSeconds: number;\n readonly createdAt: number;\n readonly confirmationExpiresAt: number;\n readonly caller: DoomApiCaller;\n}\n\nexport interface ComputerUseBrokerRequest {\n readonly id: string;\n readonly operation: 'observe' | 'act';\n readonly payload?: unknown;\n readonly grantId: string;\n readonly sequence?: number;\n}\n\nexport interface ComputerUseChannelPayload {\n readonly state: ComputerUseSessionView;\n readonly targets: readonly Record<string, unknown>[];\n readonly busy?: true;\n}\n\nexport type ComputerUseBrowserCommand = { readonly action: 'status' | 'targets' | 'stop' | 'artifacts' };\n","import type { DoomHeadlessTool } from '@agimon-ai/doompi-core/headless';\nimport type { DoomMcpPluginContext } from '@agimon-ai/doompi-core/mcpFacet';\nimport type { Context } from '@deepseek-ai/cordis';\n\nimport { COMPUTER_USE_MODE_ID } from '../../types/computerUseApi';\n\nexport const COMPUTER_USE_MCP_TOOLS_SERVICE = 'doom/computer-use-mcp-tools';\n\nconst MODE_LABEL = 'Computer Use';\n\nexport interface McpToolCatalog {\n get(name: string): DoomHeadlessTool | undefined;\n names(): readonly string[];\n}\n\nexport function mountMcpTools(tools: readonly DoomHeadlessTool[]) {\n return (context: Context): void => {\n context.plugin((providerContext) => {\n providerContext.provide(COMPUTER_USE_MCP_TOOLS_SERVICE, {\n get: (name) => tools.find((tool) => tool.name === name),\n names: () => tools.map((tool) => tool.name),\n } satisfies McpToolCatalog);\n });\n };\n}\n\nexport function bindMcpTool(context: DoomMcpPluginContext, name: string): DoomHeadlessTool | undefined {\n const catalog = context.services.get<McpToolCatalog>(COMPUTER_USE_MCP_TOOLS_SERVICE);\n const tool = catalog?.get(name);\n if (!tool || !catalog) return undefined;\n return {\n ...tool,\n execute(toolCallId, parameters, signal, onUpdate) {\n const activeModes = context.selection.read().state?.['minor-mode'] ?? [];\n if (!activeModes.includes(COMPUTER_USE_MODE_ID)) {\n const inactiveTools = [...catalog.names()].sort().join(', ');\n throw new Error(`${MODE_LABEL} minor mode is inactive. Inactive ${MODE_LABEL} tools: ${inactiveTools}.`);\n }\n const executionSignal = AbortSignal.any([context.signal, signal ?? context.signal]);\n return tool.execute(toolCallId, parameters, executionSignal, onUpdate, context.execution);\n },\n };\n}\n","import { defineRoutedContribution } from '@agimon-ai/doompi-core/extensionFile';\nimport type { DoomMcpPluginContext } from '@agimon-ai/doompi-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineRoutedContribution((context: DoomMcpPluginContext) => bindMcpTool(context, 'computer_action'), {\n cardinality: 'optional',\n});\n","import { defineRoutedContribution } from '@agimon-ai/doompi-core/extensionFile';\nimport type { DoomMcpPluginContext } from '@agimon-ai/doompi-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineRoutedContribution((context: DoomMcpPluginContext) => bindMcpTool(context, 'computer_exec'), {\n cardinality: 'optional',\n});\n","import { defineRoutedContribution } from '@agimon-ai/doompi-core/extensionFile';\nimport type { DoomMcpPluginContext } from '@agimon-ai/doompi-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineRoutedContribution((context: DoomMcpPluginContext) => bindMcpTool(context, 'computer_state'), {\n cardinality: 'optional',\n});\n","// Generated by @agimon-ai/doompi-build. Do not edit by hand.\nimport { defineMcpPlugin, type DoomMcpSessionPlugin } from '@agimon-ai/doompi-core/mcpFacet';\n\nimport toolComputerAction from '../src/extensions/workspaces/sessions/(backend)/tool/computer_action.mcp';\nimport toolComputerExec from '../src/extensions/workspaces/sessions/(backend)/tool/computer_exec.mcp';\nimport toolComputerState from '../src/extensions/workspaces/sessions/(backend)/tool/computer_state.mcp';\n\ntype Factory<T, C> = (context: C) => T;\nconst at = <T, C>(value: T | Factory<T, C>, context: C): T =>\n typeof value === 'function' ? (value as Factory<T, C>)(context) : value;\n/* v8 ignore next -- generated normalization branch */\nconst defined = <T>(values: readonly (T | undefined)[]): T[] =>\n values.filter((value): value is T => value !== undefined);\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nconst withWidget = <T>(key: string, value: T): T => value === undefined ? value : ({\n ...value, _meta: { ...(value as { _meta?: object })._meta, [\"doompi/widget\"]: key },\n});\n\nexport const mcp = defineMcpPlugin({\n name: '@agimon-ai/doompi-computer-use',\n session: (context) => ({\n get tools(): DoomMcpSessionPlugin['tools'] { return defined([withWidget(\"@agimon-ai/doompi-computer-use/computer_action\", via({ name: 'computer_action' }, at(toolComputerAction, context))), withWidget(\"@agimon-ai/doompi-computer-use/computer_exec\", via({ name: 'computer_exec' }, at(toolComputerExec, context))), withWidget(\"@agimon-ai/doompi-computer-use/computer_state\", via({ name: 'computer_state' }, at(toolComputerState, context)))]); },\n }) satisfies DoomMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;;;;;;ACMA,MAAa,iCAAiC;AAE9C,MAAM,aAAa;AAkBnB,SAAgB,YAAY,SAA+B,MAA4C;CACrG,MAAM,UAAU,QAAQ,SAAS,IAAoB,8BAA8B;CACnF,MAAM,OAAO,SAAS,IAAI,IAAI;CAC9B,IAAI,CAAC,QAAQ,CAAC,SAAS,OAAO,KAAA;CAC9B,OAAO;EACL,GAAG;EACH,QAAQ,YAAY,YAAY,QAAQ,UAAU;GAEhD,IAAI,EADgB,QAAQ,UAAU,KAAK,CAAC,CAAC,QAAQ,iBAAiB,CAAC,EAAA,CACtD,SAAA,cAA6B,GAAG;IAC/C,MAAM,gBAAgB,CAAC,GAAG,QAAQ,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI;IAC3D,MAAM,IAAI,MAAM,GAAG,WAAW,oCAAoC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mB,OAAO,CAAC,CAAC;EAAC,CAAC;CAAG,EAC3b;AACF,CAAC"}
1
+ {"version":3,"file":"mcp.cjs","names":["defineRoutedContribution","defineRoutedContribution","defineRoutedContribution","defineMcpPlugin","toolComputerAction","toolComputerExec","toolComputerState"],"sources":["../../src/types/computerUseApi.ts","../../src/services/mcpTools/index.ts","../../src/extensions/workspaces/sessions/(backend)/tool/computer_action.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/computer_exec.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/computer_state.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import type { DoomApiCaller } from '@agimon-ai/doompi-core/packageApi';\n\nexport const API_BASE_PATH = 'computer-use';\nexport const computerUseChannelType = 'computer_use_state';\nexport const COMPUTER_USE_MODE_ID = 'computer-use';\nexport const COMPUTER_USE_STATUS_KEY = 'doom-computer-use';\nexport const COMPUTER_USE_MODE_STATUS_KEY = 'doom-computer-use-mode';\nexport const COMPUTER_USE_MAX_DURATION_MS = 1_800 * 1_000;\nexport const COMPUTER_USE_DEFAULT_DURATION_MS = 300 * 1_000;\nexport const COMPUTER_USE_CONFIRMATION_WINDOW_MS = 2 * 60 * 1_000;\n\n/**\n * Every path this API answers on, below its mount.\n *\n * The typed route table in `./apiRoutes` is built from this, the dispatcher\n * reads that table, and the hub channel addresses the broker with these same\n * strings, so a route cannot move on one side alone.\n */\nexport const COMPUTER_USE_ROUTES = {\n activate: '/activate',\n artifact: '/artifact',\n agentState: '/agent/state',\n agentObserve: '/agent/observe',\n agentAction: '/agent/action',\n agentStop: '/agent/stop',\n hubState: '/hub/state',\n hubActivation: '/hub/activation',\n hubAuthorization: '/hub/authorization',\n hubNext: '/hub/next',\n hubComplete: '/hub/complete',\n hubStop: '/hub/stop',\n} as const;\n\nexport const COMPUTER_USE_WAKE_LIMIT = 1_000_000;\n\nexport interface ComputerUseArtifactView {\n readonly artifactId: string;\n readonly status: 'ready' | 'failed';\n readonly sizeBytes?: number;\n readonly downloadUrl?: string;\n readonly previewUrl?: string;\n readonly actionCount?: number;\n readonly completedAt?: string;\n readonly failure?: { readonly code: string; readonly message: string };\n}\n\nexport interface ComputerUseSessionView {\n readonly sessionId: string;\n readonly revision: number;\n readonly wake: number;\n readonly phase: 'inactive' | 'awaiting_confirmation' | 'activating' | 'active' | 'stopping' | 'failed';\n readonly requestId?: string;\n readonly target?: Record<string, unknown>;\n readonly durationMs?: number;\n readonly expiresAt?: number;\n readonly failure?: { readonly code: string; readonly message: string };\n readonly artifact?: ComputerUseArtifactView;\n}\n\nexport interface ComputerUseActivationRequest {\n readonly requestId: string;\n readonly target?: Record<string, unknown>;\n readonly durationSeconds: number;\n readonly createdAt: number;\n readonly confirmationExpiresAt: number;\n readonly caller: DoomApiCaller;\n}\n\nexport interface ComputerUseBrokerRequest {\n readonly id: string;\n readonly operation: 'observe' | 'act';\n readonly payload?: unknown;\n readonly grantId: string;\n readonly sequence?: number;\n}\n\nexport interface ComputerUseChannelPayload {\n readonly state: ComputerUseSessionView;\n readonly targets: readonly Record<string, unknown>[];\n readonly busy?: true;\n}\n\nexport type ComputerUseBrowserCommand = { readonly action: 'status' | 'targets' | 'stop' | 'artifacts' };\n","import type { DoomHeadlessTool } from '@agimon-ai/doompi-core/headless';\nimport type { DoomMcpPluginContext } from '@agimon-ai/doompi-core/mcpFacet';\nimport type { Context } from '@deepseek-ai/cordis';\n\nimport { COMPUTER_USE_MODE_ID } from '../../types/computerUseApi';\n\nexport const COMPUTER_USE_MCP_TOOLS_SERVICE = 'doom/computer-use-mcp-tools';\n\nconst MODE_LABEL = 'Computer Use';\n\nexport interface McpToolCatalog {\n get(name: string): DoomHeadlessTool | undefined;\n names(): readonly string[];\n}\n\nexport function mountMcpTools(tools: readonly DoomHeadlessTool[]) {\n return (context: Context): void => {\n context.plugin((providerContext) => {\n providerContext.provide(COMPUTER_USE_MCP_TOOLS_SERVICE, {\n get: (name) => tools.find((tool) => tool.name === name),\n names: () => tools.map((tool) => tool.name),\n } satisfies McpToolCatalog);\n });\n };\n}\n\nexport function bindMcpTool(context: DoomMcpPluginContext, name: string): DoomHeadlessTool | undefined {\n const catalog = context.services.get<McpToolCatalog>(COMPUTER_USE_MCP_TOOLS_SERVICE);\n const tool = catalog?.get(name);\n if (!tool || !catalog) return undefined;\n return {\n ...tool,\n execute(toolCallId, parameters, signal, onUpdate) {\n const activeModes = context.selection.read().state?.['minor-mode'] ?? [];\n if (!activeModes.includes(COMPUTER_USE_MODE_ID)) {\n const inactiveTools = [...catalog.names()].sort().join(', ');\n throw new Error(`${MODE_LABEL} minor mode is inactive. Inactive ${MODE_LABEL} tools: ${inactiveTools}.`);\n }\n const executionSignal = AbortSignal.any([context.signal, signal ?? context.signal]);\n return tool.execute(toolCallId, parameters, executionSignal, onUpdate, context.execution);\n },\n };\n}\n","import { defineRoutedContribution } from '@agimon-ai/doompi-core/extensionFile';\nimport type { DoomMcpPluginContext } from '@agimon-ai/doompi-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineRoutedContribution((context: DoomMcpPluginContext) => bindMcpTool(context, 'computer_action'), {\n cardinality: 'optional',\n});\n","import { defineRoutedContribution } from '@agimon-ai/doompi-core/extensionFile';\nimport type { DoomMcpPluginContext } from '@agimon-ai/doompi-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineRoutedContribution((context: DoomMcpPluginContext) => bindMcpTool(context, 'computer_exec'), {\n cardinality: 'optional',\n});\n","import { defineRoutedContribution } from '@agimon-ai/doompi-core/extensionFile';\nimport type { DoomMcpPluginContext } from '@agimon-ai/doompi-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineRoutedContribution((context: DoomMcpPluginContext) => bindMcpTool(context, 'computer_state'), {\n cardinality: 'optional',\n});\n","// Generated by @agimon-ai/doompi-build. Do not edit by hand.\nimport { defineMcpPlugin, type DoomMcpSessionPlugin } from '@agimon-ai/doompi-core/mcpFacet';\n\nimport toolComputerAction from '../src/extensions/workspaces/sessions/(backend)/tool/computer_action.mcp';\nimport toolComputerExec from '../src/extensions/workspaces/sessions/(backend)/tool/computer_exec.mcp';\nimport toolComputerState from '../src/extensions/workspaces/sessions/(backend)/tool/computer_state.mcp';\n\ntype Factory<T, C> = (context: C) => T;\nconst at = <T, C>(value: T | Factory<T, C>, context: C): T =>\n typeof value === 'function' ? (value as Factory<T, C>)(context) : value;\n/* v8 ignore next -- generated normalization branch */\nconst defined = <T>(values: readonly (T | undefined)[]): T[] =>\n values.filter((value): value is T => value !== undefined);\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nconst withWidget = <T>(key: string, value: T): T => value === undefined ? value : ({\n ...value, _meta: { ...(value as { _meta?: object })._meta, [\"doompi/widget\"]: key },\n});\n\nexport const mcp = defineMcpPlugin({\n name: '@agimon-ai/doompi-computer-use',\n session: (context) => ({\n get tools(): DoomMcpSessionPlugin['tools'] { return defined([withWidget(\"@agimon-ai/doompi-computer-use/computer_action\", via({ name: 'computer_action' }, at(toolComputerAction, context))), withWidget(\"@agimon-ai/doompi-computer-use/computer_exec\", via({ name: 'computer_exec' }, at(toolComputerExec, context))), withWidget(\"@agimon-ai/doompi-computer-use/computer_state\", via({ name: 'computer_state' }, at(toolComputerState, context)))]); },\n }) satisfies DoomMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;;;;;;ACMA,MAAa,iCAAiC;AAE9C,MAAM,aAAa;AAkBnB,SAAgB,YAAY,SAA+B,MAA4C;CACrG,MAAM,UAAU,QAAQ,SAAS,IAAoB,8BAA8B;CACnF,MAAM,OAAO,SAAS,IAAI,IAAI;CAC9B,IAAI,CAAC,QAAQ,CAAC,SAAS,OAAO,KAAA;CAC9B,OAAO;EACL,GAAG;EACH,QAAQ,YAAY,YAAY,QAAQ,UAAU;GAEhD,IAAI,EADgB,QAAQ,UAAU,KAAK,CAAC,CAAC,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,GAAG,GAAGC,6BAAoB,OAAO,CAAC,CAAC;GAAG,WAAW,gDAAgD,IAAI,EAAE,MAAM,gBAAgB,GAAG,GAAGC,2BAAkB,OAAO,CAAC,CAAC;GAAG,WAAW,iDAAiD,IAAI,EAAE,MAAM,iBAAiB,GAAG,GAAGC,4BAAmB,OAAO,CAAC,CAAC;EAAC,CAAC;CAAG,EAC3b;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.mjs","names":["toolComputerAction","toolComputerExec","toolComputerState"],"sources":["../../src/types/computerUseApi.ts","../../src/services/mcpTools/index.ts","../../src/extensions/workspaces/sessions/(backend)/tool/computer_action.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/computer_exec.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/computer_state.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import type { DoomApiCaller } from '@agimon-ai/doompi-core/packageApi';\n\nexport const API_BASE_PATH = 'computer-use';\nexport const computerUseChannelType = 'computer_use_state';\nexport const COMPUTER_USE_MODE_ID = 'computer-use';\nexport const COMPUTER_USE_STATUS_KEY = 'doom-computer-use';\nexport const COMPUTER_USE_MODE_STATUS_KEY = 'doom-computer-use-mode';\nexport const COMPUTER_USE_MAX_DURATION_MS = 1_800 * 1_000;\nexport const COMPUTER_USE_DEFAULT_DURATION_MS = 300 * 1_000;\nexport const COMPUTER_USE_CONFIRMATION_WINDOW_MS = 2 * 60 * 1_000;\n\n/**\n * Every path this API answers on, below its mount.\n *\n * The typed route table in `./apiRoutes` is built from this, the dispatcher\n * reads that table, and the hub channel addresses the broker with these same\n * strings, so a route cannot move on one side alone.\n */\nexport const COMPUTER_USE_ROUTES = {\n activate: '/activate',\n agentState: '/agent/state',\n agentObserve: '/agent/observe',\n agentAction: '/agent/action',\n agentStop: '/agent/stop',\n hubState: '/hub/state',\n hubActivation: '/hub/activation',\n hubAuthorization: '/hub/authorization',\n hubNext: '/hub/next',\n hubComplete: '/hub/complete',\n hubStop: '/hub/stop',\n} as const;\n\nexport const COMPUTER_USE_WAKE_LIMIT = 1_000_000;\n\nexport interface ComputerUseArtifactView {\n readonly artifactId: string;\n readonly status: 'ready' | 'failed';\n readonly downloadUrl?: string;\n readonly previewUrl?: string;\n readonly actionCount?: number;\n readonly completedAt?: string;\n readonly failure?: { readonly code: string; readonly message: string };\n}\n\nexport interface ComputerUseSessionView {\n readonly sessionId: string;\n readonly revision: number;\n readonly wake: number;\n readonly phase: 'inactive' | 'awaiting_confirmation' | 'activating' | 'active' | 'stopping' | 'failed';\n readonly requestId?: string;\n readonly target?: Record<string, unknown>;\n readonly durationMs?: number;\n readonly expiresAt?: number;\n readonly failure?: { readonly code: string; readonly message: string };\n readonly artifact?: ComputerUseArtifactView;\n}\n\nexport interface ComputerUseActivationRequest {\n readonly requestId: string;\n readonly target: Record<string, unknown>;\n readonly durationSeconds: number;\n readonly createdAt: number;\n readonly confirmationExpiresAt: number;\n readonly caller: DoomApiCaller;\n}\n\nexport interface ComputerUseBrokerRequest {\n readonly id: string;\n readonly operation: 'observe' | 'act';\n readonly payload?: unknown;\n readonly grantId: string;\n readonly sequence?: number;\n}\n\nexport interface ComputerUseChannelPayload {\n readonly state: ComputerUseSessionView;\n readonly targets: readonly Record<string, unknown>[];\n readonly busy?: true;\n}\n\nexport type ComputerUseBrowserCommand = { readonly action: 'status' | 'targets' | 'stop' | 'artifacts' };\n","import type { DoomHeadlessTool } from '@agimon-ai/doompi-core/headless';\nimport type { DoomMcpPluginContext } from '@agimon-ai/doompi-core/mcpFacet';\nimport type { Context } from '@deepseek-ai/cordis';\n\nimport { COMPUTER_USE_MODE_ID } from '../../types/computerUseApi';\n\nexport const COMPUTER_USE_MCP_TOOLS_SERVICE = 'doom/computer-use-mcp-tools';\n\nconst MODE_LABEL = 'Computer Use';\n\nexport interface McpToolCatalog {\n get(name: string): DoomHeadlessTool | undefined;\n names(): readonly string[];\n}\n\nexport function mountMcpTools(tools: readonly DoomHeadlessTool[]) {\n return (context: Context): void => {\n context.plugin((providerContext) => {\n providerContext.provide(COMPUTER_USE_MCP_TOOLS_SERVICE, {\n get: (name) => tools.find((tool) => tool.name === name),\n names: () => tools.map((tool) => tool.name),\n } satisfies McpToolCatalog);\n });\n };\n}\n\nexport function bindMcpTool(context: DoomMcpPluginContext, name: string): DoomHeadlessTool | undefined {\n const catalog = context.services.get<McpToolCatalog>(COMPUTER_USE_MCP_TOOLS_SERVICE);\n const tool = catalog?.get(name);\n if (!tool || !catalog) return undefined;\n return {\n ...tool,\n execute(toolCallId, parameters, signal, onUpdate) {\n const activeModes = context.selection.read().state?.['minor-mode'] ?? [];\n if (!activeModes.includes(COMPUTER_USE_MODE_ID)) {\n const inactiveTools = [...catalog.names()].sort().join(', ');\n throw new Error(`${MODE_LABEL} minor mode is inactive. Inactive ${MODE_LABEL} tools: ${inactiveTools}.`);\n }\n const executionSignal = AbortSignal.any([context.signal, signal ?? context.signal]);\n return tool.execute(toolCallId, parameters, executionSignal, onUpdate, context.execution);\n },\n };\n}\n","import { defineRoutedContribution } from '@agimon-ai/doompi-core/extensionFile';\nimport type { DoomMcpPluginContext } from '@agimon-ai/doompi-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineRoutedContribution((context: DoomMcpPluginContext) => bindMcpTool(context, 'computer_action'), {\n cardinality: 'optional',\n});\n","import { defineRoutedContribution } from '@agimon-ai/doompi-core/extensionFile';\nimport type { DoomMcpPluginContext } from '@agimon-ai/doompi-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineRoutedContribution((context: DoomMcpPluginContext) => bindMcpTool(context, 'computer_exec'), {\n cardinality: 'optional',\n});\n","import { defineRoutedContribution } from '@agimon-ai/doompi-core/extensionFile';\nimport type { DoomMcpPluginContext } from '@agimon-ai/doompi-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineRoutedContribution((context: DoomMcpPluginContext) => bindMcpTool(context, 'computer_state'), {\n cardinality: 'optional',\n});\n","// Generated by @agimon-ai/doompi-build. Do not edit by hand.\nimport { defineMcpPlugin, type DoomMcpSessionPlugin } from '@agimon-ai/doompi-core/mcpFacet';\n\nimport toolComputerAction from '../src/extensions/workspaces/sessions/(backend)/tool/computer_action.mcp';\nimport toolComputerExec from '../src/extensions/workspaces/sessions/(backend)/tool/computer_exec.mcp';\nimport toolComputerState from '../src/extensions/workspaces/sessions/(backend)/tool/computer_state.mcp';\n\ntype Factory<T, C> = (context: C) => T;\nconst at = <T, C>(value: T | Factory<T, C>, context: C): T =>\n typeof value === 'function' ? (value as Factory<T, C>)(context) : value;\n/* v8 ignore next -- generated normalization branch */\nconst defined = <T>(values: readonly (T | undefined)[]): T[] =>\n values.filter((value): value is T => value !== undefined);\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nconst withWidget = <T>(key: string, value: T): T => value === undefined ? value : ({\n ...value, _meta: { ...(value as { _meta?: object })._meta, [\"doompi/widget\"]: key },\n});\n\nexport const mcp = defineMcpPlugin({\n name: '@agimon-ai/doompi-computer-use',\n session: (context) => ({\n get tools(): DoomMcpSessionPlugin['tools'] { return defined([withWidget(\"@agimon-ai/doompi-computer-use/computer_action\", via({ name: 'computer_action' }, at(toolComputerAction, context))), withWidget(\"@agimon-ai/doompi-computer-use/computer_exec\", via({ name: 'computer_exec' }, at(toolComputerExec, context))), withWidget(\"@agimon-ai/doompi-computer-use/computer_state\", via({ name: 'computer_state' }, at(toolComputerState, context)))]); },\n }) satisfies DoomMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;;ACMA,MAAa,iCAAiC;AAE9C,MAAM,aAAa;AAkBnB,SAAgB,YAAY,SAA+B,MAA4C;CACrG,MAAM,UAAU,QAAQ,SAAS,IAAoB,8BAA8B;CACnF,MAAM,OAAO,SAAS,IAAI,IAAI;CAC9B,IAAI,CAAC,QAAQ,CAAC,SAAS,OAAO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D,IAAI,EAAE,MAAM,kBAAkB,GAAG,GAAGA,6BAAoB,OAAO,CAAC,CAAC;GAAG,WAAW,gDAAgD,IAAI,EAAE,MAAM,gBAAgB,GAAG,GAAGC,2BAAkB,OAAO,CAAC,CAAC;GAAG,WAAW,iDAAiD,IAAI,EAAE,MAAM,iBAAiB,GAAG,GAAGC,4BAAmB,OAAO,CAAC,CAAC;EAAC,CAAC;CAAG,EAC3b;AACF,CAAC"}
1
+ {"version":3,"file":"mcp.mjs","names":["toolComputerAction","toolComputerExec","toolComputerState"],"sources":["../../src/types/computerUseApi.ts","../../src/services/mcpTools/index.ts","../../src/extensions/workspaces/sessions/(backend)/tool/computer_action.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/computer_exec.mcp.ts","../../src/extensions/workspaces/sessions/(backend)/tool/computer_state.mcp.ts","../../generated/mcp.ts"],"sourcesContent":["import type { DoomApiCaller } from '@agimon-ai/doompi-core/packageApi';\n\nexport const API_BASE_PATH = 'computer-use';\nexport const computerUseChannelType = 'computer_use_state';\nexport const COMPUTER_USE_MODE_ID = 'computer-use';\nexport const COMPUTER_USE_STATUS_KEY = 'doom-computer-use';\nexport const COMPUTER_USE_MODE_STATUS_KEY = 'doom-computer-use-mode';\nexport const COMPUTER_USE_MAX_DURATION_MS = 1_800 * 1_000;\nexport const COMPUTER_USE_DEFAULT_DURATION_MS = 300 * 1_000;\nexport const COMPUTER_USE_CONFIRMATION_WINDOW_MS = 2 * 60 * 1_000;\n\n/**\n * Every path this API answers on, below its mount.\n *\n * The typed route table in `./apiRoutes` is built from this, the dispatcher\n * reads that table, and the hub channel addresses the broker with these same\n * strings, so a route cannot move on one side alone.\n */\nexport const COMPUTER_USE_ROUTES = {\n activate: '/activate',\n artifact: '/artifact',\n agentState: '/agent/state',\n agentObserve: '/agent/observe',\n agentAction: '/agent/action',\n agentStop: '/agent/stop',\n hubState: '/hub/state',\n hubActivation: '/hub/activation',\n hubAuthorization: '/hub/authorization',\n hubNext: '/hub/next',\n hubComplete: '/hub/complete',\n hubStop: '/hub/stop',\n} as const;\n\nexport const COMPUTER_USE_WAKE_LIMIT = 1_000_000;\n\nexport interface ComputerUseArtifactView {\n readonly artifactId: string;\n readonly status: 'ready' | 'failed';\n readonly sizeBytes?: number;\n readonly downloadUrl?: string;\n readonly previewUrl?: string;\n readonly actionCount?: number;\n readonly completedAt?: string;\n readonly failure?: { readonly code: string; readonly message: string };\n}\n\nexport interface ComputerUseSessionView {\n readonly sessionId: string;\n readonly revision: number;\n readonly wake: number;\n readonly phase: 'inactive' | 'awaiting_confirmation' | 'activating' | 'active' | 'stopping' | 'failed';\n readonly requestId?: string;\n readonly target?: Record<string, unknown>;\n readonly durationMs?: number;\n readonly expiresAt?: number;\n readonly failure?: { readonly code: string; readonly message: string };\n readonly artifact?: ComputerUseArtifactView;\n}\n\nexport interface ComputerUseActivationRequest {\n readonly requestId: string;\n readonly target?: Record<string, unknown>;\n readonly durationSeconds: number;\n readonly createdAt: number;\n readonly confirmationExpiresAt: number;\n readonly caller: DoomApiCaller;\n}\n\nexport interface ComputerUseBrokerRequest {\n readonly id: string;\n readonly operation: 'observe' | 'act';\n readonly payload?: unknown;\n readonly grantId: string;\n readonly sequence?: number;\n}\n\nexport interface ComputerUseChannelPayload {\n readonly state: ComputerUseSessionView;\n readonly targets: readonly Record<string, unknown>[];\n readonly busy?: true;\n}\n\nexport type ComputerUseBrowserCommand = { readonly action: 'status' | 'targets' | 'stop' | 'artifacts' };\n","import type { DoomHeadlessTool } from '@agimon-ai/doompi-core/headless';\nimport type { DoomMcpPluginContext } from '@agimon-ai/doompi-core/mcpFacet';\nimport type { Context } from '@deepseek-ai/cordis';\n\nimport { COMPUTER_USE_MODE_ID } from '../../types/computerUseApi';\n\nexport const COMPUTER_USE_MCP_TOOLS_SERVICE = 'doom/computer-use-mcp-tools';\n\nconst MODE_LABEL = 'Computer Use';\n\nexport interface McpToolCatalog {\n get(name: string): DoomHeadlessTool | undefined;\n names(): readonly string[];\n}\n\nexport function mountMcpTools(tools: readonly DoomHeadlessTool[]) {\n return (context: Context): void => {\n context.plugin((providerContext) => {\n providerContext.provide(COMPUTER_USE_MCP_TOOLS_SERVICE, {\n get: (name) => tools.find((tool) => tool.name === name),\n names: () => tools.map((tool) => tool.name),\n } satisfies McpToolCatalog);\n });\n };\n}\n\nexport function bindMcpTool(context: DoomMcpPluginContext, name: string): DoomHeadlessTool | undefined {\n const catalog = context.services.get<McpToolCatalog>(COMPUTER_USE_MCP_TOOLS_SERVICE);\n const tool = catalog?.get(name);\n if (!tool || !catalog) return undefined;\n return {\n ...tool,\n execute(toolCallId, parameters, signal, onUpdate) {\n const activeModes = context.selection.read().state?.['minor-mode'] ?? [];\n if (!activeModes.includes(COMPUTER_USE_MODE_ID)) {\n const inactiveTools = [...catalog.names()].sort().join(', ');\n throw new Error(`${MODE_LABEL} minor mode is inactive. Inactive ${MODE_LABEL} tools: ${inactiveTools}.`);\n }\n const executionSignal = AbortSignal.any([context.signal, signal ?? context.signal]);\n return tool.execute(toolCallId, parameters, executionSignal, onUpdate, context.execution);\n },\n };\n}\n","import { defineRoutedContribution } from '@agimon-ai/doompi-core/extensionFile';\nimport type { DoomMcpPluginContext } from '@agimon-ai/doompi-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineRoutedContribution((context: DoomMcpPluginContext) => bindMcpTool(context, 'computer_action'), {\n cardinality: 'optional',\n});\n","import { defineRoutedContribution } from '@agimon-ai/doompi-core/extensionFile';\nimport type { DoomMcpPluginContext } from '@agimon-ai/doompi-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineRoutedContribution((context: DoomMcpPluginContext) => bindMcpTool(context, 'computer_exec'), {\n cardinality: 'optional',\n});\n","import { defineRoutedContribution } from '@agimon-ai/doompi-core/extensionFile';\nimport type { DoomMcpPluginContext } from '@agimon-ai/doompi-core/mcpFacet';\n\nimport { bindMcpTool } from '../../../../../services/mcpTools';\n\nexport default defineRoutedContribution((context: DoomMcpPluginContext) => bindMcpTool(context, 'computer_state'), {\n cardinality: 'optional',\n});\n","// Generated by @agimon-ai/doompi-build. Do not edit by hand.\nimport { defineMcpPlugin, type DoomMcpSessionPlugin } from '@agimon-ai/doompi-core/mcpFacet';\n\nimport toolComputerAction from '../src/extensions/workspaces/sessions/(backend)/tool/computer_action.mcp';\nimport toolComputerExec from '../src/extensions/workspaces/sessions/(backend)/tool/computer_exec.mcp';\nimport toolComputerState from '../src/extensions/workspaces/sessions/(backend)/tool/computer_state.mcp';\n\ntype Factory<T, C> = (context: C) => T;\nconst at = <T, C>(value: T | Factory<T, C>, context: C): T =>\n typeof value === 'function' ? (value as Factory<T, C>)(context) : value;\n/* v8 ignore next -- generated normalization branch */\nconst defined = <T>(values: readonly (T | undefined)[]): T[] =>\n values.filter((value): value is T => value !== undefined);\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nconst withWidget = <T>(key: string, value: T): T => value === undefined ? value : ({\n ...value, _meta: { ...(value as { _meta?: object })._meta, [\"doompi/widget\"]: key },\n});\n\nexport const mcp = defineMcpPlugin({\n name: '@agimon-ai/doompi-computer-use',\n session: (context) => ({\n get tools(): DoomMcpSessionPlugin['tools'] { return defined([withWidget(\"@agimon-ai/doompi-computer-use/computer_action\", via({ name: 'computer_action' }, at(toolComputerAction, context))), withWidget(\"@agimon-ai/doompi-computer-use/computer_exec\", via({ name: 'computer_exec' }, at(toolComputerExec, context))), withWidget(\"@agimon-ai/doompi-computer-use/computer_state\", via({ name: 'computer_state' }, at(toolComputerState, context)))]); },\n }) satisfies DoomMcpSessionPlugin,\n});\n\nexport default mcp;\n"],"mappings":";;;;ACMA,MAAa,iCAAiC;AAE9C,MAAM,aAAa;AAkBnB,SAAgB,YAAY,SAA+B,MAA4C;CACrG,MAAM,UAAU,QAAQ,SAAS,IAAoB,8BAA8B;CACnF,MAAM,OAAO,SAAS,IAAI,I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AI,QAAuC;EAAE,OAAO,QAAQ;GAAC,WAAW,kDAAkD,IAAI,EAAE,MAAM,kBAAkB,GAAG,GAAGA,6BAAoB,OAAO,CAAC,CAAC;GAAG,WAAW,gDAAgD,IAAI,EAAE,MAAM,gBAAgB,GAAG,GAAGC,2BAAkB,OAAO,CAAC,CAAC;GAAG,WAAW,iDAAiD,IAAI,EAAE,MAAM,iBAAiB,GAAG,GAAGC,4BAAmB,OAAO,CAAC,CAAC;EAAC,CAAC;CAAG,EAC3b;AACF,CAAC"}
@@ -4,7 +4,7 @@ Object.defineProperties(exports, {
4
4
  });
5
5
  const require_extensionService = require("../extensionService-CIDyPyzP.cjs");
6
6
  const require_dependencies = require("../dependencies-BQOsqM8Q.cjs");
7
- const require_computerUseMode = require("../computerUseMode-KnoOWve4.cjs");
7
+ const require_computerUseMode = require("../computerUseMode-C1Cj1ZlK.cjs");
8
8
  let _agimon_ai_doompi_core_piExtension = require("@agimon-ai/doompi-core/piExtension");
9
9
  let _agimon_ai_doompi_core_extensionFile = require("@agimon-ai/doompi-core/extensionFile");
10
10
  let _agimon_ai_doompi_minor_mode = require("@agimon-ai/doompi-minor-mode");
@@ -1,4 +1,4 @@
1
- import { c as ComputerUseExtensionDependencies } from "../index-DoKasntC.mjs";
1
+ import { c as ComputerUseExtensionDependencies } from "../index-B059zxHp.mjs";
2
2
  //#region generated/pi.d.ts
3
3
  export declare const extension: import("@agimon-ai/doompi-core/runtimePiExtension").DefinedPiExtension<ComputerUseExtensionDependencies>;
4
4
  //#endregion
@@ -1,6 +1,6 @@
1
1
  import { a as COMMAND_NAME, i as COMMAND_DESCRIPTION, o as COMPUTER_USE_GUIDANCE } from "../extensionService-BSqhP2uB.mjs";
2
2
  import { n as createComputerUseDependencies } from "../dependencies-ChuvtRxU.mjs";
3
- import { a as computerScriptOutput, f as COMPUTER_USE_STATUS_KEY, i as computerScriptFailure, l as COMPUTER_USE_MODE_ID, n as modeState, r as computerObservationOutput, t as computerUseRestriction, u as COMPUTER_USE_MODE_STATUS_KEY } from "../computerUseMode-C1r5mG7K.mjs";
3
+ import { a as computerScriptOutput, f as COMPUTER_USE_STATUS_KEY, i as computerScriptFailure, l as COMPUTER_USE_MODE_ID, n as modeState, r as computerObservationOutput, t as computerUseRestriction, u as COMPUTER_USE_MODE_STATUS_KEY } from "../computerUseMode-QSRNQAYf.mjs";
4
4
  import { definePiExtension, piToolContributions } from "@agimon-ai/doompi-core/piExtension";
5
5
  import { composeRootHooks, defineCliCommand, defineCliHook, defineCliTool, defineRoot, defineToolRestriction } from "@agimon-ai/doompi-core/extensionFile";
6
6
  import { defineMinorMode, piMinorModes } from "@agimon-ai/doompi-minor-mode";