@nyte-ai/plugin 0.0.25-nightly.20261101.43 → 0.0.27
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/THIRD-PARTY-NOTICES.md +65 -0
- package/dist/chunks/{bash-description-myvnmtt2.js → bash-description-03bm07ft.js} +2 -8
- package/dist/chunks/{bash-description-6mm9fym2.js → bash-description-0gnxcq7q.js} +31 -11
- package/dist/chunks/bash-description-0vfhp1qd.js +54 -0
- package/dist/chunks/{bash-description-g7gfy7nw.js → bash-description-4kqkzdkp.js} +3 -5
- package/dist/chunks/{bash-description-axnga0jz.js → bash-description-a99pev5h.js} +2 -2
- package/dist/chunks/{bash-description-bkhr9zrz.js → bash-description-s6v2m3ch.js} +28 -10
- package/dist/chunks/{bash-description-qwyy182r.js → bash-description-spc5av5d.js} +1 -7
- package/dist/chunks/bash-description-t3hbavcc.js +12 -0
- package/dist/src/acp/connection.js +1 -1
- package/dist/src/acp/index.js +2 -2
- package/dist/src/acp/transcript.js +1 -1
- package/dist/src/approvals/approvals.js +6 -3
- package/dist/src/approvals/schema.js +1 -1
- package/dist/src/browser-client.d.ts +135 -0
- package/dist/src/browser-client.js +374 -0
- package/dist/src/canvas/canvas-client.d.ts +71 -0
- package/dist/src/canvas/canvas-client.js +70 -0
- package/dist/src/canvas/canvas-compile.d.ts +0 -34
- package/dist/src/canvas/canvas-libraries.d.ts +0 -6
- package/dist/src/canvas/canvas-preview.d.ts +0 -65
- package/dist/src/canvas/canvas-protocol.d.ts +5 -80
- package/dist/src/canvas/canvas.d.ts +0 -25
- package/dist/src/canvas/schema.d.ts +0 -37
- package/dist/src/client/notifications.js +2 -1
- package/dist/src/client/presentation.d.ts +3 -23
- package/dist/src/client/presentation.js +7 -3
- package/dist/src/client/transcript.js +18 -18
- package/dist/src/client/user-messages.d.ts +41 -0
- package/dist/src/client/user-messages.js +10 -0
- package/dist/src/desktop-settings/desktop-settings.d.ts +31 -0
- package/dist/src/desktop-settings/desktop-settings.js +136 -0
- package/dist/src/desktop-settings/schema.d.ts +42 -0
- package/dist/src/desktop-settings/schema.js +14 -0
- package/dist/src/question/client/questions-tui.js +6 -2
- package/dist/src/question/client/questions.js +47 -46
- package/dist/src/question/question.d.ts +37 -6
- package/dist/src/question/question.js +69 -17
- package/dist/src/question/schema.d.ts +73 -11
- package/dist/src/question/schema.js +9 -5
- package/dist/src/rename.d.ts +1 -1
- package/dist/src/subagents.js +11 -23
- package/dist/src/web/fetch.js +1 -1
- package/dist/src/web/index.js +1 -1
- package/package.json +30 -14
package/THIRD-PARTY-NOTICES.md
CHANGED
|
@@ -611,6 +611,71 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
611
611
|
SOFTWARE.
|
|
612
612
|
```
|
|
613
613
|
|
|
614
|
+
## Ghostty (`ghostty-org/ghostty`)
|
|
615
|
+
|
|
616
|
+
- Repository: https://github.com/ghostty-org/ghostty
|
|
617
|
+
- What: `packages/vt/ghostty-vt.wasm` is the signed libghostty-vt WebAssembly
|
|
618
|
+
build from Ghostty's `tip` release at the commit recorded in
|
|
619
|
+
`packages/vt/pin.json`, shipped unmodified. `packages/vt` binds its C API.
|
|
620
|
+
|
|
621
|
+
License: MIT, with the following notice:
|
|
622
|
+
|
|
623
|
+
```text
|
|
624
|
+
MIT License
|
|
625
|
+
|
|
626
|
+
Copyright (c) 2024 Mitchell Hashimoto, Ghostty contributors
|
|
627
|
+
|
|
628
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
629
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
630
|
+
in the Software without restriction, including without limitation the rights
|
|
631
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
632
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
633
|
+
furnished to do so, subject to the following conditions:
|
|
634
|
+
|
|
635
|
+
The above copyright notice and this permission notice shall be included in all
|
|
636
|
+
copies or substantial portions of the Software.
|
|
637
|
+
|
|
638
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
639
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
640
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
641
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
642
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
643
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
644
|
+
SOFTWARE.
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
## ghostty-web (`coder/ghostty-web`)
|
|
648
|
+
|
|
649
|
+
- Repository: https://github.com/coder/ghostty-web
|
|
650
|
+
- What: the escape-heavy viewport row-merge fixture in `packages/vt/test` is
|
|
651
|
+
ported from ghostty-web's `lib/viewport-row-merge.test.ts`.
|
|
652
|
+
|
|
653
|
+
License: MIT, with the following notice:
|
|
654
|
+
|
|
655
|
+
```text
|
|
656
|
+
MIT License
|
|
657
|
+
|
|
658
|
+
Copyright (c) 2025 Coder
|
|
659
|
+
|
|
660
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
661
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
662
|
+
in the Software without restriction, including without limitation the rights
|
|
663
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
664
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
665
|
+
furnished to do so, subject to the following conditions:
|
|
666
|
+
|
|
667
|
+
The above copyright notice and this permission notice shall be included in all
|
|
668
|
+
copies or substantial portions of the Software.
|
|
669
|
+
|
|
670
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
671
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
672
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
673
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
674
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
675
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
676
|
+
SOFTWARE.
|
|
677
|
+
```
|
|
678
|
+
|
|
614
679
|
## Naybr, "Copyright Free Gameplay (No Commentary) - Minecraft Survival"
|
|
615
680
|
|
|
616
681
|
- Source: https://www.youtube.com/watch?v=GPsGyv5zTlM, by Naybr (youtube.com/@Naybr)
|
|
@@ -7,11 +7,10 @@ import {
|
|
|
7
7
|
} from "./bash-description-5dpf5hpt.js";
|
|
8
8
|
|
|
9
9
|
// src/web/fetch.ts
|
|
10
|
-
import { attachFile } from "@nyte-ai/core";
|
|
10
|
+
import { attachFile, clipText } from "@nyte-ai/core";
|
|
11
11
|
import { standard } from "@nyte-ai/schema";
|
|
12
12
|
import { Type } from "typebox";
|
|
13
13
|
var MAX_RESPONSE_BYTES = 5 * 1024 * 1024;
|
|
14
|
-
var INLINE_CHARS = 50 * 1024;
|
|
15
14
|
var MAX_REDIRECTS = 10;
|
|
16
15
|
var DEFAULT_TIMEOUT_SECONDS = 30;
|
|
17
16
|
var MAX_TIMEOUT_SECONDS = 120;
|
|
@@ -66,12 +65,7 @@ function webFetch2(fetch) {
|
|
|
66
65
|
}
|
|
67
66
|
const body = new TextDecoder().decode(await readCapped2(response, MAX_RESPONSE_BYTES));
|
|
68
67
|
const text = mime !== "text/html" || format === "html" ? body : format === "markdown" ? htmlToMarkdown2(body) : htmlToText2(body);
|
|
69
|
-
return {
|
|
70
|
-
kind: "text",
|
|
71
|
-
text: text.length > INLINE_CHARS ? `${text.slice(0, INLINE_CHARS)}
|
|
72
|
-
|
|
73
|
-
… Cut at ${INLINE_CHARS} of ${text.length} characters.` : text
|
|
74
|
-
};
|
|
68
|
+
return { kind: "text", text: clipText(text, "head") };
|
|
75
69
|
} catch (error) {
|
|
76
70
|
if (deadline.aborted && !invocation.signal.aborted)
|
|
77
71
|
throw new Error(`${url.href} didn't answer within ${seconds} s.`, { cause: error });
|
|
@@ -15,7 +15,7 @@ import { processEnvironment } from "@nyte-ai/core";
|
|
|
15
15
|
// package.json
|
|
16
16
|
var package_default = {
|
|
17
17
|
name: "@nyte-ai/plugin",
|
|
18
|
-
version: "0.0.
|
|
18
|
+
version: "0.0.27",
|
|
19
19
|
private: false,
|
|
20
20
|
license: "MIT",
|
|
21
21
|
repository: {
|
|
@@ -34,12 +34,15 @@ var package_default = {
|
|
|
34
34
|
"./core/approvals": "./src/approvals/approvals.ts",
|
|
35
35
|
"./core/acp": "./src/acp/index.ts",
|
|
36
36
|
"./core/bash-description": "./src/bash-description.ts",
|
|
37
|
+
"./core/browser-client": "./src/browser-client.ts",
|
|
37
38
|
"./core/browser-tools": "./src/browser-tools.ts",
|
|
38
39
|
"./core/canvas": "./src/canvas/canvas.ts",
|
|
40
|
+
"./core/canvas-client": "./src/canvas/canvas-client.ts",
|
|
39
41
|
"./core/canvas-compile": "./src/canvas/canvas-compile.ts",
|
|
40
42
|
"./core/canvas-preview": "./src/canvas/canvas-preview.ts",
|
|
41
43
|
"./core/claude-code-sdk": "./src/claude-code-sdk/index.ts",
|
|
42
44
|
"./core/codemode": "./src/codemode.ts",
|
|
45
|
+
"./core/desktop-settings": "./src/desktop-settings/desktop-settings.ts",
|
|
43
46
|
"./core/codemode-runtime": "./src/codemode-runtime.ts",
|
|
44
47
|
"./core/codemode-worker": "./src/codemode-worker.ts",
|
|
45
48
|
"./core/openai-astra-context": "./src/openai-astra-context.ts",
|
|
@@ -61,6 +64,7 @@ var package_default = {
|
|
|
61
64
|
"./approvals/schema": "./src/approvals/schema.ts",
|
|
62
65
|
"./canvas/protocol": "./src/canvas/canvas-protocol.ts",
|
|
63
66
|
"./canvas/schema": "./src/canvas/schema.ts",
|
|
67
|
+
"./desktop-settings/schema": "./src/desktop-settings/schema.ts",
|
|
64
68
|
"./question/schema": "./src/question/schema.ts"
|
|
65
69
|
},
|
|
66
70
|
publishConfig: {
|
|
@@ -81,6 +85,10 @@ var package_default = {
|
|
|
81
85
|
types: "./dist/src/bash-description.d.ts",
|
|
82
86
|
import: "./dist/src/bash-description.js"
|
|
83
87
|
},
|
|
88
|
+
"./core/browser-client": {
|
|
89
|
+
types: "./dist/src/browser-client.d.ts",
|
|
90
|
+
import: "./dist/src/browser-client.js"
|
|
91
|
+
},
|
|
84
92
|
"./core/browser-tools": {
|
|
85
93
|
types: "./dist/src/browser-tools.d.ts",
|
|
86
94
|
import: "./dist/src/browser-tools.js"
|
|
@@ -89,6 +97,10 @@ var package_default = {
|
|
|
89
97
|
types: "./dist/src/canvas/canvas.d.ts",
|
|
90
98
|
import: "./dist/src/canvas/canvas.js"
|
|
91
99
|
},
|
|
100
|
+
"./core/canvas-client": {
|
|
101
|
+
types: "./dist/src/canvas/canvas-client.d.ts",
|
|
102
|
+
import: "./dist/src/canvas/canvas-client.js"
|
|
103
|
+
},
|
|
92
104
|
"./core/canvas-compile": {
|
|
93
105
|
types: "./dist/src/canvas/canvas-compile.d.ts",
|
|
94
106
|
import: "./dist/src/canvas/canvas-compile.js"
|
|
@@ -113,6 +125,10 @@ var package_default = {
|
|
|
113
125
|
types: "./dist/src/codemode-worker.d.ts",
|
|
114
126
|
import: "./dist/src/codemode-worker.js"
|
|
115
127
|
},
|
|
128
|
+
"./core/desktop-settings": {
|
|
129
|
+
types: "./dist/src/desktop-settings/desktop-settings.d.ts",
|
|
130
|
+
import: "./dist/src/desktop-settings/desktop-settings.js"
|
|
131
|
+
},
|
|
116
132
|
"./core/openai-astra-context": {
|
|
117
133
|
types: "./dist/src/openai-astra-context.d.ts",
|
|
118
134
|
import: "./dist/src/openai-astra-context.js"
|
|
@@ -189,6 +205,10 @@ var package_default = {
|
|
|
189
205
|
types: "./dist/src/canvas/schema.d.ts",
|
|
190
206
|
import: "./dist/src/canvas/schema.js"
|
|
191
207
|
},
|
|
208
|
+
"./desktop-settings/schema": {
|
|
209
|
+
types: "./dist/src/desktop-settings/schema.d.ts",
|
|
210
|
+
import: "./dist/src/desktop-settings/schema.js"
|
|
211
|
+
},
|
|
192
212
|
"./question/schema": {
|
|
193
213
|
types: "./dist/src/question/schema.d.ts",
|
|
194
214
|
import: "./dist/src/question/schema.js"
|
|
@@ -204,9 +224,9 @@ var package_default = {
|
|
|
204
224
|
"build:package": "bun ../../scripts/sdk-packages.mjs build plugin"
|
|
205
225
|
},
|
|
206
226
|
dependencies: {
|
|
207
|
-
"@agentclientprotocol/sdk": "^2.
|
|
208
|
-
"@anthropic-ai/claude-agent-sdk": "^0.3.
|
|
209
|
-
"@earendil-works/pi-codemode": "^1.
|
|
227
|
+
"@agentclientprotocol/sdk": "^2.4.0",
|
|
228
|
+
"@anthropic-ai/claude-agent-sdk": "^0.3.317",
|
|
229
|
+
"@earendil-works/pi-codemode": "^1.5.0",
|
|
210
230
|
"@nyte-ai/ai": "workspace:*",
|
|
211
231
|
"@nyte-ai/core": "workspace:*",
|
|
212
232
|
"@nyte-ai/schema": "workspace:*",
|
|
@@ -214,22 +234,22 @@ var package_default = {
|
|
|
214
234
|
"@opentelemetry/exporter-trace-otlp-http": "^0.300.0",
|
|
215
235
|
"@opentelemetry/resources": "^3.0.0",
|
|
216
236
|
"@opentelemetry/sdk-trace": "^3.0.0",
|
|
217
|
-
"@opentelemetry/semantic-conventions": "^1.
|
|
237
|
+
"@opentelemetry/semantic-conventions": "^1.44.0",
|
|
218
238
|
"es-module-lexer": "^3.0.4",
|
|
219
|
-
htmlparser2: "^
|
|
239
|
+
htmlparser2: "^12.0.0",
|
|
220
240
|
sucrase: "^3.35.1",
|
|
221
|
-
typebox: "^1.4.
|
|
241
|
+
typebox: "^1.4.3",
|
|
222
242
|
zod: "^4.6.7"
|
|
223
243
|
},
|
|
224
244
|
devDependencies: {
|
|
225
|
-
"@opentui/core": "^0.
|
|
226
|
-
"@types/node": "^26.6.
|
|
245
|
+
"@opentui/core": "^0.8.2",
|
|
246
|
+
"@types/node": "^26.6.6",
|
|
227
247
|
"@types/react": "^19.3.0",
|
|
228
248
|
react: "^19.3.1",
|
|
229
|
-
vitest: "^5.0
|
|
249
|
+
vitest: "^5.1.0"
|
|
230
250
|
},
|
|
231
251
|
peerDependencies: {
|
|
232
|
-
"@opentui/core": "^0.
|
|
252
|
+
"@opentui/core": "^0.8.2",
|
|
233
253
|
react: "^19.3.1"
|
|
234
254
|
},
|
|
235
255
|
peerDependenciesMeta: {
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// src/desktop-settings/schema.ts
|
|
2
|
+
import { ORIGIN_PATTERN } from "@nyte-ai/schema/origin";
|
|
3
|
+
import { Type } from "typebox";
|
|
4
|
+
var ALERT_CHANNELS2 = ["notification", "badge", "sound", "bounce", "remind"];
|
|
5
|
+
var ALERT_OFFERS2 = {
|
|
6
|
+
waiting: ALERT_CHANNELS2,
|
|
7
|
+
failed: ["notification", "badge", "sound", "bounce"],
|
|
8
|
+
done: ["notification", "badge", "sound"]
|
|
9
|
+
};
|
|
10
|
+
var ALERT_SETTING2 = {
|
|
11
|
+
waiting: "alertsWaiting",
|
|
12
|
+
failed: "alertsFailed",
|
|
13
|
+
done: "alertsDone"
|
|
14
|
+
};
|
|
15
|
+
var DESKTOP_SETTING_SCHEMAS2 = {
|
|
16
|
+
keepAwake: Type.Boolean(),
|
|
17
|
+
pauseOnSleep: Type.Boolean(),
|
|
18
|
+
terminalShell: Type.Union([Type.String({ minLength: 1 }), Type.Null()]),
|
|
19
|
+
blockAds: Type.Boolean(),
|
|
20
|
+
adblockAllowedHosts: Type.Array(Type.String({ minLength: 1, maxLength: 253 })),
|
|
21
|
+
upgradeToHttps: Type.Boolean(),
|
|
22
|
+
webOrigins: Type.Array(Type.String({ pattern: ORIGIN_PATTERN })),
|
|
23
|
+
notifications: Type.Boolean(),
|
|
24
|
+
dockBadge: Type.Boolean(),
|
|
25
|
+
notificationSounds: Type.Boolean(),
|
|
26
|
+
alertsWaiting: Type.Array(Type.Enum(ALERT_OFFERS2.waiting)),
|
|
27
|
+
alertsFailed: Type.Array(Type.Enum(ALERT_OFFERS2.failed)),
|
|
28
|
+
alertsDone: Type.Array(Type.Enum(ALERT_OFFERS2.done)),
|
|
29
|
+
remindMinutes: Type.Union([Type.Literal(1), Type.Literal(2), Type.Literal(5), Type.Literal(15)]),
|
|
30
|
+
notifyViewedChat: Type.Boolean(),
|
|
31
|
+
notifySubagents: Type.Boolean(),
|
|
32
|
+
terminalNotifications: Type.Boolean()
|
|
33
|
+
};
|
|
34
|
+
var DEFAULT_DESKTOP_SETTINGS2 = {
|
|
35
|
+
keepAwake: false,
|
|
36
|
+
pauseOnSleep: true,
|
|
37
|
+
terminalShell: null,
|
|
38
|
+
blockAds: true,
|
|
39
|
+
adblockAllowedHosts: [],
|
|
40
|
+
upgradeToHttps: true,
|
|
41
|
+
webOrigins: [],
|
|
42
|
+
notifications: true,
|
|
43
|
+
dockBadge: true,
|
|
44
|
+
notificationSounds: true,
|
|
45
|
+
alertsWaiting: ["notification", "badge", "sound", "bounce", "remind"],
|
|
46
|
+
alertsFailed: ["notification", "badge", "sound"],
|
|
47
|
+
alertsDone: ["notification", "badge"],
|
|
48
|
+
remindMinutes: 2,
|
|
49
|
+
notifyViewedChat: false,
|
|
50
|
+
notifySubagents: false,
|
|
51
|
+
terminalNotifications: true
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { ALERT_CHANNELS2, ALERT_OFFERS2, ALERT_SETTING2, DESKTOP_SETTING_SCHEMAS2, DEFAULT_DESKTOP_SETTINGS2 };
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./bash-description-q2v8wbn8.js";
|
|
4
4
|
|
|
5
5
|
// src/acp/transcript.ts
|
|
6
|
-
|
|
6
|
+
import { excerptText } from "@nyte-ai/core";
|
|
7
7
|
function text(content) {
|
|
8
8
|
return typeof content === "string" ? content : content.map((block) => block.type === "text" ? block.text : `[${block.mimeType}]`).join("");
|
|
9
9
|
}
|
|
@@ -27,10 +27,8 @@ function transcriptText2(messages) {
|
|
|
27
27
|
return [`User:
|
|
28
28
|
${text(message.content)}`];
|
|
29
29
|
if (message.role === "toolResult")
|
|
30
|
-
return [
|
|
31
|
-
|
|
32
|
-
${text(message.content).slice(0, RESULT_LIMIT)}`
|
|
33
|
-
];
|
|
30
|
+
return [`Tool result (${message.toolName}):
|
|
31
|
+
${excerptText(text(message.content))}`];
|
|
34
32
|
if (message.role !== "assistant" || message.stopReason === "error")
|
|
35
33
|
return [];
|
|
36
34
|
const said = message.content.flatMap((block) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/approvals/schema.ts
|
|
2
|
-
import { standard, ToolClassType } from "@nyte-ai/schema";
|
|
2
|
+
import { ApprovalPolicyType, standard, ToolClassType } from "@nyte-ai/schema";
|
|
3
3
|
import { Type } from "typebox";
|
|
4
|
-
var policy = standard(
|
|
4
|
+
var policy = standard(ApprovalPolicyType);
|
|
5
5
|
var PERMISSIONS2 = "permissions";
|
|
6
6
|
var approvalPolicy2 = policy;
|
|
7
7
|
var APPROVAL_POLICIES2 = [
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/question/schema.ts
|
|
2
|
-
import { standard } from "@nyte-ai/schema";
|
|
2
|
+
import { idSchema, isJsonObject, standard } from "@nyte-ai/schema";
|
|
3
3
|
import { Type } from "typebox";
|
|
4
|
+
var QUESTION_TOOL2 = "question";
|
|
4
5
|
var infoSchema = Type.Object({
|
|
5
6
|
question: Type.String({ minLength: 1, pattern: "\\S", description: "The question to ask." }),
|
|
6
7
|
header: Type.String({
|
|
@@ -21,10 +22,20 @@ var answers = Type.Array(Type.Array(Type.String({ minLength: 1 })), {
|
|
|
21
22
|
minItems: 1
|
|
22
23
|
});
|
|
23
24
|
var answerInput2 = standard(Type.Object({ answers }));
|
|
24
|
-
var
|
|
25
|
-
var
|
|
25
|
+
var skipInput = standard(Type.Object({}));
|
|
26
|
+
var phase = Type.Union([
|
|
27
|
+
Type.Object({ kind: Type.Literal("asking") }),
|
|
28
|
+
Type.Object({ kind: Type.Literal("open"), head: idSchema() }),
|
|
29
|
+
Type.Object({
|
|
30
|
+
kind: Type.Literal("answered"),
|
|
31
|
+
answers,
|
|
32
|
+
head: Type.Union([idSchema(), Type.Null()])
|
|
33
|
+
}),
|
|
34
|
+
Type.Object({ kind: Type.Literal("skipped"), late: Type.Boolean() })
|
|
35
|
+
]);
|
|
36
|
+
var state = standard(Type.Object({ call: idSchema(), questions, phase }));
|
|
26
37
|
var questionParameters2 = standard(Type.Object({ questions }));
|
|
27
|
-
var actions = { answer: { input: answerInput2 } };
|
|
38
|
+
var actions = { answer: { input: answerInput2 }, skip: { input: skipInput } };
|
|
28
39
|
var question2 = {
|
|
29
40
|
kind: "ask/question",
|
|
30
41
|
state,
|
|
@@ -32,8 +43,8 @@ var question2 = {
|
|
|
32
43
|
fallback: (current, { id }) => `Questions ${id}:
|
|
33
44
|
${current.questions.map((item, index) => `${item.header}: ${item.question}
|
|
34
45
|
${item.options.map((option) => `${option.label}: ${option.description}`).join(`
|
|
35
|
-
`)}${current.
|
|
36
|
-
Answered: ${current.answers[index].join(", ") || "Unanswered"}`}`).join(`
|
|
46
|
+
`)}${current.phase.kind === "answered" ? `
|
|
47
|
+
Answered: ${current.phase.answers[index].join(", ") || "Unanswered"}` : ""}`).join(`
|
|
37
48
|
|
|
38
49
|
`)}`
|
|
39
50
|
};
|
|
@@ -41,11 +52,18 @@ function openQuestions2(view) {
|
|
|
41
52
|
return (view?.parts ?? []).flatMap((part) => {
|
|
42
53
|
if (part.partKind !== question2.kind || part.status.kind !== "live")
|
|
43
54
|
return [];
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
55
|
+
const read = readQuestion2(part);
|
|
56
|
+
if (read === null || read.phase.kind !== "asking" && read.phase.kind !== "open")
|
|
46
57
|
return [];
|
|
47
|
-
return [{ part: part.id, questions:
|
|
58
|
+
return [{ part: part.id, questions: read.questions, late: read.phase.kind === "open" }];
|
|
48
59
|
});
|
|
49
60
|
}
|
|
61
|
+
function findQuestionPart2(parts, call) {
|
|
62
|
+
return parts.find((part) => part.partKind === question2.kind && isJsonObject(part.state) && part.state.call === call);
|
|
63
|
+
}
|
|
64
|
+
function readQuestion2(part) {
|
|
65
|
+
const checked = question2.state["~standard"].validate(part.state);
|
|
66
|
+
return checked instanceof Promise || checked.issues !== undefined ? null : checked.value;
|
|
67
|
+
}
|
|
50
68
|
|
|
51
|
-
export {
|
|
69
|
+
export { QUESTION_TOOL2, answerInput2, questionParameters2, question2, openQuestions2, findQuestionPart2, readQuestion2 };
|
|
@@ -19,12 +19,6 @@ function readRawPart2(message) {
|
|
|
19
19
|
}
|
|
20
20
|
return { format: "json", body: state === undefined ? "null" : JSON.stringify(state, null, 2) };
|
|
21
21
|
}
|
|
22
|
-
function showsReport2(message) {
|
|
23
|
-
return message.source.kind === "child" || message.source.kind === "job";
|
|
24
|
-
}
|
|
25
|
-
function shownContent2(message) {
|
|
26
|
-
return message.source.kind === "action" ? message.source.label : message.content;
|
|
27
|
-
}
|
|
28
22
|
var RUNNING = { tense: "running", tone: "running", word: undefined };
|
|
29
23
|
function toolStatus2(message) {
|
|
30
24
|
const { state, status } = message;
|
|
@@ -449,4 +443,4 @@ function failureNotice2(failure) {
|
|
|
449
443
|
}
|
|
450
444
|
}
|
|
451
445
|
|
|
452
|
-
export { showsTool2, showsText2, showsThinking2, readRawPart2,
|
|
446
|
+
export { showsTool2, showsText2, showsThinking2, readRawPart2, toolStatus2, toolOutput2, taskLabel2, callTaskState2, taskEnded2, agentGroupSummary2, runStatus2, endedStatus2, runMark2, rowMark2, backgroundLabel2, planningLabel2, PLANNING_LABEL2, PLANNING_DELAY_MS2, SLOW_PLANNING_MS2, executionMark2, mainHead2, sessionMark2, sessionTitle2, SUBAGENT_TITLE2, findCommandArgument2, completionTrigger2, customTool2, toolVerbs2, toolNoun2, delegateSubject2, toolSubject2, toolTitle2, tidyPath2, placeName2, condensedCommand2, formatDuration2, formatWholeDuration2, toolDetail2, failureNotice2, jobTaskState2 };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/client/user-messages.ts
|
|
2
|
+
function showsReport2(message) {
|
|
3
|
+
return message.source.kind === "child" || message.source.kind === "job";
|
|
4
|
+
}
|
|
5
|
+
function showsAnswer2(message) {
|
|
6
|
+
return message.source.kind === "answer";
|
|
7
|
+
}
|
|
8
|
+
function shownContent2(message) {
|
|
9
|
+
return message.source.kind === "action" || message.source.kind === "answer" ? message.source.label : message.content;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { showsReport2, showsAnswer2, shownContent2 };
|
package/dist/src/acp/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import"../../chunks/bash-description-99k8z2r7.js";
|
|
9
9
|
import {
|
|
10
10
|
AcpProcess2
|
|
11
|
-
} from "../../chunks/bash-description-
|
|
11
|
+
} from "../../chunks/bash-description-0gnxcq7q.js";
|
|
12
12
|
import"../../chunks/bash-description-4vz9pxyx.js";
|
|
13
13
|
import {
|
|
14
14
|
registryEntries2,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
messageKey2,
|
|
20
20
|
userBlocks2,
|
|
21
21
|
transcriptText2
|
|
22
|
-
} from "../../chunks/bash-description-
|
|
22
|
+
} from "../../chunks/bash-description-4kqkzdkp.js";
|
|
23
23
|
|
|
24
24
|
// src/acp/index.ts
|
|
25
25
|
import {
|
|
@@ -4,14 +4,15 @@ import {
|
|
|
4
4
|
APPROVAL_POLICIES2,
|
|
5
5
|
approval2,
|
|
6
6
|
openApprovals2
|
|
7
|
-
} from "../../chunks/bash-description-
|
|
7
|
+
} from "../../chunks/bash-description-a99pev5h.js";
|
|
8
8
|
|
|
9
9
|
// src/approvals/approvals.ts
|
|
10
10
|
import { posix } from "node:path";
|
|
11
11
|
import { definePart } from "@nyte-ai/core";
|
|
12
|
-
import { SdkError } from "@nyte-ai/schema";
|
|
12
|
+
import { ApprovalPolicyType, SdkError } from "@nyte-ai/schema";
|
|
13
13
|
var DENIED = "The user denied this tool call. Ask them how to proceed instead of retrying it.";
|
|
14
14
|
var UNANSWERED = "The approval request closed before the user answered.";
|
|
15
|
+
var POLICIES = ApprovalPolicyType.anyOf.map((literal) => literal.const);
|
|
15
16
|
var permissions = {
|
|
16
17
|
id: PERMISSIONS2,
|
|
17
18
|
label: "Permissions",
|
|
@@ -49,8 +50,10 @@ function approvalReason(policy, tool, cwd) {
|
|
|
49
50
|
}
|
|
50
51
|
async function readPolicy(api) {
|
|
51
52
|
const value = await api.contribute.settings.value(PERMISSIONS2);
|
|
53
|
+
const ceiling = (await api.session.info()).mcp?.ceiling;
|
|
52
54
|
const checked = approvalPolicy2["~standard"].validate(value);
|
|
53
|
-
|
|
55
|
+
const host = checked instanceof Promise || checked.issues !== undefined ? permissions.default : checked.value;
|
|
56
|
+
return ceiling !== undefined && POLICIES.indexOf(ceiling) < POLICIES.indexOf(host) ? ceiling : host;
|
|
54
57
|
}
|
|
55
58
|
async function pendingReason(api, tool) {
|
|
56
59
|
const reason = approvalReason(await readPolicy(api), tool, api.env.cwd);
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { Json, SessionId } from "@nyte-ai/schema";
|
|
2
|
+
import { Type } from "typebox";
|
|
3
|
+
import type { Static } from "typebox";
|
|
4
|
+
import type { Plugin } from "@nyte-ai/plugin/core";
|
|
5
|
+
/**
|
|
6
|
+
* How a host asks its connected clients to act: whether one offers an
|
|
7
|
+
* action now, and asking the one that does, which answers `not_supported`
|
|
8
|
+
* when none does.
|
|
9
|
+
*
|
|
10
|
+
* @category plugins
|
|
11
|
+
* @since 0.1.0
|
|
12
|
+
*/
|
|
13
|
+
export interface ClientActions {
|
|
14
|
+
offered(action: string): boolean;
|
|
15
|
+
perform(action: string, input: Json, timeoutMs: number): Promise<Json>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The action an app offers to drive the page each chat's agent holds in its
|
|
19
|
+
* browser; its input is a `BrowserCall`.
|
|
20
|
+
*
|
|
21
|
+
* @category plugins
|
|
22
|
+
* @since 0.1.0
|
|
23
|
+
*/
|
|
24
|
+
export declare const BROWSER_ACTION: {
|
|
25
|
+
readonly name: "browser";
|
|
26
|
+
readonly summary: "Drives the page a chat's agent holds in this app's browser.";
|
|
27
|
+
readonly input: {
|
|
28
|
+
readonly type: "object";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* What the host asks the browser action to do: one `BrowserAgent` method of
|
|
33
|
+
* the desktop and its input.
|
|
34
|
+
*
|
|
35
|
+
* @category plugins
|
|
36
|
+
* @since 0.1.0
|
|
37
|
+
*/
|
|
38
|
+
export declare const BrowserCallType: Type.TUnion<[Type.TObject<{
|
|
39
|
+
method: Type.TLiteral<"open">;
|
|
40
|
+
session: Type.TUnsafe<import("@nyte-ai/schema").Id<"session">>;
|
|
41
|
+
owner: Type.TUnion<[Type.TObject<{
|
|
42
|
+
kind: Type.TLiteral<"home">;
|
|
43
|
+
}>, Type.TObject<{
|
|
44
|
+
kind: Type.TLiteral<"project">;
|
|
45
|
+
path: Type.TString;
|
|
46
|
+
}>]>;
|
|
47
|
+
url: Type.TString;
|
|
48
|
+
}>, Type.TObject<{
|
|
49
|
+
method: Type.TLiteral<"snapshot">;
|
|
50
|
+
session: Type.TUnsafe<import("@nyte-ai/schema").Id<"session">>;
|
|
51
|
+
ref: Type.TOptional<Type.TString>;
|
|
52
|
+
}>, Type.TObject<{
|
|
53
|
+
method: Type.TLiteral<"click">;
|
|
54
|
+
session: Type.TUnsafe<import("@nyte-ai/schema").Id<"session">>;
|
|
55
|
+
ref: Type.TString;
|
|
56
|
+
expect: Type.TString;
|
|
57
|
+
button: Type.TOptional<Type.TEnum<["left", "right", "middle"]>>;
|
|
58
|
+
double: Type.TOptional<Type.TBoolean>;
|
|
59
|
+
}>, Type.TObject<{
|
|
60
|
+
method: Type.TLiteral<"type">;
|
|
61
|
+
session: Type.TUnsafe<import("@nyte-ai/schema").Id<"session">>;
|
|
62
|
+
ref: Type.TString;
|
|
63
|
+
text: Type.TString;
|
|
64
|
+
expect: Type.TString;
|
|
65
|
+
clear: Type.TOptional<Type.TBoolean>;
|
|
66
|
+
submit: Type.TOptional<Type.TBoolean>;
|
|
67
|
+
}>, Type.TObject<{
|
|
68
|
+
method: Type.TLiteral<"press">;
|
|
69
|
+
session: Type.TUnsafe<import("@nyte-ai/schema").Id<"session">>;
|
|
70
|
+
key: Type.TString;
|
|
71
|
+
ref: Type.TOptional<Type.TString>;
|
|
72
|
+
}>, Type.TObject<{
|
|
73
|
+
method: Type.TLiteral<"scroll">;
|
|
74
|
+
session: Type.TUnsafe<import("@nyte-ai/schema").Id<"session">>;
|
|
75
|
+
direction: Type.TEnum<["up", "down", "top", "bottom"]>;
|
|
76
|
+
ref: Type.TOptional<Type.TString>;
|
|
77
|
+
pages: Type.TOptional<Type.TNumber>;
|
|
78
|
+
}>, Type.TObject<{
|
|
79
|
+
method: Type.TLiteral<"wait">;
|
|
80
|
+
session: Type.TUnsafe<import("@nyte-ai/schema").Id<"session">>;
|
|
81
|
+
wait: Type.TUnion<[Type.TObject<{
|
|
82
|
+
until: Type.TLiteral<"load">;
|
|
83
|
+
}>, Type.TObject<{
|
|
84
|
+
until: Type.TLiteral<"text">;
|
|
85
|
+
text: Type.TString;
|
|
86
|
+
}>, Type.TObject<{
|
|
87
|
+
until: Type.TLiteral<"gone">;
|
|
88
|
+
text: Type.TString;
|
|
89
|
+
}>, Type.TObject<{
|
|
90
|
+
until: Type.TLiteral<"time">;
|
|
91
|
+
seconds: Type.TNumber;
|
|
92
|
+
}>]>;
|
|
93
|
+
}>, Type.TObject<{
|
|
94
|
+
method: Type.TLiteral<"console">;
|
|
95
|
+
session: Type.TUnsafe<import("@nyte-ai/schema").Id<"session">>;
|
|
96
|
+
limit: Type.TInteger;
|
|
97
|
+
clear: Type.TOptional<Type.TBoolean>;
|
|
98
|
+
}>, Type.TObject<{
|
|
99
|
+
method: Type.TLiteral<"evaluate">;
|
|
100
|
+
session: Type.TUnsafe<import("@nyte-ai/schema").Id<"session">>;
|
|
101
|
+
expression: Type.TString;
|
|
102
|
+
ref: Type.TOptional<Type.TString>;
|
|
103
|
+
}>, Type.TObject<{
|
|
104
|
+
method: Type.TLiteral<"capture">;
|
|
105
|
+
session: Type.TUnsafe<import("@nyte-ai/schema").Id<"session">>;
|
|
106
|
+
}>, Type.TObject<{
|
|
107
|
+
method: Type.TLiteral<"release">;
|
|
108
|
+
session: Type.TUnsafe<import("@nyte-ai/schema").Id<"session">>;
|
|
109
|
+
}>]>;
|
|
110
|
+
export type BrowserCall = Static<typeof BrowserCallType>;
|
|
111
|
+
/**
|
|
112
|
+
* Returns page text fit for one line of a tool result: no control
|
|
113
|
+
* characters and no characters that reorder or break lines.
|
|
114
|
+
*
|
|
115
|
+
* @category plugins
|
|
116
|
+
* @since 0.1.0
|
|
117
|
+
*/
|
|
118
|
+
export declare function sanitizeLine(text: string): string;
|
|
119
|
+
/**
|
|
120
|
+
* Returns the id of the page a session's agent holds in an app's browser.
|
|
121
|
+
*
|
|
122
|
+
* @category plugins
|
|
123
|
+
* @since 0.1.0
|
|
124
|
+
*/
|
|
125
|
+
export declare function sessionSurfaceId(sessionId: SessionId): string;
|
|
126
|
+
/**
|
|
127
|
+
* The browser tools, served by the connected app that offers
|
|
128
|
+
* `BROWSER_ACTION`: each session's page is the one its agent holds in that
|
|
129
|
+
* app. With no app connected that offers it, every tool answers that only
|
|
130
|
+
* Nyte.app has the browser.
|
|
131
|
+
*
|
|
132
|
+
* @category plugins
|
|
133
|
+
* @since 0.1.0
|
|
134
|
+
*/
|
|
135
|
+
export declare function clientBrowserPlugins(actions: ClientActions, home: string): readonly Plugin[];
|