@dev-anywhere/relay 0.9.21 → 0.10.0
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 +1 -1
- package/assets/web/assets/{fvad-CLXTqQ8w.js → fvad-C8UpHprw.js} +1 -1
- package/assets/web/assets/index-DT0vbQRT.js +869 -0
- package/assets/web/assets/index-DU6oplEW.css +41 -0
- package/assets/web/assets/{jmuxer.min-DNcvBLce.js → jmuxer.min-C1x6SWsK.js} +1 -1
- package/assets/web/index.html +2 -2
- package/assets/web/sw.js +1 -1
- package/dist/{chunk-QQQVGCCU.js → chunk-DJC4P5O3.js} +108 -11
- package/dist/chunk-DJC4P5O3.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -1
- package/dist/index.js.map +1 -1
- package/dist/node-runtime-guard.d.ts +4 -0
- package/dist/node-runtime-guard.d.ts.map +1 -0
- package/dist/server.js +1 -1
- package/package.json +3 -3
- package/assets/web/assets/index-CKcK9Gip.css +0 -41
- package/assets/web/assets/index-CTVBM14S.js +0 -869
- package/dist/chunk-QQQVGCCU.js.map +0 -1
package/assets/web/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const
|
|
1
|
+
if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const l=e=>i(e,t),f={module:{uri:t},exports:o,require:l};s[t]=Promise.all(n.map(e=>f[e]||l(e))).then(e=>(r(...e),o))}}define(["./workbox-10a3128e"],function(e){"use strict";importScripts("notification-sw.js"),self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"notification-sw.js",revision:"ee0be62f4c1f36625b92680b3060becb"},{url:"index.html",revision:"72111ea68803e10bf2dd293245bb8af6"},{url:"assets/jmuxer.min-C1x6SWsK.js",revision:null},{url:"assets/index-DU6oplEW.css",revision:null},{url:"assets/index-DT0vbQRT.js",revision:null},{url:"assets/fvad-DYxbW2my.wasm",revision:null},{url:"assets/fvad-C8UpHprw.js",revision:null},{url:"assets/__vite-browser-external-D7Ct-6yo.js",revision:null},{url:"brand-icon.svg",revision:"efe8505a7b7ef12cbb3a4bcd286254bd"},{url:"maskable-icon-512x512.png",revision:"e762ff07cdedcd78f8650f59c6881727"},{url:"pwa-192x192.png",revision:"4e4603ce0f22528eded553ba7f2ffbc5"},{url:"pwa-512x512.png",revision:"e762ff07cdedcd78f8650f59c6881727"},{url:"pwa-64x64.png",revision:"d322160ad1dc08ba9e133cb3d296ae63"},{url:"manifest.webmanifest",revision:"4daa295c44052f4ce59a1fcfd6f06ab8"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/index.html"),{denylist:[/^\/proxy(\/|$|\?)/,/^\/client(\/|$|\?)/,/^\/voice(\/|$|\?)/,/^\/fonts\//,/^\/health/,/^\/status/,/^\/api\//]})),e.registerRoute(/^\/fonts\/.*\.(woff2|woff|ttf|otf|css)$/,new e.CacheFirst({cacheName:"dev-anywhere-fonts",plugins:[new e.ExpirationPlugin({maxEntries:40,maxAgeSeconds:15552e3})]}),"GET")});
|
|
@@ -49,21 +49,101 @@ var ApprovalOptionSchema = z3.object({
|
|
|
49
49
|
name: z3.string().min(1),
|
|
50
50
|
kind: ApprovalOptionKindSchema
|
|
51
51
|
});
|
|
52
|
+
var CursorTodoStatusSchema = z3.enum(["pending", "in_progress", "completed", "cancelled"]);
|
|
53
|
+
var CursorTodoSchema = z3.object({
|
|
54
|
+
id: IdSchema,
|
|
55
|
+
content: z3.string(),
|
|
56
|
+
status: CursorTodoStatusSchema
|
|
57
|
+
});
|
|
58
|
+
var CursorAskQuestionPromptSchema = z3.object({
|
|
59
|
+
type: z3.literal("ask_question"),
|
|
60
|
+
toolCallId: IdSchema.optional(),
|
|
61
|
+
title: z3.string().optional(),
|
|
62
|
+
questions: z3.array(z3.object({
|
|
63
|
+
id: IdSchema,
|
|
64
|
+
prompt: z3.string(),
|
|
65
|
+
options: z3.array(z3.object({ id: IdSchema, label: z3.string() })),
|
|
66
|
+
allowMultiple: z3.boolean().optional()
|
|
67
|
+
}))
|
|
68
|
+
});
|
|
69
|
+
var CursorCreatePlanPromptSchema = z3.object({
|
|
70
|
+
type: z3.literal("create_plan"),
|
|
71
|
+
toolCallId: IdSchema.optional(),
|
|
72
|
+
name: z3.string().optional(),
|
|
73
|
+
overview: z3.string().optional(),
|
|
74
|
+
plan: z3.string(),
|
|
75
|
+
todos: z3.array(CursorTodoSchema).optional(),
|
|
76
|
+
isProject: z3.boolean().optional(),
|
|
77
|
+
phases: z3.array(z3.object({
|
|
78
|
+
name: z3.string(),
|
|
79
|
+
todos: z3.array(CursorTodoSchema)
|
|
80
|
+
})).optional()
|
|
81
|
+
});
|
|
82
|
+
var CursorPromptSchema = z3.discriminatedUnion("type", [
|
|
83
|
+
CursorAskQuestionPromptSchema,
|
|
84
|
+
CursorCreatePlanPromptSchema
|
|
85
|
+
]);
|
|
86
|
+
var CursorAskQuestionAnswerSchema = z3.object({
|
|
87
|
+
type: z3.literal("ask_question"),
|
|
88
|
+
outcome: z3.enum(["answered", "skipped", "cancelled"]),
|
|
89
|
+
answers: z3.array(z3.object({
|
|
90
|
+
questionId: IdSchema,
|
|
91
|
+
selectedOptionIds: z3.array(IdSchema)
|
|
92
|
+
})).optional(),
|
|
93
|
+
reason: z3.string().optional()
|
|
94
|
+
});
|
|
95
|
+
var CursorCreatePlanAnswerSchema = z3.object({
|
|
96
|
+
type: z3.literal("create_plan"),
|
|
97
|
+
outcome: z3.enum(["accepted", "rejected", "cancelled"]),
|
|
98
|
+
reason: z3.string().optional()
|
|
99
|
+
});
|
|
100
|
+
var CursorAnswerSchema = z3.discriminatedUnion("type", [
|
|
101
|
+
CursorAskQuestionAnswerSchema,
|
|
102
|
+
CursorCreatePlanAnswerSchema
|
|
103
|
+
]);
|
|
104
|
+
var CursorSessionUiSchema = z3.discriminatedUnion("kind", [
|
|
105
|
+
z3.object({
|
|
106
|
+
kind: z3.literal("todos"),
|
|
107
|
+
toolCallId: IdSchema.optional(),
|
|
108
|
+
todos: z3.array(CursorTodoSchema),
|
|
109
|
+
merge: z3.boolean()
|
|
110
|
+
}),
|
|
111
|
+
z3.object({
|
|
112
|
+
kind: z3.literal("task"),
|
|
113
|
+
toolCallId: IdSchema.optional(),
|
|
114
|
+
description: z3.string(),
|
|
115
|
+
prompt: z3.string().optional(),
|
|
116
|
+
subagentType: z3.unknown().optional(),
|
|
117
|
+
model: z3.string().optional(),
|
|
118
|
+
agentId: z3.string().optional(),
|
|
119
|
+
durationMs: z3.number().optional()
|
|
120
|
+
}),
|
|
121
|
+
z3.object({
|
|
122
|
+
kind: z3.literal("image"),
|
|
123
|
+
toolCallId: IdSchema.optional(),
|
|
124
|
+
description: z3.string(),
|
|
125
|
+
filePath: z3.string().optional(),
|
|
126
|
+
referenceImagePaths: z3.array(z3.string()).optional()
|
|
127
|
+
})
|
|
128
|
+
]);
|
|
52
129
|
var ToolUseRequestPayloadSchema = z3.object({
|
|
53
130
|
toolName: z3.string(),
|
|
54
131
|
toolId: IdSchema,
|
|
55
132
|
parameters: z3.record(z3.string(), z3.unknown()),
|
|
56
|
-
options: z3.array(ApprovalOptionSchema).optional()
|
|
133
|
+
options: z3.array(ApprovalOptionSchema).optional(),
|
|
134
|
+
cursorPrompt: CursorPromptSchema.optional()
|
|
57
135
|
});
|
|
58
136
|
var ToolApprovePayloadSchema = z3.object({
|
|
59
137
|
toolId: IdSchema,
|
|
60
138
|
whitelistTool: z3.boolean().optional(),
|
|
61
|
-
optionId: IdSchema.optional()
|
|
139
|
+
optionId: IdSchema.optional(),
|
|
140
|
+
cursorAnswer: CursorAnswerSchema.optional()
|
|
62
141
|
});
|
|
63
142
|
var ToolDenyPayloadSchema = z3.object({
|
|
64
143
|
toolId: IdSchema,
|
|
65
144
|
reason: z3.string().optional(),
|
|
66
|
-
optionId: IdSchema.optional()
|
|
145
|
+
optionId: IdSchema.optional(),
|
|
146
|
+
cursorAnswer: CursorAnswerSchema.optional()
|
|
67
147
|
});
|
|
68
148
|
var ToolResultPayloadSchema = z3.object({
|
|
69
149
|
toolId: IdSchema,
|
|
@@ -75,7 +155,7 @@ var ToolResultPayloadSchema = z3.object({
|
|
|
75
155
|
import { z as z4 } from "zod";
|
|
76
156
|
|
|
77
157
|
// ../../packages/shared/dist/constants/enums.js
|
|
78
|
-
var providerValues = ["claude", "codex", "kimi"];
|
|
158
|
+
var providerValues = ["claude", "codex", "kimi", "cursor"];
|
|
79
159
|
var ptyOwnerValues = ["local-terminal", "proxy-hosted"];
|
|
80
160
|
var sessionModeValues = ["pty", "json"];
|
|
81
161
|
|
|
@@ -930,13 +1010,25 @@ var AgentCliAvailabilitySchema = z13.object({
|
|
|
930
1010
|
available: z13.boolean(),
|
|
931
1011
|
command: z13.string().optional(),
|
|
932
1012
|
error: z13.string().optional(),
|
|
933
|
-
suggestions: z13.array(z13.string()).optional()
|
|
1013
|
+
suggestions: z13.array(z13.string()).optional(),
|
|
1014
|
+
/** 开发机没有上报该 Agent 的状态(例如旧版 Proxy 不认识新增的 Agent)。 */
|
|
1015
|
+
notReported: z13.boolean().optional()
|
|
934
1016
|
});
|
|
1017
|
+
var AGENT_CLI_NOT_REPORTED_MESSAGE = "\u5F00\u53D1\u673A\u672A\u4E0A\u62A5\u8BE5 Agent \u7684\u72B6\u6001\uFF0C\u6682\u4E0D\u53EF\u7528";
|
|
1018
|
+
function notReportedAgentCli() {
|
|
1019
|
+
return { available: false, error: AGENT_CLI_NOT_REPORTED_MESSAGE, notReported: true };
|
|
1020
|
+
}
|
|
935
1021
|
var AgentCliStatusSchema = z13.object({
|
|
936
|
-
claude: AgentCliAvailabilitySchema,
|
|
937
|
-
codex: AgentCliAvailabilitySchema,
|
|
938
|
-
kimi: AgentCliAvailabilitySchema
|
|
939
|
-
|
|
1022
|
+
claude: AgentCliAvailabilitySchema.optional(),
|
|
1023
|
+
codex: AgentCliAvailabilitySchema.optional(),
|
|
1024
|
+
kimi: AgentCliAvailabilitySchema.optional(),
|
|
1025
|
+
cursor: AgentCliAvailabilitySchema.optional()
|
|
1026
|
+
}).transform((status) => ({
|
|
1027
|
+
claude: status.claude ?? notReportedAgentCli(),
|
|
1028
|
+
codex: status.codex ?? notReportedAgentCli(),
|
|
1029
|
+
kimi: status.kimi ?? notReportedAgentCli(),
|
|
1030
|
+
cursor: status.cursor ?? notReportedAgentCli()
|
|
1031
|
+
}));
|
|
940
1032
|
var TerminalShellSchema = z13.enum(["powershell", "cmd"]);
|
|
941
1033
|
var TerminalShellOptionSchema = z13.object({
|
|
942
1034
|
id: TerminalShellSchema,
|
|
@@ -2129,9 +2221,14 @@ var relayControlDefinitions = [
|
|
|
2129
2221
|
requestId: IdSchema,
|
|
2130
2222
|
toolName: z13.string(),
|
|
2131
2223
|
input: z13.record(z13.string(), z13.unknown()),
|
|
2132
|
-
options: z13.array(ApprovalOptionSchema).optional()
|
|
2224
|
+
options: z13.array(ApprovalOptionSchema).optional(),
|
|
2225
|
+
cursorPrompt: CursorPromptSchema.optional()
|
|
2133
2226
|
}))
|
|
2134
2227
|
}, "proxy_to_client"),
|
|
2228
|
+
control("cursor_session_ui", {
|
|
2229
|
+
sessionId: IdSchema,
|
|
2230
|
+
payload: CursorSessionUiSchema
|
|
2231
|
+
}, "proxy_to_client"),
|
|
2135
2232
|
// Voice Pilot speech summaries are produced by proxy-side Claude Code so it can read project context.
|
|
2136
2233
|
control("voice_summary_request", {
|
|
2137
2234
|
...RequestIdShape,
|
|
@@ -9042,4 +9139,4 @@ export {
|
|
|
9042
9139
|
parseRelayChaosFromEnv,
|
|
9043
9140
|
createRelayServer
|
|
9044
9141
|
};
|
|
9045
|
-
//# sourceMappingURL=chunk-
|
|
9142
|
+
//# sourceMappingURL=chunk-DJC4P5O3.js.map
|