@officesdk/officesdk-plugin 1.0.3 → 1.0.4
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 +15 -0
- package/bin/hosts.mjs +3 -0
- package/bin/workbuddy.mjs +15 -3
- package/package.json +1 -1
- package/routes.json +27 -27
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# OfficeSDK for AI Agent
|
|
2
|
+
|
|
3
|
+
Open and edit Word documents, Excel workbooks, and PowerPoint presentations in your AI agent.
|
|
4
|
+
|
|
5
|
+
## Install in your agent
|
|
6
|
+
|
|
7
|
+
Paste this command into your agent’s chat and ask it to install OfficeSDK in the current client.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npx --yes @officesdk/officesdk-plugin@latest
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The installer selects the adapter for your client. [Supported clients and installation guide](https://github.com/officesdk/officesdk-plugin#quick-start)
|
|
14
|
+
|
|
15
|
+
在当前 Agent 的对话框中发送上面的命令,即可运行 OfficeSDK 安装器。[中文安装指南](https://github.com/officesdk/officesdk-plugin/blob/main/README.zh-CN.md#quick-start)
|
package/bin/hosts.mjs
CHANGED
|
@@ -46,6 +46,9 @@ export function chooseHost(explicit, env, parents) {
|
|
|
46
46
|
if (found) return found;
|
|
47
47
|
}
|
|
48
48
|
const signals = new Set();
|
|
49
|
+
// WorkBuddy can run chat commands in a detached shell without an app parent.
|
|
50
|
+
if (env.WORKBUDDY_CONFIG_DIR || env.WORKBUDDY_RESOURCES_PATH ||
|
|
51
|
+
(env.CODEBUDDY_CONFIG_DIR && path.basename(env.CODEBUDDY_CONFIG_DIR) === '.workbuddy')) signals.add('workbuddy');
|
|
49
52
|
if (env.CODEX_THREAD_ID) signals.add('codex');
|
|
50
53
|
if (env.CURSOR_AGENT === '1') signals.add('cursor');
|
|
51
54
|
const terminal = clientId(env.TERM_PROGRAM);
|
package/bin/workbuddy.mjs
CHANGED
|
@@ -53,7 +53,7 @@ export async function prepareMarket(staging,target,settings,version) {
|
|
|
53
53
|
}
|
|
54
54
|
export async function marketManager(target) {
|
|
55
55
|
const home=os.homedir();
|
|
56
|
-
const profile=path.join(home,'.workbuddy');
|
|
56
|
+
const profile=process.env.WORKBUDDY_CONFIG_DIR || path.join(home,'.workbuddy');
|
|
57
57
|
const cli='Contents/Resources/app.asar.unpacked/cli/dist/codebuddy-lite-wb.mjs';
|
|
58
58
|
const candidates=[path.join(home,'Applications/WorkBuddy.app',cli),path.join('/Applications/WorkBuddy.app',cli)];
|
|
59
59
|
let entry;
|
|
@@ -76,12 +76,24 @@ export async function marketManager(target) {
|
|
|
76
76
|
return {
|
|
77
77
|
async activate(version) {
|
|
78
78
|
await manage('validate',path.join(target,relativePlugin));
|
|
79
|
-
|
|
79
|
+
// A directory can still be registered on disk after the host stopped loading it.
|
|
80
|
+
const marketReady=async()=>JSON.parse(await manage('marketplace','list')).some(item=>item.name===market);
|
|
81
|
+
if(!record || !await marketReady()){
|
|
82
|
+
await manage('marketplace','add',target);
|
|
83
|
+
added=!record;
|
|
84
|
+
if(!await marketReady())throw Error('WorkBuddy recorded the OfficeSDK directory but did not load its local plugin source. Check WorkBuddy plugin management for this profile and retry.');
|
|
85
|
+
}
|
|
80
86
|
if(!old){await manage('install',plugin,'--scope','user');installed=true;}
|
|
81
87
|
else if(old.version!==version){await manage('marketplace','update',market);await manage('update',plugin,'--scope','user');}
|
|
82
88
|
let rows=await list();
|
|
83
89
|
if(rows.some(r=>r.id===plugin&&!r.enabled)){await manage('enable',plugin,'--scope','user');enabled=true;rows=await list();}
|
|
84
|
-
|
|
90
|
+
const isActive=items=>items.some(r=>r.id===plugin&&r.scope==='user'&&r.enabled&&r.version===version);
|
|
91
|
+
for(const delay of [250,750,1500]){
|
|
92
|
+
if(isActive(rows))break;
|
|
93
|
+
await new Promise(resolve=>setTimeout(resolve,delay));
|
|
94
|
+
rows=await list();
|
|
95
|
+
}
|
|
96
|
+
if(!isActive(rows))throw Error('WorkBuddy loaded the OfficeSDK local source but did not confirm version '+version+' as enabled for this user.');
|
|
85
97
|
if(legacy){await manage('disable',legacy.id,'--scope','user');disabled=true;}
|
|
86
98
|
},
|
|
87
99
|
async rollback() {
|
package/package.json
CHANGED
package/routes.json
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
"dsh": {
|
|
3
3
|
"kind": "dsh-npm",
|
|
4
4
|
"package": "@officesdk/officesdk-plugin-dsh",
|
|
5
|
-
"asset": "officesdk-officesdk-plugin-dsh-1.0.
|
|
6
|
-
"size":
|
|
7
|
-
"sha256": "
|
|
5
|
+
"asset": "officesdk-officesdk-plugin-dsh-1.0.4.tgz",
|
|
6
|
+
"size": 1392114,
|
|
7
|
+
"sha256": "3e8ca816018c4c9ea01face1f4987daae863b62729ea9c9ca696cb8f9beb6c11"
|
|
8
8
|
},
|
|
9
9
|
"hermes": {
|
|
10
10
|
"kind": "file-host",
|
|
11
|
-
"asset": "officesdk-hermes-1.0.
|
|
12
|
-
"sha256": "
|
|
13
|
-
"size":
|
|
11
|
+
"asset": "officesdk-hermes-1.0.4.tar.gz",
|
|
12
|
+
"sha256": "a0995ec57855e273e20a2e9ced5bdf65151422e6c19ca053d131e183a141a7d8",
|
|
13
|
+
"size": 1833268,
|
|
14
14
|
"manifest": "package.json",
|
|
15
15
|
"name": "officesdk-plugin-hermes",
|
|
16
16
|
"platforms": [
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
},
|
|
20
20
|
"minimax": {
|
|
21
21
|
"kind": "file-host",
|
|
22
|
-
"asset": "officesdk-minimax-1.0.
|
|
23
|
-
"sha256": "
|
|
24
|
-
"size":
|
|
22
|
+
"asset": "officesdk-minimax-1.0.4.tar.gz",
|
|
23
|
+
"sha256": "4cb4ad5d51876da550de436d868dcdae32aacaff36fa9d60eee32f702f1c551d",
|
|
24
|
+
"size": 1149356,
|
|
25
25
|
"manifest": ".minimax-plugin/plugin.json",
|
|
26
26
|
"name": "officesdk-minimax",
|
|
27
27
|
"platforms": [
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
},
|
|
31
31
|
"zcode": {
|
|
32
32
|
"kind": "zcode-market",
|
|
33
|
-
"asset": "officesdk-zcode-1.0.
|
|
34
|
-
"size":
|
|
35
|
-
"sha256": "
|
|
33
|
+
"asset": "officesdk-zcode-1.0.4.tar.gz",
|
|
34
|
+
"size": 1572145,
|
|
35
|
+
"sha256": "f7bd68cfd26e93064cf033d5cc49f3f78377c869de8828cf8dbbc74f2883e35c",
|
|
36
36
|
"manifest": ".zcode-plugin/plugin.json",
|
|
37
37
|
"name": "officesdk",
|
|
38
38
|
"platforms": [
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
},
|
|
42
42
|
"codex": {
|
|
43
43
|
"kind": "codex-market",
|
|
44
|
-
"asset": "officesdk-codex-1.0.
|
|
45
|
-
"size":
|
|
46
|
-
"sha256": "
|
|
44
|
+
"asset": "officesdk-codex-1.0.4.tar.gz",
|
|
45
|
+
"size": 1667014,
|
|
46
|
+
"sha256": "d20de98f46f66645ad038d254932342c28b249847252cc90f19f3c7fe444833f",
|
|
47
47
|
"manifest": ".codex-plugin/plugin.json",
|
|
48
48
|
"name": "officesdk",
|
|
49
49
|
"platforms": [
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
},
|
|
53
53
|
"workbuddy": {
|
|
54
54
|
"kind": "workbuddy-market",
|
|
55
|
-
"asset": "officesdk-workbuddy-1.0.
|
|
56
|
-
"size":
|
|
57
|
-
"sha256": "
|
|
55
|
+
"asset": "officesdk-workbuddy-1.0.4.tar.gz",
|
|
56
|
+
"size": 1513164,
|
|
57
|
+
"sha256": "cf7a29b2416e5deef25871e93dea2ae091968a12b8a81eded482b71709b5d67e",
|
|
58
58
|
"manifest": ".workbuddy-plugin/plugin.json",
|
|
59
59
|
"name": "officesdk",
|
|
60
60
|
"platforms": [
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
},
|
|
64
64
|
"antigravity": {
|
|
65
65
|
"kind": "file-host",
|
|
66
|
-
"asset": "officesdk-antigravity-1.0.
|
|
67
|
-
"size":
|
|
68
|
-
"sha256": "
|
|
66
|
+
"asset": "officesdk-antigravity-1.0.4.tar.gz",
|
|
67
|
+
"size": 1529152,
|
|
68
|
+
"sha256": "579191cbecc072b0d0ad16e2b96cfa8870694ee6c7e041f01a927b27b4f77c2a",
|
|
69
69
|
"manifest": "plugin.json",
|
|
70
70
|
"name": "officesdk",
|
|
71
71
|
"platforms": [
|
|
@@ -74,20 +74,20 @@
|
|
|
74
74
|
},
|
|
75
75
|
"grok": {
|
|
76
76
|
"kind": "vsix",
|
|
77
|
-
"asset": "officesdk-ide-1.0.
|
|
77
|
+
"asset": "officesdk-ide-1.0.4-darwin-arm64.vsix",
|
|
78
78
|
"name": "officesdk.officesdk-plugin-grok",
|
|
79
|
-
"size":
|
|
80
|
-
"sha256": "
|
|
79
|
+
"size": 1822192,
|
|
80
|
+
"sha256": "2ab07559caf12af5cf23344e337b85de59ac277ead0f9f5933b22007900f6e49",
|
|
81
81
|
"platforms": [
|
|
82
82
|
"darwin-arm64"
|
|
83
83
|
]
|
|
84
84
|
},
|
|
85
85
|
"cursor": {
|
|
86
86
|
"kind": "vsix",
|
|
87
|
-
"asset": "officesdk-ide-1.0.
|
|
87
|
+
"asset": "officesdk-ide-1.0.4-darwin-arm64.vsix",
|
|
88
88
|
"name": "officesdk.officesdk-plugin-grok",
|
|
89
|
-
"size":
|
|
90
|
-
"sha256": "
|
|
89
|
+
"size": 1822192,
|
|
90
|
+
"sha256": "2ab07559caf12af5cf23344e337b85de59ac277ead0f9f5933b22007900f6e49",
|
|
91
91
|
"platforms": [
|
|
92
92
|
"darwin-arm64"
|
|
93
93
|
]
|