@agimon-ai/po-computer-use 0.0.0-alpha.226 → 0.0.0-alpha.228

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/README.md CHANGED
@@ -12,12 +12,12 @@ Session-scoped semantic computer control through the Po Desktop capability.
12
12
 
13
13
  In Desktop, enable Computer Use in host settings, then select the default-off **Computer Use** mode. When the agent needs control, it asks for a window or the whole desktop and a duration. Approve once from an owner-authenticated client. The computer-use Activity card monitors the live grant and offers Stop; there is no separate setup form. Only one session can hold a live Desktop run. Remote activation does not bypass Desktop opt-in or grant checks. To stop from another app on macOS, press **Cmd+Shift+Esc**. If macOS cannot register the shortcut, use **Computer Use → Stop Computer Use** in Po Desktop or stop from Activity.
14
14
 
15
- The `computer-use` mode exposes Activate, Deactivate, and Doctor actions. `/computer-use` reports the current state.
15
+ The `computer-use` mode exposes Activate, Deactivate, and Doctor actions. `/computer-use` reports the current state. If Doctor reports missing permissions, grant Accessibility and Screen & System Audio Recording on the Mac running Desktop, then rerun Doctor (not verified live). See [Remote computer use](./docs/remote-computer-use.md) for approval and stop cues.
16
16
 
17
17
  In code mode, the `computer` namespace is the primary agent surface (and `codemode-how-to-computer-use` is listed whenever the mode is selected):
18
18
 
19
19
  - `computer.targets()` lists candidate windows and `computer.request()` asks for human approval.
20
- - During an active grant, `computer.state()` observes the authorized target and returns a semantic snapshot (`saveScreenshot: true` saves the screenshot in session artifacts under `computer-use/<run>/` and returns its `artifact:` path).
20
+ - During an active grant, `computer.state()` observes the authorized target and returns a semantic snapshot (`computer.state({ save: true })` saves the screenshot in session artifacts under `computer-use/<run>/` and returns its `artifact:` path in `screenshotArtifact`).
21
21
  - `computer.act()` performs one of the semantic actions advertised for an element in a current snapshot. Approved-window grants use the bundled, unmodified agent-desktop CLI and show a visual agent cursor. The cursor is not a separate keyboard or mouse. Whole-desktop grants continue to use the Swift backend for cross-app, Dock, and menu-bar behavior.
22
22
  - `computer.run({ scriptPath, input, trusted?, includeScreenshot? })` executes a reusable JavaScript or erasable TypeScript function and its relative helpers in a restricted runtime, then returns a fresh semantic observation.
23
23
  - `computer.stop()` ends the active grant.
@@ -1,9 +1,9 @@
1
1
  import { createApiClient, defineActivityGroup, defineChannelFile, defineFill, defineNativePlugin, defineSessionStore, defineSettingsPanel, defineToolRenderer, sessionApiAddress, t, useT } from "@agimon-ai/po-core/native";
2
- import { useCallback, useEffect, useRef, useState, useSyncExternalStore } from "react";
2
+ import { createElement, 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";
5
5
  import { Text } from "react-native-unistyles/components/native/Text";
6
- import { Badge, Button, CheckIcon, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, MessageItem, MessageItemBody, MessageItemHeader, MessageItemStatus, Panel, fontOf, toolTone } from "@agimon-ai/po-native-components";
6
+ import { Badge, Button, CheckIcon, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, MessageItem, MessageItemBody, MessageItemHeader, MessageItemStatus, MonitorIcon, Panel, fontOf, toolTone } from "@agimon-ai/po-native-components";
7
7
  import { StyleSheet } from "react-native-unistyles";
8
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
9
  //#region src/types/computerUseApi.ts
@@ -470,6 +470,7 @@ var computer_use_native_default$1 = defineActivityGroup({
470
470
  label: (t) => t("computerUse.activityGroup.label", "Computer use"),
471
471
  name: "computer-use",
472
472
  keys: "c e",
473
+ icon: () => createElement(MonitorIcon),
473
474
  statusKey: COMPUTER_USE_STATUS_KEY,
474
475
  hideWhenEmpty: true,
475
476
  marksBackgroundWork: false
@@ -515,7 +516,7 @@ function ComputerUseView({ state, error, onCancel, onStop }) {
515
516
  const t = useT();
516
517
  const pending = state.phase === "awaiting_confirmation" || state.phase === "activating";
517
518
  const active = state.phase === "active" || state.phase === "stopping";
518
- const failure = error ?? state.failure?.message;
519
+ const failure = error ?? (state.failure ? t("computerUse.ui.controlFailed", "Computer control could not continue.") : void 0);
519
520
  const expiresAt = state.phase === "active" ? state.expiresAt : void 0;
520
521
  const [now, setNow] = useState(Date.now);
521
522
  useEffect(() => {
@@ -530,14 +531,6 @@ function ComputerUseView({ state, error, onCancel, onStop }) {
530
531
  return /* @__PURE__ */ jsxs(View, {
531
532
  style: styles$4.panel,
532
533
  children: [
533
- /* @__PURE__ */ jsx(View, {
534
- style: styles$4.header,
535
- children: /* @__PURE__ */ jsx(Text, {
536
- style: styles$4.title,
537
- accessibilityRole: "header",
538
- children: t("computerUse.ui.computerUseText", "Computer use")
539
- })
540
- }),
541
534
  failure ? /* @__PURE__ */ jsxs(View, {
542
535
  style: styles$4.failure,
543
536
  children: [/* @__PURE__ */ jsx(Text, {
@@ -564,7 +557,7 @@ function ComputerUseView({ state, error, onCancel, onStop }) {
564
557
  }) : null,
565
558
  state.artifact?.failure ? /* @__PURE__ */ jsx(Text, {
566
559
  style: styles$4.error,
567
- children: state.artifact.failure.message
560
+ children: t("computerUse.ui.recordingUnavailable", "The recording is unavailable.")
568
561
  }) : null,
569
562
  pending ? /* @__PURE__ */ jsxs(Fragment, { children: [
570
563
  /* @__PURE__ */ jsx(Text, {
@@ -614,11 +607,7 @@ function ComputerUseView({ state, error, onCancel, onStop }) {
614
607
  disabled: state.phase === "stopping",
615
608
  onPress: onStop,
616
609
  children: t("computerUse.ui.stopComputerUse", "Stop computer use")
617
- }),
618
- state.phase === "active" ? /* @__PURE__ */ jsx(Text, {
619
- style: styles$4.detail,
620
- children: t("computerUse.ui.stopShortcutHint", "On the Mac, you can also press Cmd+Shift+Esc.")
621
- }) : null
610
+ })
622
611
  ] }) : null
623
612
  ]
624
613
  });
@@ -674,23 +663,6 @@ const styles$4 = StyleSheet.create((theme) => ({
674
663
  gap: theme.spacing(1),
675
664
  uni__dependencies: [0]
676
665
  },
677
- header: {
678
- flexDirection: "row",
679
- alignItems: "center",
680
- gap: theme.spacing(2),
681
- paddingBottom: theme.spacing(2),
682
- borderBottomWidth: 1,
683
- borderBottomColor: theme.colors["border-soft"],
684
- uni__dependencies: [0]
685
- },
686
- title: {
687
- flex: 1,
688
- fontFamily: fontOf(theme.fontFamily.sans),
689
- fontSize: theme.fontSize.base,
690
- fontWeight: "600",
691
- color: theme.colors.hi,
692
- uni__dependencies: [0]
693
- },
694
666
  row: {
695
667
  flexDirection: "row",
696
668
  alignItems: "center",