@agimon-ai/po-computer-use 0.0.0-alpha.0 → 0.0.0-alpha.2
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/native.mjs +60 -0
- package/dist/extensions/native.mjs.map +1 -0
- package/package.json +39 -11
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { defineActivityGroup, defineChannelFile, defineNativePlugin, defineSessionStore } from "@agimon-ai/po-core/native";
|
|
2
|
+
//#region src/types/computerUseApi.ts
|
|
3
|
+
const computerUseChannelType = "computer_use_state";
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region src/extensions/workspaces/sessions/(frontend)/activity-group/computer-use.native.ts
|
|
6
|
+
/** Computer control remains a desktop capability, including when its status is reported to a phone. */
|
|
7
|
+
var computer_use_native_default$1 = defineActivityGroup({
|
|
8
|
+
name: "computer-use",
|
|
9
|
+
keys: "c e",
|
|
10
|
+
order: 70,
|
|
11
|
+
statusKey: "doom-computer-use",
|
|
12
|
+
hideWhenEmpty: true,
|
|
13
|
+
desktopOnly: true,
|
|
14
|
+
marksBackgroundWork: false
|
|
15
|
+
});
|
|
16
|
+
const computerUse = defineSessionStore({
|
|
17
|
+
state: {
|
|
18
|
+
sessionId: "",
|
|
19
|
+
revision: 0,
|
|
20
|
+
wake: 0,
|
|
21
|
+
phase: "inactive"
|
|
22
|
+
},
|
|
23
|
+
targets: []
|
|
24
|
+
});
|
|
25
|
+
function isRecord(value) {
|
|
26
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
27
|
+
}
|
|
28
|
+
const computerUseChannel = computerUse.channel({
|
|
29
|
+
channel: computerUseChannelType,
|
|
30
|
+
parse(input) {
|
|
31
|
+
if (!isRecord(input) || !isRecord(input.state) || !Array.isArray(input.targets)) return null;
|
|
32
|
+
if (typeof input.state.phase !== "string" || typeof input.state.revision !== "number") return null;
|
|
33
|
+
return input;
|
|
34
|
+
},
|
|
35
|
+
reduce: (_current, payload) => payload
|
|
36
|
+
});
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/extensions/workspaces/sessions/(frontend)/channel/computer-use.native.ts
|
|
39
|
+
var computer_use_native_default = defineChannelFile(computerUseChannel);
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region generated/native.ts
|
|
42
|
+
const via = (identity, value) => value === void 0 ? void 0 : {
|
|
43
|
+
...identity,
|
|
44
|
+
...value
|
|
45
|
+
};
|
|
46
|
+
const nativePlugin = defineNativePlugin({
|
|
47
|
+
id: "computer-use",
|
|
48
|
+
session: {
|
|
49
|
+
get activityGroups() {
|
|
50
|
+
return [via({ name: "computer-use" }, computer_use_native_default$1)];
|
|
51
|
+
},
|
|
52
|
+
get channels() {
|
|
53
|
+
return [via({ channel: "computer_use" }, computer_use_native_default)];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
//#endregion
|
|
58
|
+
export { nativePlugin };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=native.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.mjs","names":["activityGroupComputerUse","channelComputerUse"],"sources":["../../src/types/computerUseApi.ts","../../src/extensions/workspaces/sessions/(frontend)/activity-group/computer-use.native.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/computerUseStore.native.ts","../../src/extensions/workspaces/sessions/(frontend)/channel/computer-use.native.ts","../../generated/native.ts"],"sourcesContent":["import type { DoomApiCaller } from '@agimon-ai/po-core/packageApi';\n\nexport const API_BASE_PATH = 'computer-use';\nexport const computerUseChannelType = 'computer_use_state';\nexport const COMPUTER_USE_MODE_ID = 'computer-use';\nexport const COMPUTER_USE_STATUS_KEY = 'doom-computer-use';\nexport const COMPUTER_USE_MODE_STATUS_KEY = 'doom-computer-use-mode';\nexport const COMPUTER_USE_MAX_DURATION_MS = 1_800 * 1_000;\nexport const COMPUTER_USE_DEFAULT_DURATION_MS = 300 * 1_000;\nexport const COMPUTER_USE_CONFIRMATION_WINDOW_MS = 2 * 60 * 1_000;\n\n/**\n * Every path this API answers on, below its mount.\n *\n * The typed route table in `./apiRoutes` is built from this, the dispatcher\n * reads that table, and the hub channel addresses the broker with these same\n * strings, so a route cannot move on one side alone.\n */\nexport const COMPUTER_USE_ROUTES = {\n activate: '/activate',\n artifact: '/artifact',\n agentState: '/agent/state',\n agentObserve: '/agent/observe',\n agentAction: '/agent/action',\n agentStop: '/agent/stop',\n hubState: '/hub/state',\n hubActivation: '/hub/activation',\n hubAuthorization: '/hub/authorization',\n hubNext: '/hub/next',\n hubComplete: '/hub/complete',\n hubStop: '/hub/stop',\n} as const;\n\nexport const COMPUTER_USE_WAKE_LIMIT = 1_000_000;\n\nexport interface ComputerUseArtifactView {\n readonly artifactId: string;\n readonly status: 'ready' | 'failed';\n readonly sizeBytes?: number;\n readonly downloadUrl?: string;\n readonly previewUrl?: string;\n readonly actionCount?: number;\n readonly completedAt?: string;\n readonly failure?: { readonly code: string; readonly message: string };\n}\n\nexport interface ComputerUseSessionView {\n readonly sessionId: string;\n readonly revision: number;\n readonly wake: number;\n readonly phase: 'inactive' | 'awaiting_confirmation' | 'activating' | 'active' | 'stopping' | 'failed';\n readonly requestId?: string;\n readonly target?: Record<string, unknown>;\n readonly durationMs?: number;\n readonly expiresAt?: number;\n readonly failure?: { readonly code: string; readonly message: string };\n readonly artifact?: ComputerUseArtifactView;\n}\n\nexport interface ComputerUseActivationRequest {\n readonly requestId: string;\n readonly target?: Record<string, unknown>;\n readonly durationSeconds: number;\n readonly createdAt: number;\n readonly confirmationExpiresAt: number;\n readonly caller: DoomApiCaller;\n}\n\nexport interface ComputerUseBrokerRequest {\n readonly id: string;\n readonly operation: 'observe' | 'act';\n readonly payload?: unknown;\n readonly grantId: string;\n readonly sequence?: number;\n}\n\nexport interface ComputerUseChannelPayload {\n readonly state: ComputerUseSessionView;\n readonly targets: readonly Record<string, unknown>[];\n readonly busy?: true;\n}\n\nexport type ComputerUseBrowserCommand = { readonly action: 'status' | 'targets' | 'stop' | 'artifacts' };\n","import { defineActivityGroup } from '@agimon-ai/po-core/native';\n\nimport { COMPUTER_USE_STATUS_KEY } from '../../../../../types/computerUseApi';\n\n/** Computer control remains a desktop capability, including when its status is reported to a phone. */\nexport default defineActivityGroup({\n name: 'computer-use',\n keys: 'c e',\n order: 70,\n statusKey: COMPUTER_USE_STATUS_KEY,\n hideWhenEmpty: true,\n desktopOnly: true,\n marksBackgroundWork: false,\n});\n","import { defineSessionStore } from '@agimon-ai/po-core/native';\n\nimport { computerUseChannelType } from '../../../../../types/computerUseApi';\nimport type { ComputerUseChannelPayload } from '../../../../../types/computerUseApi';\n\nexport interface ComputerUseSession extends ComputerUseChannelPayload {}\n\nconst initialState: ComputerUseSession = {\n state: { sessionId: '', revision: 0, wake: 0, phase: 'inactive' },\n targets: [],\n};\n\nexport const computerUse = defineSessionStore<ComputerUseSession>(initialState);\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nexport const computerUseChannel = computerUse.channel<ComputerUseChannelPayload>({\n channel: computerUseChannelType,\n parse(input) {\n if (!isRecord(input) || !isRecord(input.state) || !Array.isArray(input.targets)) return null;\n if (typeof input.state.phase !== 'string' || typeof input.state.revision !== 'number') return null;\n return input as unknown as ComputerUseChannelPayload;\n },\n reduce: (_current, payload) => payload,\n});\n","import { defineChannelFile } from '@agimon-ai/po-core/native';\n\nimport { computerUseChannel } from '../_lib/computerUseStore.native';\n\nexport default defineChannelFile(computerUseChannel);\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineNativePlugin, type WebPluginContributions } from '@agimon-ai/po-core/native';\n\nimport activityGroupComputerUse from '../src/extensions/workspaces/sessions/(frontend)/activity-group/computer-use.native';\nimport channelComputerUse from '../src/extensions/workspaces/sessions/(frontend)/channel/computer-use.native';\n\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nexport const nativePlugin = defineNativePlugin({\n id: 'computer-use',\n session: {\n get activityGroups(): WebPluginContributions['activityGroups'] { return [via({ name: 'computer-use' }, activityGroupComputerUse)]; },\n get channels(): WebPluginContributions['channels'] { return [via({ channel: 'computer_use' }, channelComputerUse)]; },\n },\n});\n"],"mappings":";;AAGA,MAAa,yBAAyB;;;;ACEtC,IAAA,gCAAe,oBAAoB;CACjC,MAAM;CACN,MAAM;CACN,OAAO;CACP,WAAW;CACX,eAAe;CACf,aAAa;CACb,qBAAqB;AACvB,CAAC;ACDD,MAAa,cAAc,mBAAuC;CAJhE,OAAO;EAAE,WAAW;EAAI,UAAU;EAAG,MAAM;EAAG,OAAO;CAAW;CAChE,SAAS,CAAC;AAGsD,CAAY;AAE9E,SAAS,SAAS,OAAkD;CAClE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,MAAa,qBAAqB,YAAY,QAAmC;CAC/E,SAAS;CACT,MAAM,OAAO;EACX,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS,MAAM,KAAK,KAAK,CAAC,MAAM,QAAQ,MAAM,OAAO,GAAG,OAAO;EACxF,IAAI,OAAO,MAAM,MAAM,UAAU,YAAY,OAAO,MAAM,MAAM,aAAa,UAAU,OAAO;EAC9F,OAAO;CACT;CACA,SAAS,UAAU,YAAY;AACjC,CAAC;;;ACtBD,IAAA,8BAAe,kBAAkB,kBAAkB;;;ACEnD,MAAM,OAAU,UAAmC,UAChD,UAAU,KAAA,IAAY,KAAA,IAAY;CAAE,GAAG;CAAU,GAAI;AAAiB;AAEzE,MAAa,eAAe,mBAAmB;CAC7C,IAAI;CACJ,SAAS;EACP,IAAI,iBAA2D;GAAE,OAAO,CAAC,IAAI,EAAE,MAAM,eAAe,GAAGA,6BAAwB,CAAC;EAAG;EACnI,IAAI,WAA+C;GAAE,OAAO,CAAC,IAAI,EAAE,SAAS,eAAe,GAAGC,2BAAkB,CAAC;EAAG;CACtH;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/po-computer-use",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.2",
|
|
4
4
|
"description": "Session scoped semantic computer control through the Po Desktop capability.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -46,6 +46,9 @@
|
|
|
46
46
|
"import": "./dist/index.mjs",
|
|
47
47
|
"require": "./dist/index.cjs"
|
|
48
48
|
},
|
|
49
|
+
"./extensions/native": {
|
|
50
|
+
"import": "./dist/extensions/native.mjs"
|
|
51
|
+
},
|
|
49
52
|
"./extensions/server": {
|
|
50
53
|
"types": "./dist/extensions/server.d.mts",
|
|
51
54
|
"import": "./dist/extensions/server.mjs",
|
|
@@ -60,19 +63,20 @@
|
|
|
60
63
|
"access": "public"
|
|
61
64
|
},
|
|
62
65
|
"dependencies": {
|
|
63
|
-
"@agimon-ai/po-config": "0.0.0-alpha.
|
|
64
|
-
"@agimon-ai/po-core": "0.0.0-alpha.
|
|
65
|
-
"@agimon-ai/po-minor-mode": "0.0.0-alpha.
|
|
66
|
-
"@agimon-ai/po-web-components": "0.0.0-alpha.
|
|
67
|
-
"@agimon-ai/po-web-security": "0.0.0-alpha.
|
|
66
|
+
"@agimon-ai/po-config": "0.0.0-alpha.2",
|
|
67
|
+
"@agimon-ai/po-core": "0.0.0-alpha.2",
|
|
68
|
+
"@agimon-ai/po-minor-mode": "0.0.0-alpha.2",
|
|
69
|
+
"@agimon-ai/po-web-components": "0.0.0-alpha.2",
|
|
70
|
+
"@agimon-ai/po-web-security": "0.0.0-alpha.2",
|
|
68
71
|
"@deepseek-ai/cordis": "4.0.4",
|
|
69
72
|
"quickjs-emscripten": "0.32.0",
|
|
70
73
|
"typebox": "1.3.34"
|
|
71
74
|
},
|
|
72
75
|
"devDependencies": {
|
|
73
|
-
"@agimon-ai/po-build": "0.0.0-alpha.
|
|
74
|
-
"@agimon-ai/
|
|
75
|
-
"@
|
|
76
|
+
"@agimon-ai/po-build": "0.0.0-alpha.2",
|
|
77
|
+
"@agimon-ai/po-native-components": "0.0.0-alpha.2",
|
|
78
|
+
"@agimon-ai/vibe-lint-plugin-doom-extension": "0.0.0-alpha.2",
|
|
79
|
+
"@earendil-works/pi-coding-agent": "1.2.0",
|
|
76
80
|
"@tanstack/react-store": "0.11.2",
|
|
77
81
|
"@tanstack/store": "0.11.2",
|
|
78
82
|
"@types/node": "26.6.4",
|
|
@@ -80,16 +84,30 @@
|
|
|
80
84
|
"@vitest/coverage-v8": "5.0.3",
|
|
81
85
|
"react": "19.3.0",
|
|
82
86
|
"react-dom": "19.3.0",
|
|
87
|
+
"react-native": "0.86.3",
|
|
88
|
+
"react-native-unistyles": "3.5.2",
|
|
83
89
|
"tsdown": "0.23.0",
|
|
84
90
|
"typescript": "7.0.2",
|
|
85
91
|
"vitest": "5.0.3"
|
|
86
92
|
},
|
|
87
93
|
"peerDependencies": {
|
|
88
|
-
"@
|
|
94
|
+
"@agimon-ai/po-native-components": "0.0.0-alpha.2",
|
|
95
|
+
"@earendil-works/pi-coding-agent": "1.2.0",
|
|
96
|
+
"react-native": "0.86.3",
|
|
97
|
+
"react-native-unistyles": "3.5.2"
|
|
89
98
|
},
|
|
90
99
|
"peerDependenciesMeta": {
|
|
91
100
|
"@earendil-works/pi-coding-agent": {
|
|
92
101
|
"optional": true
|
|
102
|
+
},
|
|
103
|
+
"@agimon-ai/po-native-components": {
|
|
104
|
+
"optional": true
|
|
105
|
+
},
|
|
106
|
+
"react-native": {
|
|
107
|
+
"optional": true
|
|
108
|
+
},
|
|
109
|
+
"react-native-unistyles": {
|
|
110
|
+
"optional": true
|
|
93
111
|
}
|
|
94
112
|
},
|
|
95
113
|
"engines": {
|
|
@@ -111,6 +129,16 @@
|
|
|
111
129
|
]
|
|
112
130
|
}
|
|
113
131
|
},
|
|
132
|
+
"poNative": {
|
|
133
|
+
"pluginId": "computer-use",
|
|
134
|
+
"channels": [
|
|
135
|
+
"computer_use"
|
|
136
|
+
],
|
|
137
|
+
"client": "./dist/extensions/native.mjs",
|
|
138
|
+
"scopes": [
|
|
139
|
+
"session"
|
|
140
|
+
]
|
|
141
|
+
},
|
|
114
142
|
"poServer": {
|
|
115
143
|
"entry": "./generated/server.ts",
|
|
116
144
|
"dist": "./dist/extensions/server.mjs",
|
|
@@ -140,7 +168,7 @@
|
|
|
140
168
|
"build": "tsdown && tsdown --config tsdown.mcp.config.ts",
|
|
141
169
|
"build:mcp": "tsdown --config tsdown.mcp.config.ts",
|
|
142
170
|
"test": "vitest --run",
|
|
143
|
-
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.web.json && tsc --noEmit -p tsconfig.mcp.json",
|
|
171
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.web.json && tsc --noEmit -p tsconfig.mcp.json && tsc --noEmit -p tsconfig.native.json",
|
|
144
172
|
"lint": "oxlint . && oxfmt . --check",
|
|
145
173
|
"fixcode": "oxlint . --fix && oxfmt ."
|
|
146
174
|
}
|