@agimon-ai/po-computer-use 0.0.0-alpha.195 → 0.0.0-alpha.196
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.
- package/dist/extensions/mcp-ui.mjs +12 -9
- package/dist/extensions/mcp-ui.mjs.map +1 -1
- package/dist/extensions/native.mjs +116 -67
- package/dist/extensions/native.mjs.map +1 -1
- package/dist/extensions/web.mjs +195 -114
- package/dist/extensions/web.mjs.map +1 -1
- package/dist/po-runtime-identity.json +1 -1
- package/package.json +12 -12
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { defineMcpWidget } from "@agimon-ai/po-core/web";
|
|
1
|
+
import { defineMcpWidget, useT } from "@agimon-ai/po-core/web";
|
|
2
2
|
import { McpToolFields, McpToolFrame, McpToolOutput } from "@agimon-ai/po-web-components";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
//#region src/extensions/workspaces/sessions/(frontend)/tool/computer_action.mcp.tsx
|
|
5
5
|
function ComputerActionMcpWidget(props) {
|
|
6
|
+
const t = useT();
|
|
6
7
|
return /* @__PURE__ */ jsxs(McpToolFrame, {
|
|
7
8
|
...props,
|
|
8
|
-
title: "Interact with application",
|
|
9
|
+
title: t("computerUse.ui.interactWithApplication", "Interact with application"),
|
|
9
10
|
children: [/* @__PURE__ */ jsx(McpToolFields, { fields: [
|
|
10
|
-
["Action", props.args.kind],
|
|
11
|
-
["Element", props.args.elementRef],
|
|
12
|
-
["Direction", props.args.direction],
|
|
13
|
-
["Amount", props.args.amount]
|
|
11
|
+
[t("computerUse.ui.action", "Action"), props.args.kind],
|
|
12
|
+
[t("computerUse.ui.element", "Element"), props.args.elementRef],
|
|
13
|
+
[t("computerUse.ui.direction", "Direction"), props.args.direction],
|
|
14
|
+
[t("computerUse.ui.amount", "Amount"), props.args.amount]
|
|
14
15
|
] }), /* @__PURE__ */ jsx(McpToolOutput, { result: props.result })]
|
|
15
16
|
});
|
|
16
17
|
}
|
|
@@ -18,19 +19,21 @@ var computer_action_mcp_default = defineMcpWidget(ComputerActionMcpWidget);
|
|
|
18
19
|
//#endregion
|
|
19
20
|
//#region src/extensions/workspaces/sessions/(frontend)/tool/computer_exec.mcp.tsx
|
|
20
21
|
function ComputerExecMcpWidget(props) {
|
|
22
|
+
const t = useT();
|
|
21
23
|
return /* @__PURE__ */ jsxs(McpToolFrame, {
|
|
22
24
|
...props,
|
|
23
|
-
title: "Run application script",
|
|
24
|
-
children: [/* @__PURE__ */ jsx(McpToolFields, { fields: [["Script", props.args.scriptPath]] }), /* @__PURE__ */ jsx(McpToolOutput, { result: props.result })]
|
|
25
|
+
title: t("computerUse.ui.runApplicationScript", "Run application script"),
|
|
26
|
+
children: [/* @__PURE__ */ jsx(McpToolFields, { fields: [[t("computerUse.ui.script", "Script"), props.args.scriptPath]] }), /* @__PURE__ */ jsx(McpToolOutput, { result: props.result })]
|
|
25
27
|
});
|
|
26
28
|
}
|
|
27
29
|
var computer_exec_mcp_default = defineMcpWidget(ComputerExecMcpWidget);
|
|
28
30
|
//#endregion
|
|
29
31
|
//#region src/extensions/workspaces/sessions/(frontend)/tool/computer_state.mcp.tsx
|
|
30
32
|
function ComputerStateMcpWidget(props) {
|
|
33
|
+
const t = useT();
|
|
31
34
|
return /* @__PURE__ */ jsx(McpToolFrame, {
|
|
32
35
|
...props,
|
|
33
|
-
title: "Observe application",
|
|
36
|
+
title: t("computerUse.ui.observeApplication", "Observe application"),
|
|
34
37
|
children: /* @__PURE__ */ jsx(McpToolOutput, { result: props.result })
|
|
35
38
|
});
|
|
36
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-ui.mjs","names":["Widget0","Widget1","Widget2"],"sources":["../../src/extensions/workspaces/sessions/(frontend)/tool/computer_action.mcp.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/computer_exec.mcp.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/computer_state.mcp.tsx","../../generated/mcp-ui.ts"],"sourcesContent":["import { defineMcpWidget, type PoMcpWidgetProps } from '@agimon-ai/po-core/web';\nimport { McpToolFrame, McpToolFields, McpToolOutput } from '@agimon-ai/po-web-components';\n\nfunction ComputerActionMcpWidget(props: PoMcpWidgetProps) {\n return (\n <McpToolFrame {...props} title
|
|
1
|
+
{"version":3,"file":"mcp-ui.mjs","names":["Widget0","Widget1","Widget2"],"sources":["../../src/extensions/workspaces/sessions/(frontend)/tool/computer_action.mcp.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/computer_exec.mcp.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/computer_state.mcp.tsx","../../generated/mcp-ui.ts"],"sourcesContent":["import { useT } from '@agimon-ai/po-core/web';\nimport { defineMcpWidget, type PoMcpWidgetProps } from '@agimon-ai/po-core/web';\nimport { McpToolFrame, McpToolFields, McpToolOutput } from '@agimon-ai/po-web-components';\n\nfunction ComputerActionMcpWidget(props: PoMcpWidgetProps) {\n const t = useT();\n return (\n <McpToolFrame {...props} title={t('computerUse.ui.interactWithApplication', 'Interact with application')}>\n <McpToolFields\n fields={[\n [t('computerUse.ui.action', 'Action'), props.args.kind],\n [t('computerUse.ui.element', 'Element'), props.args.elementRef],\n [t('computerUse.ui.direction', 'Direction'), props.args.direction],\n [t('computerUse.ui.amount', 'Amount'), props.args.amount],\n ]}\n />\n <McpToolOutput result={props.result} />\n </McpToolFrame>\n );\n}\n\nexport default defineMcpWidget(ComputerActionMcpWidget);\n","import { useT } from '@agimon-ai/po-core/web';\nimport { defineMcpWidget, type PoMcpWidgetProps } from '@agimon-ai/po-core/web';\nimport { McpToolFrame, McpToolFields, McpToolOutput } from '@agimon-ai/po-web-components';\n\nfunction ComputerExecMcpWidget(props: PoMcpWidgetProps) {\n const t = useT();\n return (\n <McpToolFrame {...props} title={t('computerUse.ui.runApplicationScript', 'Run application script')}>\n <McpToolFields fields={[[t('computerUse.ui.script', 'Script'), props.args.scriptPath]]} />\n <McpToolOutput result={props.result} />\n </McpToolFrame>\n );\n}\n\nexport default defineMcpWidget(ComputerExecMcpWidget);\n","import { useT } from '@agimon-ai/po-core/web';\nimport { defineMcpWidget, type PoMcpWidgetProps } from '@agimon-ai/po-core/web';\nimport { McpToolFrame, McpToolOutput } from '@agimon-ai/po-web-components';\n\nfunction ComputerStateMcpWidget(props: PoMcpWidgetProps) {\n const t = useT();\n return (\n <McpToolFrame {...props} title={t('computerUse.ui.observeApplication', 'Observe application')}>\n <McpToolOutput result={props.result} />\n </McpToolFrame>\n );\n}\n\nexport default defineMcpWidget(ComputerStateMcpWidget);\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport type { ComponentType } from 'react';\nimport type { PoMcpWidgetProps } from '@agimon-ai/po-core/mcpWidget';\nimport Widget0 from \"../src/extensions/workspaces/sessions/(frontend)/tool/computer_action.mcp\";\nimport Widget1 from \"../src/extensions/workspaces/sessions/(frontend)/tool/computer_exec.mcp\";\nimport Widget2 from \"../src/extensions/workspaces/sessions/(frontend)/tool/computer_state.mcp\";\n\nexport const widgets: Readonly<Record<string, ComponentType<PoMcpWidgetProps>>> = {\n \"@agimon-ai/po-computer-use/computer_action\": Widget0,\n \"@agimon-ai/po-computer-use/computer_exec\": Widget1,\n \"@agimon-ai/po-computer-use/computer_state\": Widget2,\n};\n"],"mappings":";;;;AAIA,SAAS,wBAAwB,OAAyB;CACxD,MAAM,IAAI,KAAK;CACf,OACE,qBAAC,cAAD;EAAc,GAAI;EAAO,OAAO,EAAE,0CAA0C,2BAA2B;EAAvG,UAAA,CACE,oBAAC,eAAD,EACE,QAAQ;GACN,CAAC,EAAE,yBAAyB,QAAQ,GAAG,MAAM,KAAK,IAAI;GACtD,CAAC,EAAE,0BAA0B,SAAS,GAAG,MAAM,KAAK,UAAU;GAC9D,CAAC,EAAE,4BAA4B,WAAW,GAAG,MAAM,KAAK,SAAS;GACjE,CAAC,EAAE,yBAAyB,QAAQ,GAAG,MAAM,KAAK,MAAM;EAC1D,EACD,CAAA,GACD,oBAAC,eAAD,EAAe,QAAQ,MAAM,OAAS,CAAA,CAC1B;;AAElB;AAEA,IAAA,8BAAe,gBAAgB,uBAAuB;;;ACjBtD,SAAS,sBAAsB,OAAyB;CACtD,MAAM,IAAI,KAAK;CACf,OACE,qBAAC,cAAD;EAAc,GAAI;EAAO,OAAO,EAAE,uCAAuC,wBAAwB;EAAjG,UAAA,CACE,oBAAC,eAAD,EAAe,QAAQ,CAAC,CAAC,EAAE,yBAAyB,QAAQ,GAAG,MAAM,KAAK,UAAU,CAAC,EAAI,CAAA,GACzF,oBAAC,eAAD,EAAe,QAAQ,MAAM,OAAS,CAAA,CAC1B;;AAElB;AAEA,IAAA,4BAAe,gBAAgB,qBAAqB;;;ACVpD,SAAS,uBAAuB,OAAyB;CACvD,MAAM,IAAI,KAAK;CACf,OACE,oBAAC,cAAD;EAAc,GAAI;EAAO,OAAO,EAAE,qCAAqC,qBAAqB;EAC1F,UAAA,oBAAC,eAAD,EAAe,QAAQ,MAAM,OAAS,CAAA;CAC1B,CAAA;AAElB;;;ACJA,MAAa,UAAqE;CAChF,8CAA8CA;CAC9C,4CAA4CC;CAC5C,6CDGa,gBAAgB,sBCHgBC;AAC/C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createApiClient, defineActivityGroup, defineChannelFile, defineFill, defineNativePlugin, defineSessionStore, defineSettingsPanel, defineToolRenderer, sessionApiAddress } from "@agimon-ai/po-core/native";
|
|
1
|
+
import { createApiClient, defineActivityGroup, defineChannelFile, defineFill, defineNativePlugin, defineSessionStore, defineSettingsPanel, defineToolRenderer, sessionApiAddress, t, useT } from "@agimon-ai/po-core/native";
|
|
2
2
|
import { useCallback, useEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
3
3
|
import { AppState } from "react-native";
|
|
4
4
|
import { View } from "react-native-unistyles/components/native/View";
|
|
@@ -174,7 +174,9 @@ async function readDesktopPermissions(request, permission) {
|
|
|
174
174
|
}
|
|
175
175
|
return {
|
|
176
176
|
status: "error",
|
|
177
|
-
error
|
|
177
|
+
get error() {
|
|
178
|
+
return t("computerUse.ui.poDesktopDidNotReturnPermissionStates", "Po Desktop did not return permission states. Try again.");
|
|
179
|
+
}
|
|
178
180
|
};
|
|
179
181
|
} catch (error) {
|
|
180
182
|
return {
|
|
@@ -187,33 +189,62 @@ async function readDesktopPermissions(request, permission) {
|
|
|
187
189
|
//#region src/extensions/(frontend)/setting/_components/DesktopPermissionsView.native.tsx
|
|
188
190
|
const COPY = {
|
|
189
191
|
accessibility: {
|
|
190
|
-
title
|
|
191
|
-
|
|
192
|
+
get title() {
|
|
193
|
+
return t("computerUse.ui.accessibility", "Accessibility");
|
|
194
|
+
},
|
|
195
|
+
get detail() {
|
|
196
|
+
return t("computerUse.ui.letsPoPressButtonsFillFieldsAnd", "Lets Po press buttons, fill fields and scroll in the app window you approve for computer use.");
|
|
197
|
+
}
|
|
192
198
|
},
|
|
193
199
|
"screen-recording": {
|
|
194
|
-
title
|
|
195
|
-
|
|
200
|
+
get title() {
|
|
201
|
+
return t("computerUse.ui.screenAndSystemAudioRecording", "Screen and system audio recording");
|
|
202
|
+
},
|
|
203
|
+
get detail() {
|
|
204
|
+
return t("computerUse.ui.letsPoSeeAndRecordTheWindow", "Lets Po see and record the window you approve, with its sound. macOS asks you to reopen Po after you allow it.");
|
|
205
|
+
}
|
|
196
206
|
},
|
|
197
207
|
microphone: {
|
|
198
|
-
title
|
|
199
|
-
|
|
208
|
+
get title() {
|
|
209
|
+
return t("computerUse.ui.microphone", "Microphone");
|
|
210
|
+
},
|
|
211
|
+
get detail() {
|
|
212
|
+
return t("computerUse.ui.letsYouTalkToPoAndAdds", "Lets you talk to Po, and adds your voice to computer-use recordings.");
|
|
213
|
+
}
|
|
200
214
|
},
|
|
201
215
|
automation: {
|
|
202
|
-
title
|
|
203
|
-
|
|
216
|
+
get title() {
|
|
217
|
+
return t("computerUse.ui.automation", "Automation");
|
|
218
|
+
},
|
|
219
|
+
get detail() {
|
|
220
|
+
return t("computerUse.ui.letsPoAndItsAgentsControlOther", "Lets Po and its agents control other apps, such as Finder or Mail. macOS asks once for each app; your answers are listed in System Settings.");
|
|
221
|
+
}
|
|
204
222
|
},
|
|
205
223
|
"full-disk-access": {
|
|
206
|
-
title
|
|
207
|
-
|
|
224
|
+
get title() {
|
|
225
|
+
return t("computerUse.ui.fullDiskAccess", "Full Disk Access");
|
|
226
|
+
},
|
|
227
|
+
get detail() {
|
|
228
|
+
return t("computerUse.ui.optionalLetsAgentsAndTheirToolsRead", "Optional. Lets agents and their tools read Documents, Downloads and Mail without a prompt for each folder.");
|
|
229
|
+
}
|
|
208
230
|
}
|
|
209
231
|
};
|
|
210
232
|
const LABEL = {
|
|
211
|
-
granted
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
233
|
+
get granted() {
|
|
234
|
+
return t("computerUse.ui.allowed", "Allowed");
|
|
235
|
+
},
|
|
236
|
+
get denied() {
|
|
237
|
+
return t("computerUse.ui.notAllowed", "Not allowed");
|
|
238
|
+
},
|
|
239
|
+
get "not-determined"() {
|
|
240
|
+
return t("computerUse.ui.notAskedYet", "Not asked yet");
|
|
241
|
+
},
|
|
242
|
+
get "per-app"() {
|
|
243
|
+
return t("computerUse.ui.askedPerApp", "Asked per app");
|
|
244
|
+
}
|
|
215
245
|
};
|
|
216
246
|
function DesktopPermissionsView({ state, remote = true, onAsk, onRefresh }) {
|
|
247
|
+
const t = useT();
|
|
217
248
|
return /* @__PURE__ */ jsxs(View, {
|
|
218
249
|
style: styles$5.page,
|
|
219
250
|
children: [/* @__PURE__ */ jsxs(View, {
|
|
@@ -223,27 +254,27 @@ function DesktopPermissionsView({ state, remote = true, onAsk, onRefresh }) {
|
|
|
223
254
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
224
255
|
accessibilityRole: "header",
|
|
225
256
|
style: styles$5.sectionTitle,
|
|
226
|
-
children: "On the paired Mac"
|
|
257
|
+
children: t("computerUse.ui.onThePairedMac", "On the paired Mac")
|
|
227
258
|
}), /* @__PURE__ */ jsx(Text, {
|
|
228
259
|
style: styles$5.detail,
|
|
229
|
-
children: remote ? "These belong to the Mac running Po Desktop. When you ask from here, macOS shows its prompt on that Mac." : "Po asks macOS for each one when you are ready. The permission prompt appears on the Mac running Po Desktop. You can change them any time in System Settings, Privacy and Security."
|
|
260
|
+
children: remote ? t("computerUse.ui.theseBelongToTheMacRunningPo", "These belong to the Mac running Po Desktop. When you ask from here, macOS shows its prompt on that Mac.") : t("computerUse.ui.poAsksMacOSForEachOneWhen", "Po asks macOS for each one when you are ready. The permission prompt appears on the Mac running Po Desktop. You can change them any time in System Settings, Privacy and Security.")
|
|
230
261
|
})]
|
|
231
262
|
}), state.status === "ready" ? /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
232
263
|
variant: "ghost",
|
|
233
264
|
disabled: state.asking !== void 0,
|
|
234
|
-
accessibilityLabel: "Permissions actions for the paired Mac",
|
|
265
|
+
accessibilityLabel: t("computerUse.ui.permissionsActionsForThePairedMac", "Permissions actions for the paired Mac"),
|
|
235
266
|
style: styles$5.control,
|
|
236
267
|
children: "⋯"
|
|
237
268
|
}), /* @__PURE__ */ jsx(DropdownMenuContent, { children: /* @__PURE__ */ jsx(DropdownMenuItem, {
|
|
238
269
|
onSelect: onRefresh,
|
|
239
|
-
children: "Check again"
|
|
270
|
+
children: t("computerUse.ui.checkAgain", "Check again")
|
|
240
271
|
}) })] }) : null]
|
|
241
272
|
}), /* @__PURE__ */ jsx(Panel, {
|
|
242
273
|
style: styles$5.card,
|
|
243
274
|
children: state.status === "ready" ? DESKTOP_PERMISSIONS.map((permission, index) => {
|
|
244
275
|
const value = state.states[permission];
|
|
245
276
|
const asking = state.asking === permission;
|
|
246
|
-
const action = asking ? "Waiting for macOS" : value === "not-determined" ? "Allow" : "Open System Settings";
|
|
277
|
+
const action = asking ? t("computerUse.ui.waitingForMacOS", "Waiting for macOS") : value === "not-determined" ? t("computerUse.ui.allow", "Allow") : t("computerUse.ui.openSystemSettings", "Open System Settings");
|
|
247
278
|
return /* @__PURE__ */ jsxs(View, {
|
|
248
279
|
style: [styles$5.row, index > 0 && styles$5.divider],
|
|
249
280
|
children: [
|
|
@@ -265,14 +296,17 @@ function DesktopPermissionsView({ state, remote = true, onAsk, onRefresh }) {
|
|
|
265
296
|
variant: "outline",
|
|
266
297
|
style: styles$5.control,
|
|
267
298
|
disabled: state.asking !== void 0,
|
|
268
|
-
accessibilityLabel:
|
|
299
|
+
accessibilityLabel: t("computerUse.ui.permissionAction", "{action}: {permission} on the paired Mac", {
|
|
300
|
+
action,
|
|
301
|
+
permission: COPY[permission].title
|
|
302
|
+
}),
|
|
269
303
|
onPress: () => onAsk(permission),
|
|
270
304
|
children: action
|
|
271
305
|
}) : null,
|
|
272
306
|
asking ? /* @__PURE__ */ jsx(Text, {
|
|
273
307
|
accessibilityLiveRegion: "polite",
|
|
274
308
|
style: styles$5.detail,
|
|
275
|
-
children: "Waiting for your answer on the Mac."
|
|
309
|
+
children: t("computerUse.ui.waitingForYourAnswerOnTheMac", "Waiting for your answer on the Mac.")
|
|
276
310
|
}) : null
|
|
277
311
|
]
|
|
278
312
|
}, permission);
|
|
@@ -282,18 +316,18 @@ function DesktopPermissionsView({ state, remote = true, onAsk, onRefresh }) {
|
|
|
282
316
|
/* @__PURE__ */ jsx(Text, {
|
|
283
317
|
accessibilityRole: state.status === "error" ? "alert" : "header",
|
|
284
318
|
style: styles$5.rowTitle,
|
|
285
|
-
children: state.status === "loading" ? "Checking with macOS" : state.status === "unavailable" ? "Po Desktop is not running here" : "Po couldn't read the permissions just now"
|
|
319
|
+
children: state.status === "loading" ? t("computerUse.ui.checkingWithMacOS", "Checking with macOS") : state.status === "unavailable" ? t("computerUse.ui.poDesktopIsNotRunningHere", "Po Desktop is not running here") : t("computerUse.ui.poCouldnTReadThePermissionsJust", "Po couldn't read the permissions just now")
|
|
286
320
|
}),
|
|
287
321
|
/* @__PURE__ */ jsx(Text, {
|
|
288
322
|
style: styles$5.detail,
|
|
289
|
-
children: state.status === "loading" ? "This takes a moment." : state.status === "unavailable" ? "Permissions belong to the Mac running Po Desktop. Open Po Desktop there to see and change them." : state.error
|
|
323
|
+
children: state.status === "loading" ? t("computerUse.ui.thisTakesAMoment", "This takes a moment.") : state.status === "unavailable" ? t("computerUse.ui.permissionsBelongToTheMacRunningPo", "Permissions belong to the Mac running Po Desktop. Open Po Desktop there to see and change them.") : state.error
|
|
290
324
|
}),
|
|
291
325
|
state.status === "error" ? /* @__PURE__ */ jsx(Button, {
|
|
292
326
|
variant: "outline",
|
|
293
327
|
style: styles$5.control,
|
|
294
|
-
accessibilityLabel: "Try reading permissions from the paired Mac again",
|
|
328
|
+
accessibilityLabel: t("computerUse.ui.tryReadingPermissionsFromThePairedMac", "Try reading permissions from the paired Mac again"),
|
|
295
329
|
onPress: onRefresh,
|
|
296
|
-
children: "Try again"
|
|
330
|
+
children: t("computerUse.ui.tryAgain", "Try again")
|
|
297
331
|
}) : null
|
|
298
332
|
]
|
|
299
333
|
})
|
|
@@ -407,8 +441,12 @@ function DesktopPermissionsPanel({ request, requestWithStepUp }) {
|
|
|
407
441
|
//#endregion
|
|
408
442
|
//#region src/extensions/(frontend)/setting/desktop-permissions.panel.native.tsx
|
|
409
443
|
var desktop_permissions_panel_native_default = defineSettingsPanel({
|
|
410
|
-
label
|
|
411
|
-
|
|
444
|
+
get label() {
|
|
445
|
+
return t("computerUse.ui.permissions", "Permissions");
|
|
446
|
+
},
|
|
447
|
+
get detail() {
|
|
448
|
+
return t("computerUse.ui.whatPoMayDoOnThePaired", "What Po may do on the paired Mac");
|
|
449
|
+
},
|
|
412
450
|
order: 46,
|
|
413
451
|
component: DesktopPermissionsPanel
|
|
414
452
|
});
|
|
@@ -416,6 +454,7 @@ var desktop_permissions_panel_native_default = defineSettingsPanel({
|
|
|
416
454
|
//#region src/extensions/workspaces/sessions/(frontend)/activity-group/computer-use.native.ts
|
|
417
455
|
/** Remote clients request control from the Desktop host through their session Activity. */
|
|
418
456
|
var computer_use_native_default$1 = defineActivityGroup({
|
|
457
|
+
label: (t) => t("computerUse.activityGroup.label", "Computer use"),
|
|
419
458
|
name: "computer-use",
|
|
420
459
|
keys: "c e",
|
|
421
460
|
statusKey: COMPUTER_USE_STATUS_KEY,
|
|
@@ -450,9 +489,10 @@ var computer_use_native_default = defineChannelFile(computerUseChannel);
|
|
|
450
489
|
//#region src/extensions/workspaces/sessions/(frontend)/fill/_components/ComputerUsePanel.native.tsx
|
|
451
490
|
function remaining(ms) {
|
|
452
491
|
const seconds = Math.max(0, Math.ceil(ms / 1e3));
|
|
453
|
-
return `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, "0")}
|
|
492
|
+
return t("computerUse.ui.remainingTime", "{time} left", { time: `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, "0")}` });
|
|
454
493
|
}
|
|
455
494
|
function ComputerUseView({ state, error, onCancel, onStop }) {
|
|
495
|
+
const t = useT();
|
|
456
496
|
const pending = state.phase === "awaiting_confirmation" || state.phase === "activating";
|
|
457
497
|
const active = state.phase === "active" || state.phase === "stopping";
|
|
458
498
|
const failure = error ?? state.failure?.message;
|
|
@@ -465,7 +505,7 @@ function ComputerUseView({ state, error, onCancel, onStop }) {
|
|
|
465
505
|
}, [expiresAt]);
|
|
466
506
|
const left = expiresAt === void 0 ? void 0 : expiresAt - now;
|
|
467
507
|
const total = state.durationMs ?? 3e5;
|
|
468
|
-
const controlled = state.target?.scope === "desktop" ? "your whole desktop" : typeof state.target?.applicationName === "string" ? state.target.applicationName : "the chosen window";
|
|
508
|
+
const controlled = state.target?.scope === "desktop" ? t("computerUse.ui.yourWholeDesktop", "your whole desktop") : typeof state.target?.applicationName === "string" ? state.target.applicationName : t("computerUse.ui.theChosenWindow", "the chosen window");
|
|
469
509
|
if (state.phase === "inactive") return null;
|
|
470
510
|
return /* @__PURE__ */ jsxs(View, {
|
|
471
511
|
style: styles$4.panel,
|
|
@@ -475,7 +515,7 @@ function ComputerUseView({ state, error, onCancel, onStop }) {
|
|
|
475
515
|
children: /* @__PURE__ */ jsx(Text, {
|
|
476
516
|
style: styles$4.title,
|
|
477
517
|
accessibilityRole: "header",
|
|
478
|
-
children: "Computer use"
|
|
518
|
+
children: t("computerUse.ui.computerUseText", "Computer use")
|
|
479
519
|
})
|
|
480
520
|
}),
|
|
481
521
|
failure ? /* @__PURE__ */ jsx(Text, {
|
|
@@ -493,7 +533,7 @@ function ComputerUseView({ state, error, onCancel, onStop }) {
|
|
|
493
533
|
})
|
|
494
534
|
}), /* @__PURE__ */ jsx(Text, {
|
|
495
535
|
style: styles$4.text,
|
|
496
|
-
children: "Recording finished."
|
|
536
|
+
children: t("computerUse.ui.recordingFinished", "Recording finished.")
|
|
497
537
|
})]
|
|
498
538
|
}) : null,
|
|
499
539
|
state.artifact?.failure ? /* @__PURE__ */ jsx(Text, {
|
|
@@ -502,18 +542,18 @@ function ComputerUseView({ state, error, onCancel, onStop }) {
|
|
|
502
542
|
}) : null,
|
|
503
543
|
pending ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Text, {
|
|
504
544
|
style: styles$4.text,
|
|
505
|
-
children: "Desktop activation is pending."
|
|
545
|
+
children: t("computerUse.ui.desktopActivationIsPending", "Desktop activation is pending.")
|
|
506
546
|
}), /* @__PURE__ */ jsx(Button, {
|
|
507
547
|
variant: "outline",
|
|
508
548
|
onPress: onCancel,
|
|
509
|
-
children: "Cancel activation"
|
|
549
|
+
children: t("computerUse.ui.cancelActivation", "Cancel activation")
|
|
510
550
|
})] }) : active ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
511
551
|
/* @__PURE__ */ jsxs(View, {
|
|
512
552
|
style: styles$4.row,
|
|
513
553
|
accessibilityLiveRegion: "polite",
|
|
514
554
|
children: [/* @__PURE__ */ jsx(View, { style: styles$4.dot }), /* @__PURE__ */ jsx(Text, {
|
|
515
555
|
style: styles$4.live,
|
|
516
|
-
children: state.phase === "stopping" ? "Po is handing control back" :
|
|
556
|
+
children: state.phase === "stopping" ? t("computerUse.ui.poIsHandingControlBack", "Po is handing control back") : t("computerUse.ui.controlling", "Po is controlling {target}", { target: controlled })
|
|
517
557
|
})]
|
|
518
558
|
}),
|
|
519
559
|
left === void 0 ? null : /* @__PURE__ */ jsxs(View, {
|
|
@@ -521,7 +561,7 @@ function ComputerUseView({ state, error, onCancel, onStop }) {
|
|
|
521
561
|
children: [/* @__PURE__ */ jsx(View, {
|
|
522
562
|
style: styles$4.track,
|
|
523
563
|
accessibilityRole: "progressbar",
|
|
524
|
-
accessibilityLabel: "Time left",
|
|
564
|
+
accessibilityLabel: t("computerUse.ui.timeLeft", "Time left"),
|
|
525
565
|
accessibilityValue: {
|
|
526
566
|
min: 0,
|
|
527
567
|
max: total,
|
|
@@ -537,13 +577,14 @@ function ComputerUseView({ state, error, onCancel, onStop }) {
|
|
|
537
577
|
variant: "outline",
|
|
538
578
|
disabled: state.phase === "stopping",
|
|
539
579
|
onPress: onStop,
|
|
540
|
-
children: "Stop computer use"
|
|
580
|
+
children: t("computerUse.ui.stopComputerUse", "Stop computer use")
|
|
541
581
|
})
|
|
542
582
|
] }) : null
|
|
543
583
|
]
|
|
544
584
|
});
|
|
545
585
|
}
|
|
546
586
|
function SessionPanel({ sessionId, sendSessionFrame }) {
|
|
587
|
+
const t = useT();
|
|
547
588
|
const subscribe = useCallback((listener) => {
|
|
548
589
|
const subscription = computerUse.store.subscribe(listener);
|
|
549
590
|
return () => subscription.unsubscribe();
|
|
@@ -570,14 +611,15 @@ function SessionPanel({ sessionId, sendSessionFrame }) {
|
|
|
570
611
|
return /* @__PURE__ */ jsx(ComputerUseView, {
|
|
571
612
|
state: session.state,
|
|
572
613
|
error,
|
|
573
|
-
onCancel: () => stop("The activation could not be cancelled."),
|
|
574
|
-
onStop: () => stop("The stop request is unavailable.")
|
|
614
|
+
onCancel: () => stop(t("computerUse.ui.theActivationCouldNotBeCancelled", "The activation could not be cancelled.")),
|
|
615
|
+
onStop: () => stop(t("computerUse.ui.theStopRequestIsUnavailable", "The stop request is unavailable."))
|
|
575
616
|
});
|
|
576
617
|
}
|
|
577
618
|
function ComputerUsePanel(props) {
|
|
619
|
+
const t = useT();
|
|
578
620
|
return props.sessionId === null ? /* @__PURE__ */ jsx(Text, {
|
|
579
621
|
style: styles$4.detail,
|
|
580
|
-
children: "Select a session."
|
|
622
|
+
children: t("computerUse.ui.selectASession", "Select a session.")
|
|
581
623
|
}) : /* @__PURE__ */ jsx(SessionPanel, {
|
|
582
624
|
...props,
|
|
583
625
|
sessionId: props.sessionId
|
|
@@ -678,10 +720,6 @@ var ComputerUse_activity_computer_use_native_default = defineFill({
|
|
|
678
720
|
component: ComputerUsePanel
|
|
679
721
|
});
|
|
680
722
|
const MS_PER_SECOND = 1e3;
|
|
681
|
-
/** The computer_state call's summary: it always observes the one authorized window. */
|
|
682
|
-
function computerStateCallSummary(_args) {
|
|
683
|
-
return "authorized window";
|
|
684
|
-
}
|
|
685
723
|
/**
|
|
686
724
|
* The computer_action call as its two pieces: the action kind first, the element
|
|
687
725
|
* it targets second. Either may be missing; the empty ones are dropped.
|
|
@@ -877,6 +915,7 @@ function computerResultExpandable(props) {
|
|
|
877
915
|
* that already ran; the header's edge and outcome already say it failed.
|
|
878
916
|
*/
|
|
879
917
|
function ComputerResultBody({ props, expanded }) {
|
|
918
|
+
const t = useT();
|
|
880
919
|
const { toolName, output, running, isError } = props;
|
|
881
920
|
const view = computerResult(props);
|
|
882
921
|
const testID = `tool-result-${toolName}`;
|
|
@@ -894,7 +933,7 @@ function ComputerResultBody({ props, expanded }) {
|
|
|
894
933
|
testID,
|
|
895
934
|
children: /* @__PURE__ */ jsx(MessageItemStatus, {
|
|
896
935
|
tone: "running",
|
|
897
|
-
children: "running"
|
|
936
|
+
children: t("computerUse.ui.running", "running")
|
|
898
937
|
})
|
|
899
938
|
}) : null;
|
|
900
939
|
if (view.kind === "text" && view.lines.length === 0) return null;
|
|
@@ -913,7 +952,7 @@ function ComputerResultBody({ props, expanded }) {
|
|
|
913
952
|
}) : null,
|
|
914
953
|
view.kind === "applied" ? /* @__PURE__ */ jsx(Text, {
|
|
915
954
|
style: [styles$3.sans, styles$3.text],
|
|
916
|
-
children: "Applied to the element."
|
|
955
|
+
children: t("computerUse.ui.appliedToTheElement", "Applied to the element.")
|
|
917
956
|
}) : null,
|
|
918
957
|
view.kind === "launched" ? /* @__PURE__ */ jsxs(View, {
|
|
919
958
|
style: styles$3.figure,
|
|
@@ -924,7 +963,11 @@ function ComputerResultBody({ props, expanded }) {
|
|
|
924
963
|
styles$3.strong,
|
|
925
964
|
styles$3.keep
|
|
926
965
|
],
|
|
927
|
-
children: [
|
|
966
|
+
children: [
|
|
967
|
+
t("computerUse.ui.opened", "Opened"),
|
|
968
|
+
" ",
|
|
969
|
+
view.applicationName
|
|
970
|
+
]
|
|
928
971
|
}), /* @__PURE__ */ jsx(Text, {
|
|
929
972
|
numberOfLines: 1,
|
|
930
973
|
style: [
|
|
@@ -941,15 +984,16 @@ function ComputerResultBody({ props, expanded }) {
|
|
|
941
984
|
}) : null,
|
|
942
985
|
running ? /* @__PURE__ */ jsx(MessageItemStatus, {
|
|
943
986
|
tone: "running",
|
|
944
|
-
children: "running"
|
|
987
|
+
children: t("computerUse.ui.running", "running")
|
|
945
988
|
}) : null
|
|
946
989
|
]
|
|
947
990
|
})
|
|
948
991
|
});
|
|
949
992
|
}
|
|
950
993
|
function FailureBlock({ failure }) {
|
|
994
|
+
const t = useT();
|
|
951
995
|
const done = failure.completedActions;
|
|
952
|
-
const note = [done === void 0 ? "" :
|
|
996
|
+
const note = [done === void 0 ? "" : done === 1 ? t("computerUse.ui.actionsRanOne", "{count} action already ran", { count: done }) : t("computerUse.ui.actionsRan", "{count} actions already ran", { count: done }), failure.outcomeUncertain ? t("computerUse.ui.theLastOutcomeIsUncertain", "the last outcome is uncertain") : ""].filter(Boolean);
|
|
953
997
|
return /* @__PURE__ */ jsxs(View, {
|
|
954
998
|
style: styles$3.stack,
|
|
955
999
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
@@ -985,11 +1029,12 @@ function WindowLine({ observation, lead }) {
|
|
|
985
1029
|
});
|
|
986
1030
|
}
|
|
987
1031
|
function ElementRow({ element }) {
|
|
1032
|
+
const t = useT();
|
|
988
1033
|
const secure = element.secure && !element.role.includes("secure");
|
|
989
1034
|
const traits = [
|
|
990
1035
|
element.role,
|
|
991
|
-
element.enabled ? "" : "disabled",
|
|
992
|
-
secure ? "secure" : ""
|
|
1036
|
+
element.enabled ? "" : t("computerUse.ui.disabled", "disabled"),
|
|
1037
|
+
secure ? t("computerUse.ui.secure", "secure") : ""
|
|
993
1038
|
].filter(Boolean);
|
|
994
1039
|
return /* @__PURE__ */ jsxs(View, {
|
|
995
1040
|
style: styles$3.row,
|
|
@@ -1026,6 +1071,7 @@ function ElementRow({ element }) {
|
|
|
1026
1071
|
});
|
|
1027
1072
|
}
|
|
1028
1073
|
function ObservationBlock({ observation, expanded }) {
|
|
1074
|
+
const t = useT();
|
|
1029
1075
|
const { elements } = observation;
|
|
1030
1076
|
const shown = expanded ? elements : elements.slice(0, 5);
|
|
1031
1077
|
const hidden = elements.length - shown.length;
|
|
@@ -1035,32 +1081,33 @@ function ObservationBlock({ observation, expanded }) {
|
|
|
1035
1081
|
style: styles$3.chips,
|
|
1036
1082
|
children: [/* @__PURE__ */ jsx(Badge, {
|
|
1037
1083
|
size: "xs",
|
|
1038
|
-
children:
|
|
1084
|
+
children: elements.length === 1 ? t("computerUse.ui.elementCountOne", "{count} element", { count: elements.length }) : t("computerUse.ui.elementCount", "{count} elements", { count: elements.length })
|
|
1039
1085
|
}), observation.truncated ? /* @__PURE__ */ jsx(Badge, {
|
|
1040
1086
|
size: "xs",
|
|
1041
1087
|
tone: "yellow",
|
|
1042
|
-
children: observation.nextOffset === void 0 ? "more not shown" :
|
|
1088
|
+
children: observation.nextOffset === void 0 ? t("computerUse.ui.moreNotShown", "more not shown") : t("computerUse.ui.moreFromOffset", "more from offset {offset}", { offset: observation.nextOffset })
|
|
1043
1089
|
}) : null]
|
|
1044
1090
|
}),
|
|
1045
1091
|
shown.length > 0 ? /* @__PURE__ */ jsx(View, {
|
|
1046
1092
|
style: styles$3.list,
|
|
1047
1093
|
children: shown.map((element) => /* @__PURE__ */ jsx(ElementRow, { element }, element.ref))
|
|
1048
1094
|
}) : null,
|
|
1049
|
-
hidden > 0 ? /* @__PURE__ */
|
|
1095
|
+
hidden > 0 ? /* @__PURE__ */ jsx(MessageItemStatus, {
|
|
1050
1096
|
expands: true,
|
|
1051
|
-
children:
|
|
1097
|
+
children: hidden === 1 ? t("computerUse.ui.moreElementsOne", "{count} more element", { count: hidden }) : t("computerUse.ui.moreElements", "{count} more elements", { count: hidden })
|
|
1052
1098
|
}) : null,
|
|
1053
|
-
observation.screenshotArtifact === void 0 ? null : /* @__PURE__ */
|
|
1099
|
+
observation.screenshotArtifact === void 0 ? null : /* @__PURE__ */ jsx(Text, {
|
|
1054
1100
|
numberOfLines: 2,
|
|
1055
1101
|
style: [styles$3.small, styles$3.faint],
|
|
1056
|
-
children:
|
|
1102
|
+
children: t("computerUse.ui.screenshotSaved", "Screenshot saved to {path}", { path: observation.screenshotArtifact })
|
|
1057
1103
|
})
|
|
1058
1104
|
] });
|
|
1059
1105
|
}
|
|
1060
1106
|
function RunBlock({ run, expanded }) {
|
|
1107
|
+
const t = useT();
|
|
1061
1108
|
const figures = [
|
|
1062
|
-
run.actions === void 0 ? "" :
|
|
1063
|
-
run.observations === void 0 ? "" :
|
|
1109
|
+
run.actions === void 0 ? "" : run.actions === 1 ? t("computerUse.ui.actionCountOne", "{count} action", { count: run.actions }) : t("computerUse.ui.actionCount", "{count} actions", { count: run.actions }),
|
|
1110
|
+
run.observations === void 0 ? "" : run.observations === 1 ? t("computerUse.ui.observationCountOne", "{count} observation", { count: run.observations }) : t("computerUse.ui.observationCount", "{count} observations", { count: run.observations }),
|
|
1064
1111
|
run.duration ?? ""
|
|
1065
1112
|
].filter(Boolean);
|
|
1066
1113
|
const logs = expanded ? run.logs : run.logs.slice(0, 3);
|
|
@@ -1106,17 +1153,18 @@ function RunBlock({ run, expanded }) {
|
|
|
1106
1153
|
children: line
|
|
1107
1154
|
}, `${String(index)}-${line}`))
|
|
1108
1155
|
}) : null,
|
|
1109
|
-
hidden > 0 ? /* @__PURE__ */
|
|
1156
|
+
hidden > 0 ? /* @__PURE__ */ jsx(MessageItemStatus, {
|
|
1110
1157
|
expands: true,
|
|
1111
|
-
children:
|
|
1158
|
+
children: hidden === 1 ? t("computerUse.ui.moreLogLinesOne", "{count} more log line", { count: hidden }) : t("computerUse.ui.moreLogLines", "{count} more log lines", { count: hidden })
|
|
1112
1159
|
}) : null,
|
|
1113
1160
|
run.observation === void 0 ? null : /* @__PURE__ */ jsx(WindowLine, {
|
|
1114
1161
|
observation: run.observation,
|
|
1115
|
-
lead: "Ended on"
|
|
1162
|
+
lead: t("computerUse.ui.endedOn", "Ended on")
|
|
1116
1163
|
})
|
|
1117
1164
|
] });
|
|
1118
1165
|
}
|
|
1119
1166
|
function TextLines({ lines, expanded }) {
|
|
1167
|
+
const t = useT();
|
|
1120
1168
|
const shown = expanded ? lines : lines.slice(0, 8);
|
|
1121
1169
|
const hidden = lines.length - shown.length;
|
|
1122
1170
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(View, {
|
|
@@ -1126,9 +1174,9 @@ function TextLines({ lines, expanded }) {
|
|
|
1126
1174
|
style: [styles$3.sans, styles$3.dim],
|
|
1127
1175
|
children: line
|
|
1128
1176
|
}, `${String(index)}-${line}`))
|
|
1129
|
-
}), hidden > 0 ? /* @__PURE__ */
|
|
1177
|
+
}), hidden > 0 ? /* @__PURE__ */ jsx(MessageItemStatus, {
|
|
1130
1178
|
expands: true,
|
|
1131
|
-
children:
|
|
1179
|
+
children: hidden === 1 ? t("computerUse.ui.moreLinesOne", "{count} more line", { count: hidden }) : t("computerUse.ui.moreLines", "{count} more lines", { count: hidden })
|
|
1132
1180
|
}) : null] });
|
|
1133
1181
|
}
|
|
1134
1182
|
const styles$3 = StyleSheet.create((theme) => ({
|
|
@@ -1360,7 +1408,8 @@ var computer_exec_native_default = defineToolRenderer({
|
|
|
1360
1408
|
* window in the header, the observation's first lines beneath it.
|
|
1361
1409
|
*/
|
|
1362
1410
|
function ComputerStateToolCard(props) {
|
|
1363
|
-
const
|
|
1411
|
+
const t = useT();
|
|
1412
|
+
const { toolName, running, isError } = props;
|
|
1364
1413
|
return /* @__PURE__ */ jsx(MessageItem, {
|
|
1365
1414
|
tone: toolTone({
|
|
1366
1415
|
running,
|
|
@@ -1375,7 +1424,7 @@ function ComputerStateToolCard(props) {
|
|
|
1375
1424
|
children: /* @__PURE__ */ jsx(Text, {
|
|
1376
1425
|
numberOfLines: 1,
|
|
1377
1426
|
style: [styles.sans, styles.primary],
|
|
1378
|
-
children:
|
|
1427
|
+
children: t("computerUse.ui.authorizedWindow", "authorized window")
|
|
1379
1428
|
})
|
|
1380
1429
|
})
|
|
1381
1430
|
}), /* @__PURE__ */ jsx(ComputerResultBody, {
|