@agimon-ai/doompi-computer-use 0.0.1-alpha.2 → 0.0.1-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +6 -3
  2. package/dist/adapters/computerUseApi.cjs +1 -1
  3. package/dist/adapters/computerUseApi.cjs.map +1 -1
  4. package/dist/adapters/computerUseApi.d.cts +9 -5
  5. package/dist/adapters/computerUseApi.d.cts.map +1 -1
  6. package/dist/adapters/computerUseApi.d.mts +9 -5
  7. package/dist/adapters/computerUseApi.d.mts.map +1 -1
  8. package/dist/adapters/computerUseApi.mjs +1 -1
  9. package/dist/adapters/computerUseApi.mjs.map +1 -1
  10. package/dist/adapters/pi/computerScriptRunner.cjs +45 -0
  11. package/dist/adapters/pi/computerScriptRunner.cjs.map +1 -0
  12. package/dist/adapters/pi/computerScriptRunner.d.cts +12 -0
  13. package/dist/adapters/pi/computerScriptRunner.d.cts.map +1 -0
  14. package/dist/adapters/pi/computerScriptRunner.d.mts +12 -0
  15. package/dist/adapters/pi/computerScriptRunner.d.mts.map +1 -0
  16. package/dist/adapters/pi/computerScriptRunner.mjs +45 -0
  17. package/dist/adapters/pi/computerScriptRunner.mjs.map +1 -0
  18. package/dist/adapters/pi/extension.cjs +2 -2
  19. package/dist/adapters/pi/extension.cjs.map +1 -1
  20. package/dist/adapters/pi/extension.d.cts +4 -4
  21. package/dist/adapters/pi/extension.d.cts.map +1 -1
  22. package/dist/adapters/pi/extension.d.mts +4 -4
  23. package/dist/adapters/pi/extension.d.mts.map +1 -1
  24. package/dist/adapters/pi/extension.mjs +2 -2
  25. package/dist/adapters/pi/extension.mjs.map +1 -1
  26. package/dist/adapters/pi/sessionApiClient.d.cts +3 -4
  27. package/dist/adapters/pi/sessionApiClient.d.cts.map +1 -1
  28. package/dist/adapters/pi/sessionApiClient.d.mts +3 -4
  29. package/dist/adapters/pi/sessionApiClient.d.mts.map +1 -1
  30. package/dist/adapters/webComputerUseChannel.cjs +1 -1
  31. package/dist/adapters/webComputerUseChannel.cjs.map +1 -1
  32. package/dist/adapters/webComputerUseChannel.d.cts +3 -3
  33. package/dist/adapters/webComputerUseChannel.d.cts.map +1 -1
  34. package/dist/adapters/webComputerUseChannel.d.mts +3 -3
  35. package/dist/adapters/webComputerUseChannel.d.mts.map +1 -1
  36. package/dist/adapters/webComputerUseChannel.mjs +1 -1
  37. package/dist/adapters/webComputerUseChannel.mjs.map +1 -1
  38. package/dist/container/index.cjs +1 -1
  39. package/dist/container/index.cjs.map +1 -1
  40. package/dist/container/index.d.cts +2 -2
  41. package/dist/container/index.d.cts.map +1 -1
  42. package/dist/container/index.d.mts +2 -2
  43. package/dist/container/index.d.mts.map +1 -1
  44. package/dist/container/index.mjs +1 -1
  45. package/dist/container/index.mjs.map +1 -1
  46. package/dist/index.cjs +1 -1
  47. package/dist/index.d.cts +4 -2
  48. package/dist/index.d.mts +4 -2
  49. package/dist/index.mjs +1 -1
  50. package/dist/services/extensionService.d.cts +1 -2
  51. package/dist/services/extensionService.d.cts.map +1 -1
  52. package/dist/services/extensionService.d.mts +1 -2
  53. package/dist/services/extensionService.d.mts.map +1 -1
  54. package/dist/services/sessionController.d.cts +2 -3
  55. package/dist/services/sessionController.d.cts.map +1 -1
  56. package/dist/services/sessionController.d.mts +2 -3
  57. package/dist/services/sessionController.d.mts.map +1 -1
  58. package/dist/services/traceRedaction.d.cts +3 -4
  59. package/dist/services/traceRedaction.d.cts.map +1 -1
  60. package/dist/services/traceRedaction.d.mts +3 -4
  61. package/dist/services/traceRedaction.d.mts.map +1 -1
  62. package/dist/types/computerScript.d.cts +38 -0
  63. package/dist/types/computerScript.d.cts.map +1 -0
  64. package/dist/types/computerScript.d.mts +38 -0
  65. package/dist/types/computerScript.d.mts.map +1 -0
  66. package/dist/types/computerUse.d.cts +14 -14
  67. package/dist/types/computerUse.d.cts.map +1 -1
  68. package/dist/types/computerUse.d.mts +14 -14
  69. package/dist/types/computerUse.d.mts.map +1 -1
  70. package/dist/types/computerUseApi.cjs.map +1 -1
  71. package/dist/types/computerUseApi.d.cts +22 -19
  72. package/dist/types/computerUseApi.d.cts.map +1 -1
  73. package/dist/types/computerUseApi.d.mts +22 -19
  74. package/dist/types/computerUseApi.d.mts.map +1 -1
  75. package/dist/types/computerUseApi.mjs.map +1 -1
  76. package/dist/types/extension.d.cts +7 -5
  77. package/dist/types/extension.d.cts.map +1 -1
  78. package/dist/types/extension.d.mts +7 -5
  79. package/dist/types/extension.d.mts.map +1 -1
  80. package/docs/computer-scripts.md +37 -0
  81. package/llms.txt +1 -0
  82. package/package.json +14 -12
  83. package/src/prompts/doompi-use-computer-use/SKILL.md +1 -1
  84. package/src/types/computerUse.ts +3 -2
  85. package/src/types/computerUseApi.ts +1 -0
  86. package/src/web/{ComputerActionToolCard.tsx → components/ComputerActionToolCard.tsx} +1 -1
  87. package/src/web/components/ComputerExecToolCard.tsx +44 -0
  88. package/src/web/{ComputerStateToolCard.tsx → components/ComputerStateToolCard.tsx} +1 -1
  89. package/src/web/{ComputerUsePanel.tsx → components/ComputerUsePanel.tsx} +14 -5
  90. package/src/web/index.ts +12 -6
  91. package/src/web/lib/computerExecToolRender.ts +14 -0
  92. package/src/web/lib/computerUseSettings.ts +17 -0
  93. package/src/web/{computerUseStore.ts → stores/computerUseStore.ts} +2 -2
  94. /package/src/web/{computerActionToolRender.ts → lib/computerActionToolRender.ts} +0 -0
  95. /package/src/web/{computerStateToolRender.ts → lib/computerStateToolRender.ts} +0 -0
