@agimon-ai/doompi-computer-use 0.0.1-alpha.0

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 (121) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +49 -0
  3. package/dist/_virtual/_rolldown/runtime.cjs +1 -0
  4. package/dist/adapters/computerUseApi.cjs +2 -0
  5. package/dist/adapters/computerUseApi.cjs.map +1 -0
  6. package/dist/adapters/computerUseApi.d.cts +37 -0
  7. package/dist/adapters/computerUseApi.d.cts.map +1 -0
  8. package/dist/adapters/computerUseApi.d.mts +37 -0
  9. package/dist/adapters/computerUseApi.d.mts.map +1 -0
  10. package/dist/adapters/computerUseApi.mjs +2 -0
  11. package/dist/adapters/computerUseApi.mjs.map +1 -0
  12. package/dist/adapters/pi/extension.cjs +3 -0
  13. package/dist/adapters/pi/extension.cjs.map +1 -0
  14. package/dist/adapters/pi/extension.d.cts +12 -0
  15. package/dist/adapters/pi/extension.d.cts.map +1 -0
  16. package/dist/adapters/pi/extension.d.mts +12 -0
  17. package/dist/adapters/pi/extension.d.mts.map +1 -0
  18. package/dist/adapters/pi/extension.mjs +3 -0
  19. package/dist/adapters/pi/extension.mjs.map +1 -0
  20. package/dist/adapters/pi/sessionApiClient.cjs +2 -0
  21. package/dist/adapters/pi/sessionApiClient.cjs.map +1 -0
  22. package/dist/adapters/pi/sessionApiClient.d.cts +26 -0
  23. package/dist/adapters/pi/sessionApiClient.d.cts.map +1 -0
  24. package/dist/adapters/pi/sessionApiClient.d.mts +26 -0
  25. package/dist/adapters/pi/sessionApiClient.d.mts.map +1 -0
  26. package/dist/adapters/pi/sessionApiClient.mjs +2 -0
  27. package/dist/adapters/pi/sessionApiClient.mjs.map +1 -0
  28. package/dist/adapters/webComputerUseAvailability.cjs +2 -0
  29. package/dist/adapters/webComputerUseAvailability.cjs.map +1 -0
  30. package/dist/adapters/webComputerUseAvailability.mjs +2 -0
  31. package/dist/adapters/webComputerUseAvailability.mjs.map +1 -0
  32. package/dist/adapters/webComputerUseChannel.cjs +2 -0
  33. package/dist/adapters/webComputerUseChannel.cjs.map +1 -0
  34. package/dist/adapters/webComputerUseChannel.d.cts +10 -0
  35. package/dist/adapters/webComputerUseChannel.d.cts.map +1 -0
  36. package/dist/adapters/webComputerUseChannel.d.mts +10 -0
  37. package/dist/adapters/webComputerUseChannel.d.mts.map +1 -0
  38. package/dist/adapters/webComputerUseChannel.mjs +2 -0
  39. package/dist/adapters/webComputerUseChannel.mjs.map +1 -0
  40. package/dist/commands/computerUseCommand.cjs +2 -0
  41. package/dist/commands/computerUseCommand.cjs.map +1 -0
  42. package/dist/commands/computerUseCommand.mjs +2 -0
  43. package/dist/commands/computerUseCommand.mjs.map +1 -0
  44. package/dist/container/index.cjs +2 -0
  45. package/dist/container/index.cjs.map +1 -0
  46. package/dist/container/index.d.cts +6 -0
  47. package/dist/container/index.d.cts.map +1 -0
  48. package/dist/container/index.d.mts +6 -0
  49. package/dist/container/index.d.mts.map +1 -0
  50. package/dist/container/index.mjs +2 -0
  51. package/dist/container/index.mjs.map +1 -0
  52. package/dist/extensions/pi.cjs +1 -0
  53. package/dist/extensions/pi.d.cts +2 -0
  54. package/dist/extensions/pi.d.mts +2 -0
  55. package/dist/extensions/pi.mjs +1 -0
  56. package/dist/index.cjs +1 -0
  57. package/dist/index.d.cts +10 -0
  58. package/dist/index.d.mts +10 -0
  59. package/dist/index.mjs +1 -0
  60. package/dist/services/extensionService.cjs +2 -0
  61. package/dist/services/extensionService.cjs.map +1 -0
  62. package/dist/services/extensionService.d.cts +11 -0
  63. package/dist/services/extensionService.d.cts.map +1 -0
  64. package/dist/services/extensionService.d.mts +11 -0
  65. package/dist/services/extensionService.d.mts.map +1 -0
  66. package/dist/services/extensionService.mjs +2 -0
  67. package/dist/services/extensionService.mjs.map +1 -0
  68. package/dist/services/sessionController.cjs +2 -0
  69. package/dist/services/sessionController.cjs.map +1 -0
  70. package/dist/services/sessionController.d.cts +7 -0
  71. package/dist/services/sessionController.d.cts.map +1 -0
  72. package/dist/services/sessionController.d.mts +7 -0
  73. package/dist/services/sessionController.d.mts.map +1 -0
  74. package/dist/services/sessionController.mjs +2 -0
  75. package/dist/services/sessionController.mjs.map +1 -0
  76. package/dist/services/traceRedaction.cjs +2 -0
  77. package/dist/services/traceRedaction.cjs.map +1 -0
  78. package/dist/services/traceRedaction.d.cts +29 -0
  79. package/dist/services/traceRedaction.d.cts.map +1 -0
  80. package/dist/services/traceRedaction.d.mts +29 -0
  81. package/dist/services/traceRedaction.d.mts.map +1 -0
  82. package/dist/services/traceRedaction.mjs +2 -0
  83. package/dist/services/traceRedaction.mjs.map +1 -0
  84. package/dist/sessionApi.cjs +1 -0
  85. package/dist/sessionApi.d.cts +2 -0
  86. package/dist/sessionApi.d.mts +2 -0
  87. package/dist/sessionApi.mjs +1 -0
  88. package/dist/types/computerUse.d.cts +104 -0
  89. package/dist/types/computerUse.d.cts.map +1 -0
  90. package/dist/types/computerUse.d.mts +104 -0
  91. package/dist/types/computerUse.d.mts.map +1 -0
  92. package/dist/types/computerUseApi.cjs +2 -0
  93. package/dist/types/computerUseApi.cjs.map +1 -0
  94. package/dist/types/computerUseApi.d.cts +75 -0
  95. package/dist/types/computerUseApi.d.cts.map +1 -0
  96. package/dist/types/computerUseApi.d.mts +75 -0
  97. package/dist/types/computerUseApi.d.mts.map +1 -0
  98. package/dist/types/computerUseApi.mjs +2 -0
  99. package/dist/types/computerUseApi.mjs.map +1 -0
  100. package/dist/types/extension.d.cts +17 -0
  101. package/dist/types/extension.d.cts.map +1 -0
  102. package/dist/types/extension.d.mts +17 -0
  103. package/dist/types/extension.d.mts.map +1 -0
  104. package/dist/webHub.cjs +1 -0
  105. package/dist/webHub.d.cts +3 -0
  106. package/dist/webHub.d.mts +3 -0
  107. package/dist/webHub.mjs +1 -0
  108. package/llms.txt +11 -0
  109. package/package.json +124 -0
  110. package/src/exports/webClient.ts +2 -0
  111. package/src/prompts/doompi-use-computer-use/SKILL.md +20 -0
  112. package/src/types/computerUse.ts +117 -0
  113. package/src/types/computerUseApi.ts +78 -0
  114. package/src/web/ComputerActionToolCard.tsx +51 -0
  115. package/src/web/ComputerStateToolCard.tsx +51 -0
  116. package/src/web/ComputerUsePanel.tsx +136 -0
  117. package/src/web/computerActionToolRender.ts +20 -0
  118. package/src/web/computerStateToolRender.ts +18 -0
  119. package/src/web/computerUseStore.ts +26 -0
  120. package/src/web/index.ts +41 -0
  121. package/src/web/tsconfig.json +28 -0
