@vitejs/devtools-vite-task 0.0.0-stage → 0.9.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/dist/devframe-Bqb3z48J.mjs +182 -0
- package/dist/devframe.d.mts +2 -0
- package/dist/devframe.mjs +1 -0
- package/dist/dirs.d.mts +1 -0
- package/dist/dirs.mjs +4 -0
- package/dist/index.d.mts +96 -0
- package/dist/index.mjs +3 -0
- package/dist/nitro.json +15 -0
- package/dist/public/200.html +1 -0
- package/dist/public/404.html +1 -0
- package/dist/public/_nuxt/B-6mOsud.js +1 -0
- package/dist/public/_nuxt/BD9RWFCr.js +1 -0
- package/dist/public/_nuxt/BmP83cE4.js +2 -0
- package/dist/public/_nuxt/DIE0R-sE.js +9 -0
- package/dist/public/_nuxt/DRtVqEVl.js +1 -0
- package/dist/public/_nuxt/DqYxEvp1.js +2 -0
- package/dist/public/_nuxt/builds/latest.json +1 -0
- package/dist/public/_nuxt/builds/meta/5b728156-91c3-48a9-abb1-ecc2bcb46dda.json +1 -0
- package/dist/public/_nuxt/entry.BEpUxchf.css +1 -0
- package/dist/public/_nuxt/error-404.XnEn7jPM.css +1 -0
- package/dist/public/_nuxt/error-500.C9m9hXLI.css +1 -0
- package/dist/public/_nuxt/pages.C_kMLYzW.css +1 -0
- package/dist/public/dot-grid-dark.png +0 -0
- package/dist/public/dot-grid-light.png +0 -0
- package/dist/public/favicon.svg +258 -0
- package/dist/public/index.html +1 -0
- package/dist/vite-CKMvREzs.mjs +87 -0
- package/dist/vite.d.mts +2 -0
- package/dist/vite.mjs +1 -0
- package/package.json +53 -4
- package/README.md +0 -3
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { clientPublicDir } from "./dirs.mjs";
|
|
2
|
+
import { existsSync, statSync } from "node:fs";
|
|
3
|
+
import { defineDevframe } from "devframe";
|
|
4
|
+
import { createDefineWrapperWithContext } from "devframe/rpc";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
import process from "node:process";
|
|
7
|
+
import { x } from "tinyexec";
|
|
8
|
+
import { defineDiagnostics } from "nostics";
|
|
9
|
+
// package.json
|
|
10
|
+
var name = "@vitejs/devtools-vite-task";
|
|
11
|
+
var version = "0.9.0";
|
|
12
|
+
var description = "DevTools for Vite Task";
|
|
13
|
+
var homepage = "https://github.com/vitejs/devtools#readme";
|
|
14
|
+
// src/shared/version.ts
|
|
15
|
+
const MIN_VITE_PLUS_VERSION = "1.6.0";
|
|
16
|
+
/** Compare a parsed CLI version against the minimum stable release. */
|
|
17
|
+
function isVitePlusVersionSupported(version) {
|
|
18
|
+
const [release, prerelease] = version.split("-");
|
|
19
|
+
const parts = release.split(".").map(Number);
|
|
20
|
+
for (const [index, minimum] of MIN_VITE_PLUS_VERSION.split(".").map(Number).entries()) if (parts[index] !== minimum) return parts[index] > minimum;
|
|
21
|
+
return prerelease === void 0;
|
|
22
|
+
}
|
|
23
|
+
// src/node/diagnostics.ts
|
|
24
|
+
const diagnostics = /* #__PURE__ */ defineDiagnostics({
|
|
25
|
+
docsBase: "https://devtools.vite.dev/errors",
|
|
26
|
+
codes: {
|
|
27
|
+
VTKDT0001: {
|
|
28
|
+
why: (p) => `Local Vite Plus executable not found at "${p.executable}".`,
|
|
29
|
+
fix: `Install vite-plus ${MIN_VITE_PLUS_VERSION} or newer in the workspace root.`
|
|
30
|
+
},
|
|
31
|
+
VTKDT0002: {
|
|
32
|
+
why: (p) => `Vite Plus ${p.version} does not meet the required version >=${MIN_VITE_PLUS_VERSION}.`,
|
|
33
|
+
fix: `Update the workspace vite-plus dependency to ${MIN_VITE_PLUS_VERSION} or newer.`
|
|
34
|
+
},
|
|
35
|
+
VTKDT0003: {
|
|
36
|
+
why: (p) => `Failed to run "${p.command}": ${p.reason}`,
|
|
37
|
+
fix: "Check the local Vite Plus installation and workspace task configuration."
|
|
38
|
+
},
|
|
39
|
+
VTKDT0004: {
|
|
40
|
+
why: (p) => `Vite Plus returned invalid or unsupported JSON for "${p.command}".`,
|
|
41
|
+
fix: "Check the Vite Plus version and ensure workspace configuration does not print to stdout."
|
|
42
|
+
},
|
|
43
|
+
VTKDT0005: {
|
|
44
|
+
why: (p) => `Invalid task name "${p.task}".`,
|
|
45
|
+
fix: "Select a non-empty task name from the task graph that does not start with a dash."
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
// src/node/tasks.ts
|
|
50
|
+
const versionChecks = /* @__PURE__ */ new Map();
|
|
51
|
+
const taskSelectorsByWorkspace = /* @__PURE__ */ new Map();
|
|
52
|
+
async function execute(workspaceRoot, executable, args) {
|
|
53
|
+
const command = `vp ${args.join(" ")}`;
|
|
54
|
+
try {
|
|
55
|
+
return (await x(executable, args, {
|
|
56
|
+
nodeOptions: { cwd: workspaceRoot },
|
|
57
|
+
throwOnError: true
|
|
58
|
+
})).stdout;
|
|
59
|
+
} catch (cause) {
|
|
60
|
+
throw diagnostics.VTKDT0003({
|
|
61
|
+
command,
|
|
62
|
+
reason: String(cause),
|
|
63
|
+
cause
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async function checkVersion(workspaceRoot, executable) {
|
|
68
|
+
const output = await execute(workspaceRoot, executable, ["--version"]);
|
|
69
|
+
const match = /^vp v?(\d+\.\d+\.\d+(?:-[\w.-]+)?)(?:\+\S+)?\s*$/m.exec(output);
|
|
70
|
+
if (!match) throw diagnostics.VTKDT0003({
|
|
71
|
+
command: "vp --version",
|
|
72
|
+
reason: `Unrecognized version output: ${output.trim()}`
|
|
73
|
+
});
|
|
74
|
+
if (!isVitePlusVersionSupported(match[1])) throw diagnostics.VTKDT0002({ version: match[0].trim() });
|
|
75
|
+
}
|
|
76
|
+
function isRecord(value) {
|
|
77
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
78
|
+
}
|
|
79
|
+
function resolveVpExecutable(workspaceRoot) {
|
|
80
|
+
const executable = join(workspaceRoot, "node_modules", ".bin", process.platform === "win32" ? "vp.cmd" : "vp");
|
|
81
|
+
const stat = statSync(executable, { throwIfNoEntry: false });
|
|
82
|
+
if (!stat) throw diagnostics.VTKDT0001({ executable });
|
|
83
|
+
return {
|
|
84
|
+
executable,
|
|
85
|
+
mtimeMs: stat.mtimeMs
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
async function runJson(workspaceRoot, args, format) {
|
|
89
|
+
const { executable, mtimeMs } = resolveVpExecutable(workspaceRoot);
|
|
90
|
+
if (versionChecks.get(executable)?.mtimeMs !== mtimeMs) {
|
|
91
|
+
const check = checkVersion(workspaceRoot, executable).catch((error) => {
|
|
92
|
+
if (versionChecks.get(executable)?.check === check) versionChecks.delete(executable);
|
|
93
|
+
throw error;
|
|
94
|
+
});
|
|
95
|
+
versionChecks.set(executable, {
|
|
96
|
+
mtimeMs,
|
|
97
|
+
check
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
await versionChecks.get(executable).check;
|
|
101
|
+
const json = await execute(workspaceRoot, executable, args);
|
|
102
|
+
let value;
|
|
103
|
+
try {
|
|
104
|
+
value = JSON.parse(json);
|
|
105
|
+
} catch (cause) {
|
|
106
|
+
throw diagnostics.VTKDT0004({
|
|
107
|
+
command: `vp ${args.join(" ")}`,
|
|
108
|
+
cause
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
if (!isRecord(value) || value.version !== 1 || typeof value.$schema !== "string" || typeof value.workspaceRoot !== "string" || !(format === "graph" ? isRecord(value.tasks) && isRecord(value.packages) : isRecord(value.plan))) throw diagnostics.VTKDT0004({ command: `vp ${args.join(" ")}` });
|
|
112
|
+
return value;
|
|
113
|
+
}
|
|
114
|
+
async function loadTaskGraph(workspaceRoot) {
|
|
115
|
+
const graph = await runJson(workspaceRoot, ["run", "--json"], "graph");
|
|
116
|
+
const taskSelectors = /* @__PURE__ */ new Map();
|
|
117
|
+
for (const [id, task] of Object.entries(graph.tasks)) {
|
|
118
|
+
const packageName = graph.packages[task.package]?.name;
|
|
119
|
+
taskSelectors.set(id, task.package === "." ? [task.name] : packageName ? [`${packageName}#${task.name}`] : [
|
|
120
|
+
"--filter",
|
|
121
|
+
`./${task.package}`,
|
|
122
|
+
"--fail-if-no-match",
|
|
123
|
+
task.name
|
|
124
|
+
]);
|
|
125
|
+
}
|
|
126
|
+
taskSelectorsByWorkspace.set(workspaceRoot, taskSelectors);
|
|
127
|
+
return graph;
|
|
128
|
+
}
|
|
129
|
+
async function resolveTaskSelector(workspaceRoot, task) {
|
|
130
|
+
if (typeof task !== "string" || !task.trim() || task.startsWith("-")) throw diagnostics.VTKDT0005({ task: String(task) });
|
|
131
|
+
if (!taskSelectorsByWorkspace.get(workspaceRoot)?.has(task)) await loadTaskGraph(workspaceRoot);
|
|
132
|
+
const selector = taskSelectorsByWorkspace.get(workspaceRoot)?.get(task);
|
|
133
|
+
if (!selector) throw diagnostics.VTKDT0005({ task });
|
|
134
|
+
return selector;
|
|
135
|
+
}
|
|
136
|
+
async function loadRunPlan(workspaceRoot, options) {
|
|
137
|
+
const selector = await resolveTaskSelector(workspaceRoot, options.task);
|
|
138
|
+
return runJson(workspaceRoot, [
|
|
139
|
+
"run",
|
|
140
|
+
"--dry-run",
|
|
141
|
+
"--json",
|
|
142
|
+
...options.verbose ? ["-vv"] : [],
|
|
143
|
+
...selector
|
|
144
|
+
], "plan");
|
|
145
|
+
}
|
|
146
|
+
// src/node/rpc/index.ts
|
|
147
|
+
const defineRpcFunction = createDefineWrapperWithContext();
|
|
148
|
+
function handleVersionError(error) {
|
|
149
|
+
if (error instanceof Error && error.name === "VTKDT0002") return "unsupported-version";
|
|
150
|
+
throw error;
|
|
151
|
+
}
|
|
152
|
+
const rpcFunctions = [defineRpcFunction({
|
|
153
|
+
name: "vite-task:get-graph",
|
|
154
|
+
type: "query",
|
|
155
|
+
cacheable: false,
|
|
156
|
+
jsonSerializable: true,
|
|
157
|
+
setup: (ctx) => ({ handler: () => loadTaskGraph(ctx.workspaceRoot).catch(handleVersionError) })
|
|
158
|
+
}), defineRpcFunction({
|
|
159
|
+
name: "vite-task:get-plan",
|
|
160
|
+
type: "query",
|
|
161
|
+
cacheable: false,
|
|
162
|
+
jsonSerializable: true,
|
|
163
|
+
setup: (ctx) => ({ handler: (options) => loadRunPlan(ctx.workspaceRoot, options).catch(handleVersionError) })
|
|
164
|
+
})];
|
|
165
|
+
// src/node/devframe.ts
|
|
166
|
+
const VITE_TASK_DEVTOOLS_BASE = "/__devtools-vite-task/";
|
|
167
|
+
const viteTaskDevframe = defineDevframe({
|
|
168
|
+
id: "vite-task",
|
|
169
|
+
name: "Vite Task",
|
|
170
|
+
version,
|
|
171
|
+
packageName: name,
|
|
172
|
+
importMetaUrl: import.meta.url,
|
|
173
|
+
homepage,
|
|
174
|
+
description,
|
|
175
|
+
icon: `${VITE_TASK_DEVTOOLS_BASE}favicon.svg`,
|
|
176
|
+
basePath: VITE_TASK_DEVTOOLS_BASE,
|
|
177
|
+
clientAssets: existsSync(clientPublicDir) ? clientPublicDir : void 0,
|
|
178
|
+
setup(ctx) {
|
|
179
|
+
for (const fn of rpcFunctions) ctx.rpc.register(fn);
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
export { resolveVpExecutable as i, viteTaskDevframe as n, resolveTaskSelector as r, VITE_TASK_DEVTOOLS_BASE as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as VITE_TASK_DEVTOOLS_BASE, n as viteTaskDevframe } from "./devframe-Bqb3z48J.mjs";
|
package/dist/dirs.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const clientPublicDir: string;
|
package/dist/dirs.mjs
ADDED
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { VITE_TASK_DEVTOOLS_BASE, viteTaskDevframe } from "./devframe.mjs";
|
|
2
|
+
import { DevToolsViteTaskUI } from "./vite.mjs";
|
|
3
|
+
/** JSON formats from voidzero-dev/vite-task revision cb1ea8d214b26a0f3ca2b2ef3b6bc471b18ffacb. */
|
|
4
|
+
interface TaskPackage {
|
|
5
|
+
name?: string;
|
|
6
|
+
dependencies?: string[];
|
|
7
|
+
devDependencies?: string[];
|
|
8
|
+
peerDependencies?: string[];
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
interface GraphTask {
|
|
12
|
+
package: string;
|
|
13
|
+
name: string;
|
|
14
|
+
command: string | string[];
|
|
15
|
+
cwd?: string;
|
|
16
|
+
dependsOn?: string[];
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
interface TaskGraph {
|
|
20
|
+
$schema: string;
|
|
21
|
+
version: 1;
|
|
22
|
+
workspaceRoot: string;
|
|
23
|
+
packages: Record<string, TaskPackage>;
|
|
24
|
+
tasks: Record<string, GraphTask>;
|
|
25
|
+
[key: string]: unknown;
|
|
26
|
+
}
|
|
27
|
+
type CacheStatus = 'hit' | 'changed' | 'unknown' | 'noBaseline' | 'error' | 'disabled' | (string & {});
|
|
28
|
+
interface PathFingerprint {
|
|
29
|
+
type: 'file' | 'dir' | 'missing' | (string & {});
|
|
30
|
+
hash?: string;
|
|
31
|
+
entries?: string[];
|
|
32
|
+
mayBeMissing?: boolean;
|
|
33
|
+
[key: string]: unknown;
|
|
34
|
+
}
|
|
35
|
+
interface CacheBaseline {
|
|
36
|
+
durationMs: number;
|
|
37
|
+
fingerprint?: {
|
|
38
|
+
env?: string[];
|
|
39
|
+
inputs?: Record<string, PathFingerprint>;
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
};
|
|
42
|
+
outputs?: string[] | 'notDownloaded' | (string & {});
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
}
|
|
45
|
+
interface CacheChange {
|
|
46
|
+
kind: 'program' | 'args' | 'cwd' | 'config' | 'env' | 'file' | (string & {});
|
|
47
|
+
from?: string | string[];
|
|
48
|
+
to?: string | string[];
|
|
49
|
+
setting?: string;
|
|
50
|
+
name?: string;
|
|
51
|
+
path?: string;
|
|
52
|
+
change?: 'added' | 'removed' | 'changed' | (string & {});
|
|
53
|
+
[key: string]: unknown;
|
|
54
|
+
}
|
|
55
|
+
interface StepCache {
|
|
56
|
+
status: CacheStatus;
|
|
57
|
+
baseline?: CacheBaseline;
|
|
58
|
+
changes?: CacheChange[];
|
|
59
|
+
changesPartial?: boolean;
|
|
60
|
+
message?: string;
|
|
61
|
+
[key: string]: unknown;
|
|
62
|
+
}
|
|
63
|
+
interface CommandStep {
|
|
64
|
+
program: string;
|
|
65
|
+
args?: string[];
|
|
66
|
+
cwd?: string;
|
|
67
|
+
hook?: string;
|
|
68
|
+
cache?: StepCache;
|
|
69
|
+
[key: string]: unknown;
|
|
70
|
+
}
|
|
71
|
+
interface NestedStep {
|
|
72
|
+
expandedFrom: string;
|
|
73
|
+
plan: Record<string, PlanTask>;
|
|
74
|
+
[key: string]: unknown;
|
|
75
|
+
}
|
|
76
|
+
type PlanStep = CommandStep | NestedStep;
|
|
77
|
+
interface PlanTask {
|
|
78
|
+
package: string;
|
|
79
|
+
name: string;
|
|
80
|
+
dependsOn?: string[];
|
|
81
|
+
steps: PlanStep[];
|
|
82
|
+
[key: string]: unknown;
|
|
83
|
+
}
|
|
84
|
+
interface RunPlan {
|
|
85
|
+
$schema: string;
|
|
86
|
+
version: 1;
|
|
87
|
+
workspaceRoot: string;
|
|
88
|
+
plan: Record<string, PlanTask>;
|
|
89
|
+
[key: string]: unknown;
|
|
90
|
+
}
|
|
91
|
+
interface GetPlanOptions {
|
|
92
|
+
/** Exact key from TaskGraph.tasks, e.g. `packages/lib#build`. */
|
|
93
|
+
task: string;
|
|
94
|
+
verbose: boolean;
|
|
95
|
+
}
|
|
96
|
+
export { type CacheBaseline, type CacheChange, type CacheStatus, type CommandStep, DevToolsViteTaskUI, type GetPlanOptions, type GraphTask, type NestedStep, type PathFingerprint, type PlanStep, type PlanTask, type RunPlan, type StepCache, type TaskGraph, type TaskPackage, VITE_TASK_DEVTOOLS_BASE, viteTaskDevframe };
|
package/dist/index.mjs
ADDED
package/dist/nitro.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!DOCTYPE html><html lang="en" class="bg-dots"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Vite Task DevTools</title><script type="importmap">{"imports":{"#entry":"/__devtools-vite-task/_nuxt/DIE0R-sE.js"}}</script><link rel="stylesheet" href="/__devtools-vite-task/_nuxt/entry.BEpUxchf.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__devtools-vite-task/_nuxt/DIE0R-sE.js"><script type="module" src="/__devtools-vite-task/_nuxt/DIE0R-sE.js" crossorigin></script><meta name="description" content="DevTools for Vite Task"><link rel="icon" type="image/svg+xml" href="/favicon.svg"><template data-nuxt-prefetch><link rel="prefetch" as="script" crossorigin href="/__devtools-vite-task/_nuxt/BD9RWFCr.js"></template></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__devtools-vite-task/",buildId:"5b728156-91c3-48a9-abb1-ecc2bcb46dda",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1796192413834,false]</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!DOCTYPE html><html lang="en" class="bg-dots"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Vite Task DevTools</title><script type="importmap">{"imports":{"#entry":"/__devtools-vite-task/_nuxt/DIE0R-sE.js"}}</script><link rel="stylesheet" href="/__devtools-vite-task/_nuxt/entry.BEpUxchf.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__devtools-vite-task/_nuxt/DIE0R-sE.js"><script type="module" src="/__devtools-vite-task/_nuxt/DIE0R-sE.js" crossorigin></script><meta name="description" content="DevTools for Vite Task"><link rel="icon" type="image/svg+xml" href="/favicon.svg"><template data-nuxt-prefetch><link rel="prefetch" as="script" crossorigin href="/__devtools-vite-task/_nuxt/BD9RWFCr.js"></template></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__devtools-vite-task/",buildId:"5b728156-91c3-48a9-abb1-ecc2bcb46dda",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1796192413835,false]</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{L as e,P as t,X as n,i as r,vt as i}from"#entry";import{t as a}from"./BmP83cE4.js";var o={class:`antialiased bg-white dark:bg-neutral-950 dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-neutral-950 tracking-wide`},s={class:`max-w-520px text-center`},c=[`textContent`],l=[`textContent`],u=[`textContent`],d=a({__name:`error-500`,props:{appName:{type:String,default:`Nuxt`},status:{type:Number,default:500},statusText:{type:String,default:`Internal server error`},description:{type:String,default:`This page is temporarily unavailable.`},refresh:{type:String,default:`Refresh this page`}},setup(a){let d=a;return r({title:`${d.status} - ${d.statusText} | ${d.appName}`,script:[],style:[{innerHTML:`*,:after,:before{box-sizing:border-box;border-style:solid;border-width:0;border-color:var(--un-default-border-color,#e5e7eb);--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 #0000;--un-ring-shadow:0 0 #0000;--un-shadow-inset: ;--un-shadow:0 0 #0000;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:#93c5fd80;--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }:after,:before{--un-content:""}html{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}h1,h2,p{margin:0}`}]}),(r,d)=>(n(),e(`div`,o,[t(`div`,s,[t(`h1`,{class:`font-medium leading-none mb-4 sm:text-[72px] tabular-nums text-[56px]`,textContent:i(a.status)},null,8,c),t(`h2`,{class:`font-semibold mb-2 sm:text-3xl text-2xl`,textContent:i(a.statusText)},null,8,l),t(`p`,{class:`mb-4 px-2 text-md text-neutral-500`,textContent:i(a.description)},null,8,u)])]))}},[[`__scopeId`,`data-v-a7ccd744`]]);export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"#entry";var t=Symbol.for(`devframe:browser-agent-registry`),{tools:n,listeners:r}=globalThis[t]??={tools:new Map,listeners:new Set};function i(){return[...n.values()]}function a(e){return r.add(e),()=>r.delete(e)}var o=`devframe:client-id`,s;function c(t=globalThis.window){try{let n=t?.sessionStorage;if(n){let t=n.getItem(o);return t||(t=e(),n.setItem(o,t)),t}}catch{}return s??=e(),s}function l(){let e=typeof document>`u`?void 0:document;return{url:e?.location?.href??``,title:e?.title??``,visible:!e||e.visibilityState===`visible`,focused:e?.hasFocus()??!0}}function u(e){e.client.register({name:`devframe:agent:invoke-client-tool`,type:`action`,jsonSerializable:!0,handler:async(e,t)=>{let n=i().find(t=>t.id===e);if(!n)throw Error(`[devframe/agent] browser tool "${e}" not found`);return await n.invoke(t)}});let t=!1,n=!1,r=0,o=()=>{t||n||(t=!0,queueMicrotask(async()=>{if(t=!1,n)return;let a=i().map(({invoke:e,...t})=>t);(a.length!==0||r!==0)&&(r=a.length,await e.callOptional(`devframe:agent:sync-client-tools`,c(),a,l()).catch(()=>{}))}))},s=a(o),u=e.events.on(`connection:status`,e=>{e===`connected`&&o()}),d=typeof window>`u`?void 0:window;return d?.addEventListener(`focus`,o),d?.addEventListener(`blur`,o),d?.document.addEventListener(`visibilitychange`,o),o(),()=>{n=!0,s(),u(),d?.removeEventListener(`focus`,o),d?.removeEventListener(`blur`,o),d?.document.removeEventListener(`visibilitychange`,o)}}export{u as setupBrowserAgentRpcBridge};
|