@@ -1,34 +1,35 @@
1
1
  //#region src/types/computerUse.d.ts
2
- declare const COMPUTER_USE_PHASES: readonly ['inactive', 'requesting', 'awaiting_confirmation', 'activating', 'active', 'stopping', 'failed'];
3
- type ComputerUsePhase = (typeof COMPUTER_USE_PHASES)[number];
4
- interface ComputerUseSessionIdentity {
2
+ export declare const COMPUTER_USE_PHASES: readonly ['inactive', 'requesting', 'awaiting_confirmation', 'activating', 'active', 'stopping', 'failed'];
3
+ export type ComputerUsePhase = (typeof COMPUTER_USE_PHASES)[number];
4
+ export interface ComputerUseSessionIdentity {
5
5
  readonly sessionId: string;
6
6
  readonly runtimeId: string;
7
7
  readonly modeEpoch: string;
8
8
  }
9
- interface ComputerUseTarget {
9
+ export interface ComputerUseTarget {
10
10
  readonly bundleId: string;
11
11
  readonly applicationName: string;
12
12
  readonly processId: number;
13
13
  readonly windowId: string;
14
14
  readonly windowTitle: string;
15
15
  }
16
- interface ComputerUseGrant {
16
+ export interface ComputerUseGrant {
17
17
  readonly runId: string;
18
18
  readonly grantId: string;
19
19
  readonly hostGeneration: string;
20
20
  readonly targetGeneration: string;
21
21
  readonly expiresAt: number;
22
22
  }
23
- interface ComputerUseElement {
23
+ export interface ComputerUseElement {
24
24
  readonly ref: string;
25
25
  readonly role: string;
26
26
  readonly label?: string;
27
+ readonly value?: string;
27
28
  readonly enabled: boolean;
28
29
  readonly secure: boolean;
29
30
  readonly actions: readonly ComputerUseActionKind[];
30
31
  }
31
- interface ComputerUseObservation {
32
+ export interface ComputerUseObservation {
32
33
  readonly runId: string;
33
34
  readonly snapshotId: string;
34
35
  readonly targetGeneration: string;
@@ -41,9 +42,9 @@ interface ComputerUseObservation {
41
42
  readonly data: string;
42
43
  };
43
44
  }
44
- type ComputerUseActionKind = 'press' | 'set_value' | 'scroll';
45
- type ComputerUseAction = {
46
- readonly kind: 'press';
45
+ export type ComputerUseActionKind = 'press' | 'focus' | 'set_value' | 'scroll';
46
+ export type ComputerUseAction = {
47
+ readonly kind: 'press' | 'focus';
47
48
  readonly snapshotId: string;
48
49
  readonly elementRef: string;
49
50
  } | {
@@ -58,8 +59,8 @@ type ComputerUseAction = {
58
59
  readonly direction: 'up' | 'down' | 'left' | 'right';
59
60
  readonly amount: 'line' | 'page';
60
61
  };
61
- type ComputerUseFailureCode = 'busy_in_another_session' | 'desktop_unavailable' | 'permission_required_on_mac' | 'confirmation_denied' | 'confirmation_expired' | 'target_invalid' | 'target_lost' | 'recording_failed' | 'trace_failed' | 'grant_expired' | 'stale_request' | 'outcome_uncertain' | 'internal_error';
62
- interface ComputerUseState {
62
+ export type ComputerUseFailureCode = 'busy_in_another_session' | 'desktop_unavailable' | 'permission_required_on_mac' | 'confirmation_denied' | 'confirmation_expired' | 'target_invalid' | 'target_lost' | 'recording_failed' | 'trace_failed' | 'grant_expired' | 'stale_request' | 'outcome_uncertain' | 'internal_error';
63
+ export interface ComputerUseState {
63
64
  readonly revision: number;
64
65
  readonly phase: ComputerUsePhase;
65
66
  readonly identity: ComputerUseSessionIdentity;
@@ -71,7 +72,7 @@ interface ComputerUseState {
71
72
  readonly message: string;
72
73
  };
73
74
  }
74
- type ComputerUseStateEvent = {
75
+ export type ComputerUseStateEvent = {
75
76
  readonly type: 'request';
76
77
  readonly requestId: string;
77
78
  readonly target: ComputerUseTarget;
@@ -100,5 +101,4 @@ type ComputerUseStateEvent = {
100
101
  readonly type: 'reset';
101
102
  };
102
103
  //#endregion
103
- export { COMPUTER_USE_PHASES, ComputerUseAction, ComputerUseActionKind, ComputerUseElement, ComputerUseFailureCode, ComputerUseGrant, ComputerUseObservation, ComputerUsePhase, ComputerUseSessionIdentity, ComputerUseState, ComputerUseStateEvent, ComputerUseTarget };
104
104
  //# sourceMappingURL=computerUse.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"computerUse.d.mts","names":[],"sources":["../../src/types/computerUse.ts"],"mappings":";cAAa;KAUD,2BAA2B;UAEtB;WACN;WACA;WACA;;UAGM;WACN;WACA;WACA;WACA;WACA;;UAGM;WACN;WACA;WACA;WACA;WACA;;UAGM;WACN;WACA;WACA;WACA;WACA;WACA,kBAAkB;;UAGZ;WACN;WACA;WACA;WACA;WACA;WACA;WACA,mBAAmB;WACnB;aACE;aACA;;;KAID;KAEA;WAEG;WACA;WACA;;WAGA;WACA;WACA;WACA;;WAGA;WACA;WACA;WACA;WACA;;KAGH;UAeK;WACN;WACA,OAAO;WACP,UAAU;WACV;WACA,SAAS;WACT,QAAQ;WACR;aACE,MAAM;aACN;;;KAID;WACG;WAA0B;WAA4B,QAAQ;;WAC9D;WAAqC;;WACrC;WAA0B;;WAC1B;WAAuB;;WACvB;WAA4B;WAA4B,OAAO;;WAC/D;;WACA;;WACA;WAAuB,MAAM;WAAiC;;WAC9D"}
1
+ {"version":3,"file":"computerUse.d.mts","names":[],"sources":["../../src/types/computerUse.ts"],"mappings":";qBAAa;YAUD,2BAA2B;iBAEtB;WACN;WACA;WACA;;iBAGM;WACN;WACA;WACA;WACA;WACA;;iBAGM;WACN;WACA;WACA;WACA;WACA;;iBAGM;WACN;WACA;WACA;WACA;WACA;WACA;WACA,kBAAkB;;iBAGZ;WACN;WACA;WACA;WACA;WACA;WACA;WACA,mBAAmB;WACnB;aACE;aACA;;;YAID;YAEA;WAEG;WACA;WACA;;WAGA;WACA;WACA;WACA;;WAGA;WACA;WACA;WACA;WACA;;YAGH;iBAeK;WACN;WACA,OAAO;WACP,UAAU;WACV;WACA,SAAS;WACT,QAAQ;WACR;aACE,MAAM;aACN;;;YAID;WACG;WAA0B;WAA4B,QAAQ;;WAC9D;WAAqC;;WACrC;WAA0B;;WAC1B;WAAuB;;WACvB;WAA4B;WAA4B,OAAO;;WAC/D;;WACA;;WACA;WAAuB,MAAM;WAAiC;;WAC9D"}
@@ -1 +1 @@
1
- {"version":3,"file":"computerUseApi.cjs","names":[],"sources":["../../src/types/computerUseApi.ts"],"sourcesContent":["import type { DoomApiCaller } from '@agimon-ai/doompi-extension-contracts/package-api';\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 SESSION_QUERY_PARAM = 'session';\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\nexport function activationUrl(sessionId: string): string {\n return `/api/plugin/${API_BASE_PATH}/activate?${SESSION_QUERY_PARAM}=${encodeURIComponent(sessionId)}`;\n}\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}\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"],"mappings":"AAEA,MAca,EAAsB,CACjC,SAAU,YACV,WAAY,eACZ,aAAc,iBACd,YAAa,gBACb,UAAW,cACX,SAAU,aACV,cAAe,kBACf,iBAAkB,qBAClB,QAAS,YACT,YAAa,gBACb,QAAS,WACX"}
1
+ {"version":3,"file":"computerUseApi.cjs","names":[],"sources":["../../src/types/computerUseApi.ts"],"sourcesContent":["import type { DoomApiCaller } from '@agimon-ai/doompi-extension-contracts/package-api';\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 SESSION_QUERY_PARAM = 'session';\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\nexport function activationUrl(sessionId: string): string {\n return `/api/plugin/${API_BASE_PATH}/activate?${SESSION_QUERY_PARAM}=${encodeURIComponent(sessionId)}`;\n}\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"],"mappings":"AAEA,MAca,EAAsB,CACjC,SAAU,YACV,WAAY,eACZ,aAAc,iBACd,YAAa,gBACb,UAAW,cACX,SAAU,aACV,cAAe,kBACf,iBAAkB,qBAClB,QAAS,YACT,YAAa,gBACb,QAAS,WACX"}
@@ -1,16 +1,16 @@
1
1
  import { DoomApiCaller } from "@agimon-ai/doompi-extension-contracts/package-api";
2
2
  //#region src/types/computerUseApi.d.ts
3
- declare const API_BASE_PATH = "computer-use";
4
- declare const computerUseChannelType = "computer_use_state";
5
- declare const COMPUTER_USE_MODE_ID = "computer-use";
6
- declare const COMPUTER_USE_STATUS_KEY = "doom-computer-use";
7
- declare const COMPUTER_USE_MODE_STATUS_KEY = "doom-computer-use-mode";
8
- declare const SESSION_QUERY_PARAM = "session";
9
- declare const COMPUTER_USE_MAX_DURATION_MS: number;
10
- declare const COMPUTER_USE_DEFAULT_DURATION_MS: number;
11
- declare const COMPUTER_USE_CONFIRMATION_WINDOW_MS: number;
12
- declare function activationUrl(sessionId: string): string;
13
- declare const COMPUTER_USE_ROUTES: {
3
+ export declare const API_BASE_PATH = "computer-use";
4
+ export declare const computerUseChannelType = "computer_use_state";
5
+ export declare const COMPUTER_USE_MODE_ID = "computer-use";
6
+ export declare const COMPUTER_USE_STATUS_KEY = "doom-computer-use";
7
+ export declare const COMPUTER_USE_MODE_STATUS_KEY = "doom-computer-use-mode";
8
+ export declare const SESSION_QUERY_PARAM = "session";
9
+ export declare const COMPUTER_USE_MAX_DURATION_MS: number;
10
+ export declare const COMPUTER_USE_DEFAULT_DURATION_MS: number;
11
+ export declare const COMPUTER_USE_CONFIRMATION_WINDOW_MS: number;
12
+ export declare function activationUrl(sessionId: string): string;
13
+ export declare const COMPUTER_USE_ROUTES: {
14
14
  readonly activate: '/activate';
15
15
  readonly agentState: '/agent/state';
16
16
  readonly agentObserve: '/agent/observe';
@@ -23,16 +23,20 @@ declare const COMPUTER_USE_ROUTES: {
23
23
  readonly hubComplete: '/hub/complete';
24
24
  readonly hubStop: '/hub/stop';
25
25
  };
26
- declare const COMPUTER_USE_WAKE_LIMIT = 1000000;
27
- interface ComputerUseArtifactView {
26
+ export declare const COMPUTER_USE_WAKE_LIMIT = 1000000;
27
+ export interface ComputerUseArtifactView {
28
28
  readonly artifactId: string;
29
29
  readonly status: 'ready' | 'failed';
30
30
  readonly downloadUrl?: string;
31
31
  readonly previewUrl?: string;
32
32
  readonly actionCount?: number;
33
33
  readonly completedAt?: string;
34
+ readonly failure?: {
35
+ readonly code: string;
36
+ readonly message: string;
37
+ };
34
38
  }
35
- interface ComputerUseSessionView {
39
+ export interface ComputerUseSessionView {
36
40
  readonly sessionId: string;
37
41
  readonly revision: number;
38
42
  readonly wake: number;
@@ -47,7 +51,7 @@ interface ComputerUseSessionView {
47
51
  };
48
52
  readonly artifact?: ComputerUseArtifactView;
49
53
  }
50
- interface ComputerUseActivationRequest {
54
+ export interface ComputerUseActivationRequest {
51
55
  readonly requestId: string;
52
56
  readonly target: Record<string, unknown>;
53
57
  readonly durationSeconds: number;
@@ -55,21 +59,20 @@ interface ComputerUseActivationRequest {
55
59
  readonly confirmationExpiresAt: number;
56
60
  readonly caller: DoomApiCaller;
57
61
  }
58
- interface ComputerUseBrokerRequest {
62
+ export interface ComputerUseBrokerRequest {
59
63
  readonly id: string;
60
64
  readonly operation: 'observe' | 'act';
61
65
  readonly payload?: unknown;
62
66
  readonly grantId: string;
63
67
  readonly sequence?: number;
64
68
  }
65
- interface ComputerUseChannelPayload {
69
+ export interface ComputerUseChannelPayload {
66
70
  readonly state: ComputerUseSessionView;
67
71
  readonly targets: readonly Record<string, unknown>[];
68
72
  readonly busy?: true;
69
73
  }
70
- type ComputerUseBrowserCommand = {
74
+ export type ComputerUseBrowserCommand = {
71
75
  readonly action: 'status' | 'targets' | 'stop' | 'artifacts';
72
76
  };
73
77
  //#endregion
74
- export { API_BASE_PATH, COMPUTER_USE_CONFIRMATION_WINDOW_MS, COMPUTER_USE_DEFAULT_DURATION_MS, COMPUTER_USE_MAX_DURATION_MS, COMPUTER_USE_MODE_ID, COMPUTER_USE_MODE_STATUS_KEY, COMPUTER_USE_ROUTES, COMPUTER_USE_STATUS_KEY, COMPUTER_USE_WAKE_LIMIT, ComputerUseActivationRequest, ComputerUseArtifactView, ComputerUseBrokerRequest, ComputerUseBrowserCommand, ComputerUseChannelPayload, ComputerUseSessionView, SESSION_QUERY_PARAM, activationUrl, computerUseChannelType };
75
78
  //# sourceMappingURL=computerUseApi.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"computerUseApi.d.cts","names":[],"sources":["../../src/types/computerUseApi.ts"],"mappings":";;cAEa;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;iBAEG,cAAc;cAIjB;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;cAGW;UAEI;WACN;WACA;WACA;WACA;WACA;WACA;;UAGM;WACN;WACA;WACA;WACA;WACA;WACA,SAAS;WACT;WACA;WACA;aAAqB;aAAuB;;WAC5C,WAAW;;UAGL;WACN;WACA,QAAQ;WACR;WACA;WACA;WACA,QAAQ;;UAGF;WACN;WACA;WACA;WACA;WACA;;UAGM;WACN,OAAO;WACP,kBAAkB;WAClB;;KAGC;WAAuC"}
1
+ {"version":3,"file":"computerUseApi.d.cts","names":[],"sources":["../../src/types/computerUseApi.ts"],"mappings":";;qBAEa;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;wBAEG,cAAc;qBAIjB;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;qBAGW;iBAEI;WACN;WACA;WACA;WACA;WACA;WACA;WACA;aAAqB;aAAuB;;;iBAGtC;WACN;WACA;WACA;WACA;WACA;WACA,SAAS;WACT;WACA;WACA;aAAqB;aAAuB;;WAC5C,WAAW;;iBAGL;WACN;WACA,QAAQ;WACR;WACA;WACA;WACA,QAAQ;;iBAGF;WACN;WACA;WACA;WACA;WACA;;iBAGM;WACN,OAAO;WACP,kBAAkB;WAClB;;YAGC;WAAuC"}
@@ -1,16 +1,16 @@
1
1
  import { DoomApiCaller } from "@agimon-ai/doompi-extension-contracts/package-api";
2
2
  //#region src/types/computerUseApi.d.ts
3
- declare const API_BASE_PATH = "computer-use";
4
- declare const computerUseChannelType = "computer_use_state";
5
- declare const COMPUTER_USE_MODE_ID = "computer-use";
6
- declare const COMPUTER_USE_STATUS_KEY = "doom-computer-use";
7
- declare const COMPUTER_USE_MODE_STATUS_KEY = "doom-computer-use-mode";
8
- declare const SESSION_QUERY_PARAM = "session";
9
- declare const COMPUTER_USE_MAX_DURATION_MS: number;
10
- declare const COMPUTER_USE_DEFAULT_DURATION_MS: number;
11
- declare const COMPUTER_USE_CONFIRMATION_WINDOW_MS: number;
12
- declare function activationUrl(sessionId: string): string;
13
- declare const COMPUTER_USE_ROUTES: {
3
+ export declare const API_BASE_PATH = "computer-use";
4
+ export declare const computerUseChannelType = "computer_use_state";
5
+ export declare const COMPUTER_USE_MODE_ID = "computer-use";
6
+ export declare const COMPUTER_USE_STATUS_KEY = "doom-computer-use";
7
+ export declare const COMPUTER_USE_MODE_STATUS_KEY = "doom-computer-use-mode";
8
+ export declare const SESSION_QUERY_PARAM = "session";
9
+ export declare const COMPUTER_USE_MAX_DURATION_MS: number;
10
+ export declare const COMPUTER_USE_DEFAULT_DURATION_MS: number;
11
+ export declare const COMPUTER_USE_CONFIRMATION_WINDOW_MS: number;
12
+ export declare function activationUrl(sessionId: string): string;
13
+ export declare const COMPUTER_USE_ROUTES: {
14
14
  readonly activate: '/activate';
15
15
  readonly agentState: '/agent/state';
16
16
  readonly agentObserve: '/agent/observe';
@@ -23,16 +23,20 @@ declare const COMPUTER_USE_ROUTES: {
23
23
  readonly hubComplete: '/hub/complete';
24
24
  readonly hubStop: '/hub/stop';
25
25
  };
26
- declare const COMPUTER_USE_WAKE_LIMIT = 1000000;
27
- interface ComputerUseArtifactView {
26
+ export declare const COMPUTER_USE_WAKE_LIMIT = 1000000;
27
+ export interface ComputerUseArtifactView {
28
28
  readonly artifactId: string;
29
29
  readonly status: 'ready' | 'failed';
30
30
  readonly downloadUrl?: string;
31
31
  readonly previewUrl?: string;
32
32
  readonly actionCount?: number;
33
33
  readonly completedAt?: string;
34
+ readonly failure?: {
35
+ readonly code: string;
36
+ readonly message: string;
37
+ };
34
38
  }
35
- interface ComputerUseSessionView {
39
+ export interface ComputerUseSessionView {
36
40
  readonly sessionId: string;
37
41
  readonly revision: number;
38
42
  readonly wake: number;
@@ -47,7 +51,7 @@ interface ComputerUseSessionView {
47
51
  };
48
52
  readonly artifact?: ComputerUseArtifactView;
49
53
  }
50
- interface ComputerUseActivationRequest {
54
+ export interface ComputerUseActivationRequest {
51
55
  readonly requestId: string;
52
56
  readonly target: Record<string, unknown>;
53
57
  readonly durationSeconds: number;
@@ -55,21 +59,20 @@ interface ComputerUseActivationRequest {
55
59
  readonly confirmationExpiresAt: number;
56
60
  readonly caller: DoomApiCaller;
57
61
  }
58
- interface ComputerUseBrokerRequest {
62
+ export interface ComputerUseBrokerRequest {
59
63
  readonly id: string;
60
64
  readonly operation: 'observe' | 'act';
61
65
  readonly payload?: unknown;
62
66
  readonly grantId: string;
63
67
  readonly sequence?: number;
64
68
  }
65
- interface ComputerUseChannelPayload {
69
+ export interface ComputerUseChannelPayload {
66
70
  readonly state: ComputerUseSessionView;
67
71
  readonly targets: readonly Record<string, unknown>[];
68
72
  readonly busy?: true;
69
73
  }
70
- type ComputerUseBrowserCommand = {
74
+ export type ComputerUseBrowserCommand = {
71
75
  readonly action: 'status' | 'targets' | 'stop' | 'artifacts';
72
76
  };
73
77
  //#endregion
74
- export { API_BASE_PATH, COMPUTER_USE_CONFIRMATION_WINDOW_MS, COMPUTER_USE_DEFAULT_DURATION_MS, COMPUTER_USE_MAX_DURATION_MS, COMPUTER_USE_MODE_ID, COMPUTER_USE_MODE_STATUS_KEY, COMPUTER_USE_ROUTES, COMPUTER_USE_STATUS_KEY, COMPUTER_USE_WAKE_LIMIT, ComputerUseActivationRequest, ComputerUseArtifactView, ComputerUseBrokerRequest, ComputerUseBrowserCommand, ComputerUseChannelPayload, ComputerUseSessionView, SESSION_QUERY_PARAM, activationUrl, computerUseChannelType };
75
78
  //# sourceMappingURL=computerUseApi.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"computerUseApi.d.mts","names":[],"sources":["../../src/types/computerUseApi.ts"],"mappings":";;cAEa;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;iBAEG,cAAc;cAIjB;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;cAGW;UAEI;WACN;WACA;WACA;WACA;WACA;WACA;;UAGM;WACN;WACA;WACA;WACA;WACA;WACA,SAAS;WACT;WACA;WACA;aAAqB;aAAuB;;WAC5C,WAAW;;UAGL;WACN;WACA,QAAQ;WACR;WACA;WACA;WACA,QAAQ;;UAGF;WACN;WACA;WACA;WACA;WACA;;UAGM;WACN,OAAO;WACP,kBAAkB;WAClB;;KAGC;WAAuC"}
1
+ {"version":3,"file":"computerUseApi.d.mts","names":[],"sources":["../../src/types/computerUseApi.ts"],"mappings":";;qBAEa;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;wBAEG,cAAc;qBAIjB;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;qBAGW;iBAEI;WACN;WACA;WACA;WACA;WACA;WACA;WACA;aAAqB;aAAuB;;;iBAGtC;WACN;WACA;WACA;WACA;WACA;WACA,SAAS;WACT;WACA;WACA;aAAqB;aAAuB;;WAC5C,WAAW;;iBAGL;WACN;WACA,QAAQ;WACR;WACA;WACA;WACA,QAAQ;;iBAGF;WACN;WACA;WACA;WACA;WACA;;iBAGM;WACN,OAAO;WACP,kBAAkB;WAClB;;YAGC;WAAuC"}
@@ -1 +1 @@
1
- {"version":3,"file":"computerUseApi.mjs","names":[],"sources":["../../src/types/computerUseApi.ts"],"sourcesContent":["import type { DoomApiCaller } from '@agimon-ai/doompi-extension-contracts/package-api';\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 SESSION_QUERY_PARAM = 'session';\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\nexport function activationUrl(sessionId: string): string {\n return `/api/plugin/${API_BASE_PATH}/activate?${SESSION_QUERY_PARAM}=${encodeURIComponent(sessionId)}`;\n}\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}\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"],"mappings":"AAEA,MAAa,EAAgB,eAChB,EAAyB,qBACzB,EAAuB,eACvB,EAA0B,oBAC1B,EAA+B,yBAE/B,EAA+B,KAE/B,EAAsC,KAMtC,EAAsB,CACjC,SAAU,YACV,WAAY,eACZ,aAAc,iBACd,YAAa,gBACb,UAAW,cACX,SAAU,aACV,cAAe,kBACf,iBAAkB,qBAClB,QAAS,YACT,YAAa,gBACb,QAAS,WACX,EAEa,EAA0B"}
1
+ {"version":3,"file":"computerUseApi.mjs","names":[],"sources":["../../src/types/computerUseApi.ts"],"sourcesContent":["import type { DoomApiCaller } from '@agimon-ai/doompi-extension-contracts/package-api';\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 SESSION_QUERY_PARAM = 'session';\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\nexport function activationUrl(sessionId: string): string {\n return `/api/plugin/${API_BASE_PATH}/activate?${SESSION_QUERY_PARAM}=${encodeURIComponent(sessionId)}`;\n}\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"],"mappings":"AAEA,MAAa,EAAgB,eAChB,EAAyB,qBACzB,EAAuB,eACvB,EAA0B,oBAC1B,EAA+B,yBAE/B,EAA+B,KAE/B,EAAsC,KAMtC,EAAsB,CACjC,SAAU,YACV,WAAY,eACZ,aAAc,iBACd,YAAa,gBACb,UAAW,cACX,SAAU,aACV,cAAe,kBACf,iBAAkB,qBAClB,QAAS,YACT,YAAa,gBACb,QAAS,WACX,EAEa,EAA0B"}
@@ -1,17 +1,19 @@
1
1
  import { ComputerUseSessionClient } from "../adapters/pi/sessionApiClient.cjs";
2
+ import { ComputerScriptExecutor } from "./computerScript.cjs";
2
3
  //#region src/types/extension.d.ts
3
- type ComputerUseNotificationLevel = 'info' | 'error';
4
- interface ComputerUseExtensionResult {
4
+ export type ComputerUseNotificationLevel = 'info' | 'error';
5
+ export interface ComputerUseExtensionResult {
5
6
  message: string;
6
7
  level: ComputerUseNotificationLevel;
7
8
  }
8
- interface ComputerUseExtensionService {
9
+ export interface ComputerUseExtensionService {
9
10
  execute(): Promise<ComputerUseExtensionResult>;
10
11
  }
11
- interface ComputerUseExtensionDependencies {
12
+ export interface ComputerUseExtensionDependencies {
12
13
  service: ComputerUseExtensionService;
13
14
  client?: ComputerUseSessionClient;
15
+ scriptRunner?: ComputerScriptExecutor;
16
+ enabled?: () => boolean | Promise<boolean>;
14
17
  }
15
18
  //#endregion
16
- export { ComputerUseExtensionDependencies, ComputerUseExtensionResult, ComputerUseExtensionService, ComputerUseNotificationLevel };
17
19
  //# sourceMappingURL=extension.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extension.d.cts","names":[],"sources":["../../src/types/extension.ts"],"mappings":";;KAEY;UAEK;EACf;EACA,OAAO;;UAGQ;EACf,WAAW,QAAQ;;UAGJ;EACf,SAAS;EACT,SAAS"}
1
+ {"version":3,"file":"extension.d.cts","names":[],"sources":["../../src/types/extension.ts"],"mappings":";;;YAGY;iBAEK;EACf;EACA,OAAO;;iBAGQ;EACf,WAAW,QAAQ;;iBAGJ;EACf,SAAS;EACT,SAAS;EACT,eAAe;EACf,0BAA0B"}
@@ -1,17 +1,19 @@
1
1
  import { ComputerUseSessionClient } from "../adapters/pi/sessionApiClient.mjs";
2
+ import { ComputerScriptExecutor } from "./computerScript.mjs";
2
3
  //#region src/types/extension.d.ts
3
- type ComputerUseNotificationLevel = 'info' | 'error';
4
- interface ComputerUseExtensionResult {
4
+ export type ComputerUseNotificationLevel = 'info' | 'error';
5
+ export interface ComputerUseExtensionResult {
5
6
  message: string;
6
7
  level: ComputerUseNotificationLevel;
7
8
  }
8
- interface ComputerUseExtensionService {
9
+ export interface ComputerUseExtensionService {
9
10
  execute(): Promise<ComputerUseExtensionResult>;
10
11
  }
11
- interface ComputerUseExtensionDependencies {
12
+ export interface ComputerUseExtensionDependencies {
12
13
  service: ComputerUseExtensionService;
13
14
  client?: ComputerUseSessionClient;
15
+ scriptRunner?: ComputerScriptExecutor;
16
+ enabled?: () => boolean | Promise<boolean>;
14
17
  }
15
18
  //#endregion
16
- export { ComputerUseExtensionDependencies, ComputerUseExtensionResult, ComputerUseExtensionService, ComputerUseNotificationLevel };
17
19
  //# sourceMappingURL=extension.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extension.d.mts","names":[],"sources":["../../src/types/extension.ts"],"mappings":";;KAEY;UAEK;EACf;EACA,OAAO;;UAGQ;EACf,WAAW,QAAQ;;UAGJ;EACf,SAAS;EACT,SAAS"}
1
+ {"version":3,"file":"extension.d.mts","names":[],"sources":["../../src/types/extension.ts"],"mappings":";;;YAGY;iBAEK;EACf;EACA,OAAO;;iBAGQ;EACf,WAAW,QAAQ;;iBAGJ;EACf,SAAS;EACT,SAAS;EACT,eAAe;EACf,0BAA0B"}
@@ -0,0 +1,37 @@
1
+ # Author computer scripts
2
+
3
+ `computer_exec` runs reusable local TypeScript against the application that the current Desktop grant authorized. Scripts are trusted Node.js programs. They are not sandboxed and can use the full permissions of the Pi process. Only allow scripts you have reviewed.
4
+
5
+ ## Allow a script
6
+
7
+ Set `DOOMPI_COMPUTER_USE_SCRIPT_PATHS` before starting Pi. Its value is a platform-delimited list of exact script paths (`:` on macOS and Linux). Symlinks are resolved before the exact-path check.
8
+
9
+ ```bash
10
+ export DOOMPI_COMPUTER_USE_SCRIPT_PATHS="$PWD/scripts/fill-form.ts:$PWD/scripts/read-summary.ts"
11
+ ```
12
+
13
+ The tool does not accept a directory, glob, inline source, or a path that was not listed. Scripts must use the `.ts` extension.
14
+
15
+ ## Script contract
16
+
17
+ Export a named `run` function. It receives only the active authorized program handle in `context.program`, JSON input, a bounded logger, and an abort signal:
18
+
19
+ ```ts
20
+ import type { ComputerScriptRun } from '@agimon-ai/doompi-computer-use';
21
+
22
+ export const run: ComputerScriptRun = async ({ context: { program }, input, logger, signal }) => {
23
+ if (signal.aborted) throw signal.reason;
24
+
25
+ const options = input as { snapshotId: string; elementRef: string };
26
+ logger.info('Pressing the requested element');
27
+ return program.act({
28
+ kind: 'press',
29
+ snapshotId: options.snapshotId,
30
+ elementRef: options.elementRef,
31
+ });
32
+ };
33
+ ```
34
+
35
+ `program.observe()` returns a semantic observation. `program.act(action)` applies one semantic action. Calls are serialized through the existing session API. A successful run keeps the session active and `computer_exec` returns a fresh observation for the next turn.
36
+
37
+ Scripts are loaded with Node.js type stripping. Use erasable TypeScript syntax. The runner enforces a 30 second execution timeout and a combined 256 KiB bound for input, logs, process output, and the serialized result. Cancellation or a limit breach terminates the worker process. A cancelled in-flight Desktop request can make the session stop because its outcome is uncertain.
package/llms.txt CHANGED
@@ -9,3 +9,4 @@ Session-scoped semantic computer control through DoomPi Desktop.
9
9
  ## Resources
10
10
 
11
11
  - [Package README](./README.md): Installation, activation workflow, tools, API boundaries, and development commands.
12
+ - [Author computer scripts](./docs/computer-scripts.md): Trusted script authorization, runtime contract, limits, and example.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/doompi-computer-use",
3
- "version": "0.0.1-alpha.2",
3
+ "version": "0.0.1-alpha.8",
4
4
  "description": "Session scoped semantic computer control through the DoomPi Desktop capability.",
5
5
  "keywords": [
6
6
  "ai",
@@ -26,6 +26,7 @@
26
26
  },
27
27
  "files": [
28
28
  "dist",
29
+ "docs",
29
30
  "src/web",
30
31
  "src/types/computerUse.ts",
31
32
  "src/types/computerUseApi.ts",
@@ -62,26 +63,27 @@
62
63
  "access": "public"
63
64
  },
64
65
  "dependencies": {
65
- "@deepseek-ai/cordis": "4.0.1",
66
- "@agimon-ai/doompi-extension-contracts": "0.0.1-alpha.57",
67
- "@agimon-ai/doompi-web-components": "0.0.1-alpha.17",
68
- "@agimon-ai/doompi-web-contracts": "0.0.1-alpha.20"
66
+ "@deepseek-ai/cordis": "4.0.2",
67
+ "@agimon-ai/doompi-config": "0.0.1-alpha.63",
68
+ "@agimon-ai/doompi-web-components": "0.0.1-alpha.23",
69
+ "@agimon-ai/doompi-web-contracts": "0.0.1-alpha.26",
70
+ "@agimon-ai/doompi-extension-contracts": "0.0.1-alpha.63"
69
71
  },
70
72
  "devDependencies": {
71
- "@earendil-works/pi-coding-agent": "0.85.0",
73
+ "@earendil-works/pi-coding-agent": "0.85.1",
72
74
  "@tanstack/react-store": "0.11.1",
73
75
  "@tanstack/store": "0.11.1",
74
- "@types/node": "26.2.0",
76
+ "@types/node": "26.4.1",
75
77
  "@types/react": "19.2.18",
76
- "@vitest/coverage-v8": "4.1.11",
78
+ "@vitest/coverage-v8": "5.0.0",
77
79
  "react": "19.2.8",
78
- "tsdown": "0.22.14",
80
+ "tsdown": "0.23.0",
79
81
  "typescript": "7.0.2",
80
- "vitest": "4.1.11",
81
- "@agimon-ai/vibe-lint-plugin-doom-extension": "0.0.1-alpha.54"
82
+ "vitest": "5.0.0",
83
+ "@agimon-ai/vibe-lint-plugin-doom-extension": "0.0.1-alpha.60"
82
84
  },
83
85
  "peerDependencies": {
84
- "@earendil-works/pi-coding-agent": "0.85.0"
86
+ "@earendil-works/pi-coding-agent": "0.85.1"
85
87
  },
86
88
  "peerDependenciesMeta": {
87
89
  "@earendil-works/pi-coding-agent": {
@@ -11,7 +11,7 @@ This guidance applies only while the session's Computer Use minor mode is active
11
11
 
12
12
  - Call `computer_state` before acting and after an action that may change the interface.
13
13
  - Use only snapshot ids and element refs returned by the latest `computer_state` result.
14
- - Call `computer_action` for one semantic `press`, `set_value`, or `scroll` at a time.
14
+ - Call `computer_action` for one semantic `press`, `focus`, `set_value`, or `scroll` at a time.
15
15
  - Never infer screen coordinates, inspect another application, or bypass secure elements.
16
16
  - Treat stale snapshots, lost targets, and uncertain outcomes as terminal until a fresh observation clarifies them.
17
17
  - Do not automatically retry an uncertain action.
@@ -36,6 +36,7 @@ export interface ComputerUseElement {
36
36
  readonly ref: string;
37
37
  readonly role: string;
38
38
  readonly label?: string;
39
+ readonly value?: string;
39
40
  readonly enabled: boolean;
40
41
  readonly secure: boolean;
41
42
  readonly actions: readonly ComputerUseActionKind[];
@@ -55,11 +56,11 @@ export interface ComputerUseObservation {
55
56
  };
56
57
  }
57
58
 
58
- export type ComputerUseActionKind = 'press' | 'set_value' | 'scroll';
59
+ export type ComputerUseActionKind = 'press' | 'focus' | 'set_value' | 'scroll';
59
60
 
60
61
  export type ComputerUseAction =
61
62
  | {
62
- readonly kind: 'press';
63
+ readonly kind: 'press' | 'focus';
63
64
  readonly snapshotId: string;
64
65
  readonly elementRef: string;
65
66
  }
@@ -37,6 +37,7 @@ export interface ComputerUseArtifactView {
37
37
  readonly previewUrl?: string;
38
38
  readonly actionCount?: number;
39
39
  readonly completedAt?: string;
40
+ readonly failure?: { readonly code: string; readonly message: string };
40
41
  }
41
42
 
42
43
  export interface ComputerUseSessionView {
@@ -13,7 +13,7 @@ import {
13
13
  computerActionCallSummary,
14
14
  computerActionCollapsedLines,
15
15
  computerActionResultLines,
16
- } from './computerActionToolRender.ts';
16
+ } from '../lib/computerActionToolRender.ts';
17
17
 
18
18
  /**
19
19
  * The computer_action tool's timeline item: Perform one constrained semantic action in the authorized application window. The shell owns
@@ -0,0 +1,44 @@
1
+ import {
2
+ collapseLines,
3
+ MessageItem,
4
+ MessageItemBody,
5
+ MessageItemHeader,
6
+ MessageItemStatus,
7
+ MessageLines,
8
+ toolTone,
9
+ } from '@agimon-ai/doompi-web-components';
10
+ import type { ToolMessageRenderProps } from '@agimon-ai/doompi-web-contracts';
11
+ import {
12
+ computerExecCallSummary,
13
+ computerExecCollapsedLines,
14
+ computerExecResultLines,
15
+ } from '../lib/computerExecToolRender.ts';
16
+
17
+ export function ComputerExecToolCard({ toolName, args, result, running, isError }: ToolMessageRenderProps) {
18
+ const lines = computerExecResultLines(result);
19
+ const collapsed = collapseLines(lines, computerExecCollapsedLines, false);
20
+ return (
21
+ <MessageItem tone={toolTone({ running, isError })} expandable={collapsed.hidden > 0}>
22
+ {({ expanded }) => {
23
+ const view = expanded ? collapseLines(lines, computerExecCollapsedLines, true) : collapsed;
24
+ return (
25
+ <>
26
+ <MessageItemHeader title={toolName}>
27
+ <span data-testid={`tool-call-${toolName}`} className="min-w-0 flex-1 truncate text-doom-text">
28
+ {computerExecCallSummary(args)}
29
+ </span>
30
+ </MessageItemHeader>
31
+ {view.shown.length > 0 || running || isError ? (
32
+ <MessageItemBody data-testid={`tool-result-${toolName}`} className="flex flex-col gap-1">
33
+ {view.shown.length > 0 ? <MessageLines lines={view.shown} /> : null}
34
+ {view.hidden > 0 ? <MessageItemStatus expands>{view.hidden} more line(s)</MessageItemStatus> : null}
35
+ {running ? <MessageItemStatus tone="running">running</MessageItemStatus> : null}
36
+ {isError ? <MessageItemStatus tone="error">failed</MessageItemStatus> : null}
37
+ </MessageItemBody>
38
+ ) : null}
39
+ </>
40
+ );
41
+ }}
42
+ </MessageItem>
43
+ );
44
+ }
@@ -13,7 +13,7 @@ import {
13
13
  computerStateCallSummary,
14
14
  computerStateCollapsedLines,
15
15
  computerStateResultLines,
16
- } from './computerStateToolRender.ts';
16
+ } from '../lib/computerStateToolRender.ts';
17
17
 
18
18
  /**
19
19
  * The computer_state tool's timeline item: Observe the authorized application window and semantic accessibility state. The shell owns
@@ -1,8 +1,8 @@
1
1
  import type { WebPluginSlotProps } from '@agimon-ai/doompi-web-contracts';
2
2
  import { useStore } from '@tanstack/react-store';
3
3
  import { useEffect, useState } from 'react';
4
- import { activationUrl, COMPUTER_USE_DEFAULT_DURATION_MS, computerUseChannelType } from '../types/computerUseApi.ts';
5
- import { computerUse } from './computerUseStore.ts';
4
+ import { activationUrl, COMPUTER_USE_DEFAULT_DURATION_MS, computerUseChannelType } from '../../types/computerUseApi.ts';
5
+ import { computerUse } from '../stores/computerUseStore.ts';
6
6
 
7
7
  function text(value: unknown, fallback: string): string {
8
8
  return typeof value === 'string' || typeof value === 'number' ? String(value) : fallback;
@@ -122,13 +122,22 @@ export function ComputerUsePanel({ sessionId, sendSessionFrame }: WebPluginSlotP
122
122
  ) : null}
123
123
  {artifact ? (
124
124
  <div data-testid="computer-use-artifact" className="rounded bg-doom-panel p-2">
125
- <strong>Completed artifact</strong>
125
+ <strong>{artifact.status === 'ready' ? 'Completed recording' : 'Recording unavailable'}</strong>
126
126
  <p>ID: {artifact.artifactId}</p>
127
127
  <p>Status: {artifact.status}</p>
128
+ {artifact.failure ? <p className="text-doom-error">{artifact.failure.message}</p> : null}
128
129
  {artifact.completedAt ? <p>Completed: {artifact.completedAt}</p> : null}
129
130
  {artifact.actionCount !== undefined ? <p>Actions: {artifact.actionCount}</p> : null}
130
- {artifact.previewUrl ? <a href={artifact.previewUrl}>Preview</a> : null}
131
- {artifact.downloadUrl ? <a href={artifact.downloadUrl}>Download</a> : null}
131
+ {artifact.status === 'ready' && artifact.previewUrl ? (
132
+ <video className="mt-2 w-full" controls preload="metadata" src={artifact.previewUrl}>
133
+ <track kind="captions" />
134
+ </video>
135
+ ) : null}
136
+ {artifact.status === 'ready' && artifact.downloadUrl ? (
137
+ <a className="mt-2 inline-block text-doom-accent" href={artifact.downloadUrl} download>
138
+ Download recording
139
+ </a>
140
+ ) : null}
132
141
  </div>
133
142
  ) : null}
134
143
  </div>