@@ -0,0 +1,104 @@
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 {
5
+ readonly sessionId: string;
6
+ readonly runtimeId: string;
7
+ readonly modeEpoch: string;
8
+ }
9
+ interface ComputerUseTarget {
10
+ readonly bundleId: string;
11
+ readonly applicationName: string;
12
+ readonly processId: number;
13
+ readonly windowId: string;
14
+ readonly windowTitle: string;
15
+ }
16
+ interface ComputerUseGrant {
17
+ readonly runId: string;
18
+ readonly grantId: string;
19
+ readonly hostGeneration: string;
20
+ readonly targetGeneration: string;
21
+ readonly expiresAt: number;
22
+ }
23
+ interface ComputerUseElement {
24
+ readonly ref: string;
25
+ readonly role: string;
26
+ readonly label?: string;
27
+ readonly enabled: boolean;
28
+ readonly secure: boolean;
29
+ readonly actions: readonly ComputerUseActionKind[];
30
+ }
31
+ interface ComputerUseObservation {
32
+ readonly runId: string;
33
+ readonly snapshotId: string;
34
+ readonly targetGeneration: string;
35
+ readonly applicationName: string;
36
+ readonly bundleId: string;
37
+ readonly windowTitle: string;
38
+ readonly elements: readonly ComputerUseElement[];
39
+ readonly screenshot: {
40
+ readonly mimeType: 'image/png';
41
+ readonly data: string;
42
+ };
43
+ }
44
+ type ComputerUseActionKind = 'press' | 'set_value' | 'scroll';
45
+ type ComputerUseAction = {
46
+ readonly kind: 'press';
47
+ readonly snapshotId: string;
48
+ readonly elementRef: string;
49
+ } | {
50
+ readonly kind: 'set_value';
51
+ readonly snapshotId: string;
52
+ readonly elementRef: string;
53
+ readonly value: string;
54
+ } | {
55
+ readonly kind: 'scroll';
56
+ readonly snapshotId: string;
57
+ readonly elementRef: string;
58
+ readonly direction: 'up' | 'down' | 'left' | 'right';
59
+ readonly amount: 'line' | 'page';
60
+ };
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 {
63
+ readonly revision: number;
64
+ readonly phase: ComputerUsePhase;
65
+ readonly identity: ComputerUseSessionIdentity;
66
+ readonly requestId?: string;
67
+ readonly target?: ComputerUseTarget;
68
+ readonly grant?: ComputerUseGrant;
69
+ readonly failure?: {
70
+ readonly code: ComputerUseFailureCode;
71
+ readonly message: string;
72
+ };
73
+ }
74
+ type ComputerUseStateEvent = {
75
+ readonly type: 'request';
76
+ readonly requestId: string;
77
+ readonly target: ComputerUseTarget;
78
+ } | {
79
+ readonly type: 'await_confirmation';
80
+ readonly requestId: string;
81
+ } | {
82
+ readonly type: 'confirm';
83
+ readonly requestId: string;
84
+ } | {
85
+ readonly type: 'deny';
86
+ readonly requestId: string;
87
+ } | {
88
+ readonly type: 'activated';
89
+ readonly requestId: string;
90
+ readonly grant: ComputerUseGrant;
91
+ } | {
92
+ readonly type: 'stop';
93
+ } | {
94
+ readonly type: 'stopped';
95
+ } | {
96
+ readonly type: 'fail';
97
+ readonly code: ComputerUseFailureCode;
98
+ readonly message: string;
99
+ } | {
100
+ readonly type: 'reset';
101
+ };
102
+ //#endregion
103
+ export { COMPUTER_USE_PHASES, ComputerUseAction, ComputerUseActionKind, ComputerUseElement, ComputerUseFailureCode, ComputerUseGrant, ComputerUseObservation, ComputerUsePhase, ComputerUseSessionIdentity, ComputerUseState, ComputerUseStateEvent, ComputerUseTarget };
104
+ //# sourceMappingURL=computerUse.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computerUse.d.cts","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"}
@@ -0,0 +1,104 @@
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 {
5
+ readonly sessionId: string;
6
+ readonly runtimeId: string;
7
+ readonly modeEpoch: string;
8
+ }
9
+ interface ComputerUseTarget {
10
+ readonly bundleId: string;
11
+ readonly applicationName: string;
12
+ readonly processId: number;
13
+ readonly windowId: string;
14
+ readonly windowTitle: string;
15
+ }
16
+ interface ComputerUseGrant {
17
+ readonly runId: string;
18
+ readonly grantId: string;
19
+ readonly hostGeneration: string;
20
+ readonly targetGeneration: string;
21
+ readonly expiresAt: number;
22
+ }
23
+ interface ComputerUseElement {
24
+ readonly ref: string;
25
+ readonly role: string;
26
+ readonly label?: string;
27
+ readonly enabled: boolean;
28
+ readonly secure: boolean;
29
+ readonly actions: readonly ComputerUseActionKind[];
30
+ }
31
+ interface ComputerUseObservation {
32
+ readonly runId: string;
33
+ readonly snapshotId: string;
34
+ readonly targetGeneration: string;
35
+ readonly applicationName: string;
36
+ readonly bundleId: string;
37
+ readonly windowTitle: string;
38
+ readonly elements: readonly ComputerUseElement[];
39
+ readonly screenshot: {
40
+ readonly mimeType: 'image/png';
41
+ readonly data: string;
42
+ };
43
+ }
44
+ type ComputerUseActionKind = 'press' | 'set_value' | 'scroll';
45
+ type ComputerUseAction = {
46
+ readonly kind: 'press';
47
+ readonly snapshotId: string;
48
+ readonly elementRef: string;
49
+ } | {
50
+ readonly kind: 'set_value';
51
+ readonly snapshotId: string;
52
+ readonly elementRef: string;
53
+ readonly value: string;
54
+ } | {
55
+ readonly kind: 'scroll';
56
+ readonly snapshotId: string;
57
+ readonly elementRef: string;
58
+ readonly direction: 'up' | 'down' | 'left' | 'right';
59
+ readonly amount: 'line' | 'page';
60
+ };
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 {
63
+ readonly revision: number;
64
+ readonly phase: ComputerUsePhase;
65
+ readonly identity: ComputerUseSessionIdentity;
66
+ readonly requestId?: string;
67
+ readonly target?: ComputerUseTarget;
68
+ readonly grant?: ComputerUseGrant;
69
+ readonly failure?: {
70
+ readonly code: ComputerUseFailureCode;
71
+ readonly message: string;
72
+ };
73
+ }
74
+ type ComputerUseStateEvent = {
75
+ readonly type: 'request';
76
+ readonly requestId: string;
77
+ readonly target: ComputerUseTarget;
78
+ } | {
79
+ readonly type: 'await_confirmation';
80
+ readonly requestId: string;
81
+ } | {
82
+ readonly type: 'confirm';
83
+ readonly requestId: string;
84
+ } | {
85
+ readonly type: 'deny';
86
+ readonly requestId: string;
87
+ } | {
88
+ readonly type: 'activated';
89
+ readonly requestId: string;
90
+ readonly grant: ComputerUseGrant;
91
+ } | {
92
+ readonly type: 'stop';
93
+ } | {
94
+ readonly type: 'stopped';
95
+ } | {
96
+ readonly type: 'fail';
97
+ readonly code: ComputerUseFailureCode;
98
+ readonly message: string;
99
+ } | {
100
+ readonly type: 'reset';
101
+ };
102
+ //#endregion
103
+ export { COMPUTER_USE_PHASES, ComputerUseAction, ComputerUseActionKind, ComputerUseElement, ComputerUseFailureCode, ComputerUseGrant, ComputerUseObservation, ComputerUsePhase, ComputerUseSessionIdentity, ComputerUseState, ComputerUseStateEvent, ComputerUseTarget };
104
+ //# sourceMappingURL=computerUse.d.mts.map
@@ -0,0 +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"}
@@ -0,0 +1,2 @@
1
+ const e={activate:`/activate`,agentState:`/agent/state`,agentObserve:`/agent/observe`,agentAction:`/agent/action`,agentStop:`/agent/stop`,hubState:`/hub/state`,hubActivation:`/hub/activation`,hubAuthorization:`/hub/authorization`,hubNext:`/hub/next`,hubComplete:`/hub/complete`,hubStop:`/hub/stop`};exports.API_BASE_PATH=`computer-use`,exports.COMPUTER_USE_CONFIRMATION_WINDOW_MS=12e4,exports.COMPUTER_USE_MAX_DURATION_MS=18e5,exports.COMPUTER_USE_MODE_ID=`computer-use`,exports.COMPUTER_USE_MODE_STATUS_KEY=`doom-computer-use-mode`,exports.COMPUTER_USE_ROUTES=e,exports.COMPUTER_USE_STATUS_KEY=`doom-computer-use`,exports.COMPUTER_USE_WAKE_LIMIT=1e6,exports.computerUseChannelType=`computer_use_state`;
2
+ //# sourceMappingURL=computerUseApi.cjs.map
@@ -0,0 +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"}
@@ -0,0 +1,75 @@
1
+ import { DoomApiCaller } from "@agimon-ai/doompi-extension-contracts/package-api";
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: {
14
+ readonly activate: '/activate';
15
+ readonly agentState: '/agent/state';
16
+ readonly agentObserve: '/agent/observe';
17
+ readonly agentAction: '/agent/action';
18
+ readonly agentStop: '/agent/stop';
19
+ readonly hubState: '/hub/state';
20
+ readonly hubActivation: '/hub/activation';
21
+ readonly hubAuthorization: '/hub/authorization';
22
+ readonly hubNext: '/hub/next';
23
+ readonly hubComplete: '/hub/complete';
24
+ readonly hubStop: '/hub/stop';
25
+ };
26
+ declare const COMPUTER_USE_WAKE_LIMIT = 1000000;
27
+ interface ComputerUseArtifactView {
28
+ readonly artifactId: string;
29
+ readonly status: 'ready' | 'failed';
30
+ readonly downloadUrl?: string;
31
+ readonly previewUrl?: string;
32
+ readonly actionCount?: number;
33
+ readonly completedAt?: string;
34
+ }
35
+ interface ComputerUseSessionView {
36
+ readonly sessionId: string;
37
+ readonly revision: number;
38
+ readonly wake: number;
39
+ readonly phase: 'inactive' | 'awaiting_confirmation' | 'activating' | 'active' | 'stopping' | 'failed';
40
+ readonly requestId?: string;
41
+ readonly target?: Record<string, unknown>;
42
+ readonly durationMs?: number;
43
+ readonly expiresAt?: number;
44
+ readonly failure?: {
45
+ readonly code: string;
46
+ readonly message: string;
47
+ };
48
+ readonly artifact?: ComputerUseArtifactView;
49
+ }
50
+ interface ComputerUseActivationRequest {
51
+ readonly requestId: string;
52
+ readonly target: Record<string, unknown>;
53
+ readonly durationSeconds: number;
54
+ readonly createdAt: number;
55
+ readonly confirmationExpiresAt: number;
56
+ readonly caller: DoomApiCaller;
57
+ }
58
+ interface ComputerUseBrokerRequest {
59
+ readonly id: string;
60
+ readonly operation: 'observe' | 'act';
61
+ readonly payload?: unknown;
62
+ readonly grantId: string;
63
+ readonly sequence?: number;
64
+ }
65
+ interface ComputerUseChannelPayload {
66
+ readonly state: ComputerUseSessionView;
67
+ readonly targets: readonly Record<string, unknown>[];
68
+ readonly busy?: true;
69
+ }
70
+ type ComputerUseBrowserCommand = {
71
+ readonly action: 'status' | 'targets' | 'stop' | 'artifacts';
72
+ };
73
+ //#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
+ //# sourceMappingURL=computerUseApi.d.cts.map
@@ -0,0 +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"}
@@ -0,0 +1,75 @@
1
+ import { DoomApiCaller } from "@agimon-ai/doompi-extension-contracts/package-api";
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: {
14
+ readonly activate: '/activate';
15
+ readonly agentState: '/agent/state';
16
+ readonly agentObserve: '/agent/observe';
17
+ readonly agentAction: '/agent/action';
18
+ readonly agentStop: '/agent/stop';
19
+ readonly hubState: '/hub/state';
20
+ readonly hubActivation: '/hub/activation';
21
+ readonly hubAuthorization: '/hub/authorization';
22
+ readonly hubNext: '/hub/next';
23
+ readonly hubComplete: '/hub/complete';
24
+ readonly hubStop: '/hub/stop';
25
+ };
26
+ declare const COMPUTER_USE_WAKE_LIMIT = 1000000;
27
+ interface ComputerUseArtifactView {
28
+ readonly artifactId: string;
29
+ readonly status: 'ready' | 'failed';
30
+ readonly downloadUrl?: string;
31
+ readonly previewUrl?: string;
32
+ readonly actionCount?: number;
33
+ readonly completedAt?: string;
34
+ }
35
+ interface ComputerUseSessionView {
36
+ readonly sessionId: string;
37
+ readonly revision: number;
38
+ readonly wake: number;
39
+ readonly phase: 'inactive' | 'awaiting_confirmation' | 'activating' | 'active' | 'stopping' | 'failed';
40
+ readonly requestId?: string;
41
+ readonly target?: Record<string, unknown>;
42
+ readonly durationMs?: number;
43
+ readonly expiresAt?: number;
44
+ readonly failure?: {
45
+ readonly code: string;
46
+ readonly message: string;
47
+ };
48
+ readonly artifact?: ComputerUseArtifactView;
49
+ }
50
+ interface ComputerUseActivationRequest {
51
+ readonly requestId: string;
52
+ readonly target: Record<string, unknown>;
53
+ readonly durationSeconds: number;
54
+ readonly createdAt: number;
55
+ readonly confirmationExpiresAt: number;
56
+ readonly caller: DoomApiCaller;
57
+ }
58
+ interface ComputerUseBrokerRequest {
59
+ readonly id: string;
60
+ readonly operation: 'observe' | 'act';
61
+ readonly payload?: unknown;
62
+ readonly grantId: string;
63
+ readonly sequence?: number;
64
+ }
65
+ interface ComputerUseChannelPayload {
66
+ readonly state: ComputerUseSessionView;
67
+ readonly targets: readonly Record<string, unknown>[];
68
+ readonly busy?: true;
69
+ }
70
+ type ComputerUseBrowserCommand = {
71
+ readonly action: 'status' | 'targets' | 'stop' | 'artifacts';
72
+ };
73
+ //#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
+ //# sourceMappingURL=computerUseApi.d.mts.map
@@ -0,0 +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"}
@@ -0,0 +1,2 @@
1
+ const e=`computer-use`,t=`computer_use_state`,n=`computer-use`,r=`doom-computer-use`,i=`doom-computer-use-mode`,a=18e5,o=12e4,s={activate:`/activate`,agentState:`/agent/state`,agentObserve:`/agent/observe`,agentAction:`/agent/action`,agentStop:`/agent/stop`,hubState:`/hub/state`,hubActivation:`/hub/activation`,hubAuthorization:`/hub/authorization`,hubNext:`/hub/next`,hubComplete:`/hub/complete`,hubStop:`/hub/stop`},c=1e6;export{e as API_BASE_PATH,o as COMPUTER_USE_CONFIRMATION_WINDOW_MS,a as COMPUTER_USE_MAX_DURATION_MS,n as COMPUTER_USE_MODE_ID,i as COMPUTER_USE_MODE_STATUS_KEY,s as COMPUTER_USE_ROUTES,r as COMPUTER_USE_STATUS_KEY,c as COMPUTER_USE_WAKE_LIMIT,t as computerUseChannelType};
2
+ //# sourceMappingURL=computerUseApi.mjs.map
@@ -0,0 +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"}
@@ -0,0 +1,17 @@
1
+ import { ComputerUseSessionClient } from "../adapters/pi/sessionApiClient.cjs";
2
+ //#region src/types/extension.d.ts
3
+ type ComputerUseNotificationLevel = 'info' | 'error';
4
+ interface ComputerUseExtensionResult {
5
+ message: string;
6
+ level: ComputerUseNotificationLevel;
7
+ }
8
+ interface ComputerUseExtensionService {
9
+ execute(): Promise<ComputerUseExtensionResult>;
10
+ }
11
+ interface ComputerUseExtensionDependencies {
12
+ service: ComputerUseExtensionService;
13
+ client?: ComputerUseSessionClient;
14
+ }
15
+ //#endregion
16
+ export { ComputerUseExtensionDependencies, ComputerUseExtensionResult, ComputerUseExtensionService, ComputerUseNotificationLevel };
17
+ //# sourceMappingURL=extension.d.cts.map
@@ -0,0 +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"}
@@ -0,0 +1,17 @@
1
+ import { ComputerUseSessionClient } from "../adapters/pi/sessionApiClient.mjs";
2
+ //#region src/types/extension.d.ts
3
+ type ComputerUseNotificationLevel = 'info' | 'error';
4
+ interface ComputerUseExtensionResult {
5
+ message: string;
6
+ level: ComputerUseNotificationLevel;
7
+ }
8
+ interface ComputerUseExtensionService {
9
+ execute(): Promise<ComputerUseExtensionResult>;
10
+ }
11
+ interface ComputerUseExtensionDependencies {
12
+ service: ComputerUseExtensionService;
13
+ client?: ComputerUseSessionClient;
14
+ }
15
+ //#endregion
16
+ export { ComputerUseExtensionDependencies, ComputerUseExtensionResult, ComputerUseExtensionService, ComputerUseNotificationLevel };
17
+ //# sourceMappingURL=extension.d.mts.map
@@ -0,0 +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"}
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./types/computerUseApi.cjs"),t=require("./adapters/webComputerUseChannel.cjs");exports.computerUseChannelType=e.computerUseChannelType,exports.createComputerUseChannel=t.createComputerUseChannel,exports.webHubChannels=t.webHubChannels;
@@ -0,0 +1,3 @@
1
+ import { computerUseChannelType } from "./types/computerUseApi.cjs";
2
+ import { createComputerUseChannel, webHubChannels } from "./adapters/webComputerUseChannel.cjs";
3
+ export { computerUseChannelType, createComputerUseChannel, webHubChannels };
@@ -0,0 +1,3 @@
1
+ import { computerUseChannelType } from "./types/computerUseApi.mjs";
2
+ import { createComputerUseChannel, webHubChannels } from "./adapters/webComputerUseChannel.mjs";
3
+ export { computerUseChannelType, createComputerUseChannel, webHubChannels };
@@ -0,0 +1 @@
1
+ import{computerUseChannelType as e}from"./types/computerUseApi.mjs";import{createComputerUseChannel as t,webHubChannels as n}from"./adapters/webComputerUseChannel.mjs";export{e as computerUseChannelType,t as createComputerUseChannel,n as webHubChannels};
package/llms.txt ADDED
@@ -0,0 +1,11 @@
1
+ # @agimon-ai/doompi-computer-use
2
+
3
+ Session-scoped semantic computer control through DoomPi Desktop.
4
+
5
+ ## Guidance
6
+
7
+ - [Use Computer Use](./src/prompts/doompi-use-computer-use/SKILL.md): Active-mode safety, observation, action, confirmation, and shutdown guidance.
8
+
9
+ ## Resources
10
+
11
+ - [Package README](./README.md): Installation, activation workflow, tools, API boundaries, and development commands.
package/package.json ADDED
@@ -0,0 +1,124 @@
1
+ {
2
+ "name": "@agimon-ai/doompi-computer-use",
3
+ "version": "0.0.1-alpha.0",
4
+ "description": "Session scoped semantic computer control through the DoomPi Desktop capability.",
5
+ "keywords": [
6
+ "ai",
7
+ "coding-agent",
8
+ "computer-use",
9
+ "developer-tools",
10
+ "doompi",
11
+ "pi-coding-agent",
12
+ "pi-extension",
13
+ "pi-package",
14
+ "typescript"
15
+ ],
16
+ "homepage": "https://agimon.ai",
17
+ "bugs": {
18
+ "url": "https://github.com/AgiFlow/doompi/issues"
19
+ },
20
+ "license": "MIT",
21
+ "author": "Vuong Ngo",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/AgiFlow/doompi.git",
25
+ "directory": "packages/minor/doompi-computer-use"
26
+ },
27
+ "files": [
28
+ "dist",
29
+ "src/web",
30
+ "src/types/computerUse.ts",
31
+ "src/types/computerUseApi.ts",
32
+ "src/exports/webClient.ts",
33
+ "src/prompts",
34
+ "llms.txt",
35
+ "README.md",
36
+ "LICENSE",
37
+ "package.json"
38
+ ],
39
+ "type": "module",
40
+ "main": "./dist/index.cjs",
41
+ "types": "./dist/index.d.mts",
42
+ "jsnext:main": "./dist/index.mjs",
43
+ "exports": {
44
+ ".": {
45
+ "types": "./dist/index.d.mts",
46
+ "import": "./dist/index.mjs",
47
+ "require": "./dist/index.cjs"
48
+ },
49
+ "./extensions/pi": {
50
+ "types": "./dist/extensions/pi.d.mts",
51
+ "import": "./dist/extensions/pi.mjs",
52
+ "require": "./dist/extensions/pi.cjs"
53
+ },
54
+ "./session-api": {
55
+ "types": "./dist/sessionApi.d.mts",
56
+ "import": "./dist/sessionApi.mjs",
57
+ "require": "./dist/sessionApi.cjs"
58
+ },
59
+ "./package.json": "./package.json"
60
+ },
61
+ "publishConfig": {
62
+ "access": "public"
63
+ },
64
+ "dependencies": {
65
+ "@deepseek-ai/cordis": "4.0.1",
66
+ "@agimon-ai/doompi-web-components": "0.0.1-alpha.16",
67
+ "@agimon-ai/doompi-web-contracts": "0.0.1-alpha.19",
68
+ "@agimon-ai/doompi-extension-contracts": "0.0.1-alpha.55"
69
+ },
70
+ "devDependencies": {
71
+ "@earendil-works/pi-coding-agent": "0.85.0",
72
+ "@tanstack/react-store": "0.11.1",
73
+ "@tanstack/store": "0.11.1",
74
+ "@types/node": "26.2.0",
75
+ "@types/react": "19.2.18",
76
+ "@vitest/coverage-v8": "4.1.11",
77
+ "react": "19.2.8",
78
+ "tsdown": "0.22.14",
79
+ "typescript": "7.0.2",
80
+ "vitest": "4.1.11",
81
+ "@agimon-ai/vibe-lint-plugin-doom-extension": "0.0.1-alpha.53"
82
+ },
83
+ "peerDependencies": {
84
+ "@earendil-works/pi-coding-agent": "0.85.0"
85
+ },
86
+ "peerDependenciesMeta": {
87
+ "@earendil-works/pi-coding-agent": {
88
+ "optional": true
89
+ }
90
+ },
91
+ "engines": {
92
+ "node": ">=22.19.0"
93
+ },
94
+ "doompiApi": {
95
+ "basePath": "computer-use",
96
+ "session": {
97
+ "entry": "./src/exports/sessionApi.ts",
98
+ "dist": "./dist/sessionApi.mjs"
99
+ }
100
+ },
101
+ "doompiWeb": {
102
+ "pluginId": "computer-use",
103
+ "channels": [
104
+ "computer_use_state"
105
+ ],
106
+ "client": "./src/exports/webClient.ts",
107
+ "hub": {
108
+ "entry": "./src/exports/webHub.ts",
109
+ "dist": "./dist/webHub.mjs"
110
+ }
111
+ },
112
+ "pi": {
113
+ "extensions": [
114
+ "./dist/extensions/pi.mjs"
115
+ ]
116
+ },
117
+ "scripts": {
118
+ "build": "tsdown",
119
+ "test": "vitest --run",
120
+ "typecheck": "tsc --noEmit && tsc --noEmit -p src/web/tsconfig.json",
121
+ "lint": "oxlint . && oxfmt . --check",
122
+ "fixcode": "oxlint . --fix && oxfmt ."
123
+ }
124
+ }
@@ -0,0 +1,2 @@
1
+ // @scaffold-generated
2
+ export { webPlugin } from '../web/index.ts';
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: doompi-use-computer-use
3
+ description: 'Safely use session-scoped semantic computer control through DoomPi Desktop.'
4
+ ---
5
+
6
+ # Use Computer Use
7
+
8
+ This guidance applies only while the session's Computer Use minor mode is active.
9
+
10
+ ## Guidance
11
+
12
+ - Call `computer_state` before acting and after an action that may change the interface.
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.
15
+ - Never infer screen coordinates, inspect another application, or bypass secure elements.
16
+ - Treat stale snapshots, lost targets, and uncertain outcomes as terminal until a fresh observation clarifies them.
17
+ - Do not automatically retry an uncertain action.
18
+ - Stop Computer Use when the requested task is complete.
19
+
20
+ Activation is session scoped. Select a Desktop target, request activation, and wait for explicit confirmation in the Computer Use cockpit panel. Another session may own the single Desktop run, in which case this session remains inactive and reports which session is busy.