@nyte-ai/plugin 0.0.0-stage → 0.0.19
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/LICENSE +21 -0
- package/THIRD-PARTY-NOTICES.md +866 -0
- package/dist/chunks/billing-0y7dfkp2.js +146 -0
- package/dist/chunks/billing-2v3g7rd9.js +190 -0
- package/dist/chunks/billing-3j77ss7y.js +86 -0
- package/dist/chunks/billing-3scqmkzb.js +559 -0
- package/dist/chunks/billing-4vz9pxyx.js +22 -0
- package/dist/chunks/billing-6z2kgtyt.js +51 -0
- package/dist/chunks/billing-8rjk35gr.js +444 -0
- package/dist/chunks/billing-9nn3yp18.js +176 -0
- package/dist/chunks/billing-9qc0eqh4.js +174 -0
- package/dist/chunks/billing-a9vqn66p.js +351 -0
- package/dist/chunks/billing-bv5zr32b.js +369 -0
- package/dist/chunks/billing-cy1rg619.js +302 -0
- package/dist/chunks/billing-ejx2hv52.js +323 -0
- package/dist/chunks/billing-h13r0byk.js +80 -0
- package/dist/chunks/billing-hg64tqf1.js +97 -0
- package/dist/chunks/billing-j643d12p.js +197 -0
- package/dist/chunks/billing-kn3d30b4.js +276 -0
- package/dist/chunks/billing-mvc33pv6.js +36 -0
- package/dist/chunks/billing-s4rrspsk.js +7 -0
- package/dist/chunks/billing-svrhh5a5.js +307 -0
- package/dist/chunks/billing-sxc70w72.js +161 -0
- package/dist/chunks/billing-t1qrxe16.js +41 -0
- package/dist/chunks/billing-tm34gm2p.js +528 -0
- package/dist/chunks/billing-tzr3cebf.js +20 -0
- package/dist/chunks/billing-v3hg5rc7.js +373 -0
- package/dist/chunks/billing-wmcbg6fw.js +52 -0
- package/dist/chunks/billing-ye3wk5r3.js +205 -0
- package/dist/chunks/billing-zfpm2rt0.js +29 -0
- package/dist/examples/claude-code/LICENSE +21 -0
- package/dist/examples/claude-code/billing.d.ts +7 -0
- package/dist/examples/claude-code/billing.js +11 -0
- package/dist/examples/claude-code/claude-cli.d.ts +35 -0
- package/dist/examples/claude-code/claude-cli.js +15 -0
- package/dist/examples/claude-code/env.d.ts +1 -0
- package/dist/examples/claude-code/env.js +6 -0
- package/dist/examples/claude-code/index.d.ts +24 -0
- package/dist/examples/claude-code/index.js +149 -0
- package/dist/examples/claude-code/inert-mcp.d.ts +1 -0
- package/dist/examples/claude-code/inert-mcp.js +6 -0
- package/dist/examples/claude-code/model-catalog.d.ts +27 -0
- package/dist/examples/claude-code/model-catalog.js +12 -0
- package/dist/examples/claude-code/process.d.ts +22 -0
- package/dist/examples/claude-code/process.js +25 -0
- package/dist/examples/claude-code/replay.d.ts +4 -0
- package/dist/examples/claude-code/replay.js +11 -0
- package/dist/examples/claude-code/stream.d.ts +3 -0
- package/dist/examples/claude-code/stream.js +16 -0
- package/dist/examples/claude-code/transcript.d.ts +83 -0
- package/dist/examples/claude-code/transcript.js +23 -0
- package/dist/examples/claude-code/turn-relay.d.ts +48 -0
- package/dist/examples/claude-code/turn-relay.js +9 -0
- package/dist/examples/claude-code/wire.d.ts +372 -0
- package/dist/examples/claude-code/wire.js +18 -0
- package/dist/src/acp/connection.d.ts +24 -0
- package/dist/src/acp/connection.js +8 -0
- package/dist/src/acp/index.d.ts +54 -0
- package/dist/src/acp/index.js +1005 -0
- package/dist/src/acp/registry.d.ts +18 -0
- package/dist/src/acp/registry.js +9 -0
- package/dist/src/acp/thread.d.ts +46 -0
- package/dist/src/acp/thread.js +7 -0
- package/dist/src/acp/transcript.d.ts +8 -0
- package/dist/src/acp/transcript.js +11 -0
- package/dist/src/acp/translate.d.ts +33 -0
- package/dist/src/acp/translate.js +20 -0
- package/dist/src/approvals/approvals.d.ts +189 -0
- package/dist/src/approvals/approvals.js +143 -0
- package/dist/src/approvals/schema.d.ts +169 -0
- package/dist/src/approvals/schema.js +18 -0
- package/dist/src/bash-description.d.ts +30 -0
- package/dist/src/bash-description.js +18 -0
- package/dist/src/browser-tools.d.ts +25 -0
- package/dist/src/browser-tools.js +246 -0
- package/dist/src/canvas/canvas-compile.d.ts +48 -0
- package/dist/src/canvas/canvas-compile.js +8 -0
- package/dist/src/canvas/canvas-libraries.d.ts +32 -0
- package/dist/src/canvas/canvas-libraries.js +6 -0
- package/dist/src/canvas/canvas-preview.d.ts +107 -0
- package/dist/src/canvas/canvas-preview.js +12 -0
- package/dist/src/canvas/canvas-protocol.d.ts +184 -0
- package/dist/src/canvas/canvas-protocol.js +75 -0
- package/dist/src/canvas/canvas.d.ts +50 -0
- package/dist/src/canvas/canvas.js +221 -0
- package/dist/src/canvas/schema.d.ts +47 -0
- package/dist/src/canvas/schema.js +8 -0
- package/dist/src/claude-code-sdk/index.d.ts +35 -0
- package/dist/src/claude-code-sdk/index.js +379 -0
- package/dist/src/claude-code-sdk/session.d.ts +50 -0
- package/dist/src/claude-code-sdk/session.js +7 -0
- package/dist/src/claude-code-sdk/transcript.d.ts +19 -0
- package/dist/src/claude-code-sdk/transcript.js +15 -0
- package/dist/src/claude-code-sdk/translate.d.ts +18 -0
- package/dist/src/claude-code-sdk/translate.js +20 -0
- package/dist/src/client/mount.d.ts +44 -0
- package/dist/src/client/mount.js +252 -0
- package/dist/src/client/notifications.d.ts +36 -0
- package/dist/src/client/notifications.js +24 -0
- package/dist/src/client/presentation.d.ts +362 -0
- package/dist/src/client/presentation.js +391 -0
- package/dist/src/client/transcript-tui.d.ts +23 -0
- package/dist/src/client/transcript-tui.js +20 -0
- package/dist/src/client/transcript.d.ts +23 -0
- package/dist/src/client/transcript.js +51 -0
- package/dist/src/client.d.ts +53 -0
- package/dist/src/client.js +22 -0
- package/dist/src/codemode-runtime.d.ts +11 -0
- package/dist/src/codemode-runtime.js +10 -0
- package/dist/src/codemode-worker.d.ts +1 -0
- package/dist/src/codemode-worker.js +2 -0
- package/dist/src/codemode.d.ts +21 -0
- package/dist/src/codemode.js +170 -0
- package/dist/src/core.d.ts +43 -0
- package/dist/src/core.js +11 -0
- package/dist/src/find-on-path.d.ts +4 -0
- package/dist/src/find-on-path.js +8 -0
- package/dist/src/openai-astra-context.d.ts +23 -0
- package/dist/src/openai-astra-context.js +14 -0
- package/dist/src/openai-compaction.d.ts +15 -0
- package/dist/src/openai-compaction.js +55 -0
- package/dist/src/question/client/questions-tui.d.ts +9 -0
- package/dist/src/question/client/questions-tui.js +19 -0
- package/dist/src/question/client/questions.d.ts +9 -0
- package/dist/src/question/client/questions.js +160 -0
- package/dist/src/question/question.d.ts +63 -0
- package/dist/src/question/question.js +9 -0
- package/dist/src/question/schema.d.ts +101 -0
- package/dist/src/question/schema.js +14 -0
- package/dist/src/rename.d.ts +79 -0
- package/dist/src/rename.js +91 -0
- package/dist/src/telemetry.d.ts +36 -0
- package/dist/src/telemetry.js +84 -0
- package/dist/src/web-search.d.ts +78 -0
- package/dist/src/web-search.js +219 -0
- package/package.json +190 -3
- package/README.md +0 -3
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CANVAS_RUNTIME2,
|
|
3
|
+
CANVAS_MAX_HEIGHT2,
|
|
4
|
+
initializeResult2,
|
|
5
|
+
renderNotification2,
|
|
6
|
+
clampCanvasHeight2
|
|
7
|
+
} from "./billing-bv5zr32b.js";
|
|
8
|
+
|
|
9
|
+
// src/canvas/canvas-preview.ts
|
|
10
|
+
import { Type } from "typebox";
|
|
11
|
+
import { Value } from "typebox/value";
|
|
12
|
+
var CANVAS_PREVIEW_WIDTHS2 = { chat: 808, phone: 358 };
|
|
13
|
+
var WIDTH_NAMES = { chat: "the chat column", phone: "a phone" };
|
|
14
|
+
var SETTLE_TIMEOUT_MS = 8000;
|
|
15
|
+
var SETTLE_QUIET_MS = 400;
|
|
16
|
+
var CONSOLE_KEPT = 40;
|
|
17
|
+
var settled = Type.Object({
|
|
18
|
+
height: Type.Number(),
|
|
19
|
+
errors: Type.Array(Type.Object({
|
|
20
|
+
phase: Type.Union([Type.Literal("load"), Type.Literal("render")]),
|
|
21
|
+
message: Type.String(),
|
|
22
|
+
stack: Type.Optional(Type.String())
|
|
23
|
+
})),
|
|
24
|
+
console: Type.Array(Type.Object({ level: Type.String(), text: Type.String() }))
|
|
25
|
+
});
|
|
26
|
+
function hostContext(theme) {
|
|
27
|
+
return {
|
|
28
|
+
theme,
|
|
29
|
+
styles: { variables: { "--nyte-custom-hue": "250", "--nyte-custom-chroma-scale": "0" } },
|
|
30
|
+
displayMode: "inline",
|
|
31
|
+
platform: "desktop",
|
|
32
|
+
deviceCapabilities: { touch: false, hover: true }
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function installHarness(setup) {
|
|
36
|
+
if ("__nytePreview" in globalThis)
|
|
37
|
+
return true;
|
|
38
|
+
if (!("__nyteCanvas" in globalThis))
|
|
39
|
+
return false;
|
|
40
|
+
const state = {
|
|
41
|
+
height: 0,
|
|
42
|
+
changed: 0,
|
|
43
|
+
errors: new Array,
|
|
44
|
+
console: new Array
|
|
45
|
+
};
|
|
46
|
+
const text = (value) => {
|
|
47
|
+
if (typeof value === "string")
|
|
48
|
+
return value;
|
|
49
|
+
if (value instanceof Error)
|
|
50
|
+
return value.stack ?? String(value);
|
|
51
|
+
try {
|
|
52
|
+
return JSON.stringify(value) ?? String(value);
|
|
53
|
+
} catch {
|
|
54
|
+
return String(value);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
for (const level of ["log", "info", "warn", "error", "debug"]) {
|
|
58
|
+
const original = console[level].bind(console);
|
|
59
|
+
console[level] = (...values) => {
|
|
60
|
+
if (state.console.length < setup.consoleKept)
|
|
61
|
+
state.console.push({ level, text: values.map(text).join(" ").slice(0, 2000) });
|
|
62
|
+
original(...values);
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
this.addEventListener("message", (event) => {
|
|
66
|
+
const data = event.data;
|
|
67
|
+
if (typeof data !== "object" || data === null || !("method" in data))
|
|
68
|
+
return;
|
|
69
|
+
const params = "params" in data && typeof data.params === "object" ? data.params : null;
|
|
70
|
+
if (data.method === "ui/notifications/initialized")
|
|
71
|
+
this.postMessage(setup.render, "*");
|
|
72
|
+
if (data.method === "ui/notifications/size-changed" && params !== null && "height" in params && typeof params.height === "number") {
|
|
73
|
+
state.height = params.height;
|
|
74
|
+
state.changed = performance.now();
|
|
75
|
+
}
|
|
76
|
+
if (data.method === "notifications/message" && params !== null && "data" in params)
|
|
77
|
+
state.errors.push(params.data);
|
|
78
|
+
});
|
|
79
|
+
Object.defineProperty(globalThis, "__nytePreview", {
|
|
80
|
+
value: {
|
|
81
|
+
settle: () => new Promise((resolve) => {
|
|
82
|
+
const since = performance.now();
|
|
83
|
+
const check = () => {
|
|
84
|
+
const now = performance.now();
|
|
85
|
+
const quiet = now - Math.max(state.changed, since) > setup.quietMs;
|
|
86
|
+
if (quiet && (state.height > 0 || state.errors.length > 0) || now - since > setup.timeoutMs)
|
|
87
|
+
resolve({ height: state.height, errors: state.errors, console: state.console });
|
|
88
|
+
else
|
|
89
|
+
setTimeout(check, 50);
|
|
90
|
+
};
|
|
91
|
+
check();
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
this.postMessage(setup.initialize, "*");
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
function harness(request) {
|
|
99
|
+
const setup = {
|
|
100
|
+
initialize: initializeResult2(1, { name: "nyte-preview", version: String(CANVAS_RUNTIME2) }, hostContext(request.theme)),
|
|
101
|
+
render: renderNotification2(request.module),
|
|
102
|
+
quietMs: SETTLE_QUIET_MS,
|
|
103
|
+
timeoutMs: SETTLE_TIMEOUT_MS,
|
|
104
|
+
consoleKept: CONSOLE_KEPT
|
|
105
|
+
};
|
|
106
|
+
return `(${installHarness.toString()}).call(globalThis, ${JSON.stringify(setup)})`;
|
|
107
|
+
}
|
|
108
|
+
async function settle(page) {
|
|
109
|
+
const answer = await page.evaluate("globalThis.__nytePreview.settle()");
|
|
110
|
+
if (!Value.Check(settled, answer))
|
|
111
|
+
throw new Error("The canvas preview harness answered something unreadable.");
|
|
112
|
+
return answer;
|
|
113
|
+
}
|
|
114
|
+
async function runCanvasPreview2(page, request) {
|
|
115
|
+
const { chat, phone } = CANVAS_PREVIEW_WIDTHS2;
|
|
116
|
+
await page.resize(chat, 900);
|
|
117
|
+
const install = harness(request);
|
|
118
|
+
let attempts = 0;
|
|
119
|
+
while (await page.evaluate(install) !== true) {
|
|
120
|
+
attempts += 1;
|
|
121
|
+
if (attempts > 50)
|
|
122
|
+
throw new Error("The canvas shell did not start in the preview.");
|
|
123
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
124
|
+
}
|
|
125
|
+
const wide = await settle(page);
|
|
126
|
+
await page.resize(chat, clampCanvasHeight2(wide.height > 0 ? wide.height : 240));
|
|
127
|
+
const narrow = await settle(page);
|
|
128
|
+
const png = await page.capture();
|
|
129
|
+
await page.resize(phone, 900);
|
|
130
|
+
const last = await settle(page);
|
|
131
|
+
return {
|
|
132
|
+
png,
|
|
133
|
+
heights: { chat: narrow.height, phone: last.height },
|
|
134
|
+
errors: last.errors.map((error) => ({ ...error, stack: error.stack ?? null })),
|
|
135
|
+
console: last.console
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function describeCanvasPreview2(report) {
|
|
139
|
+
const heights = ["chat", "phone"].map((width) => {
|
|
140
|
+
const height = report.heights[width];
|
|
141
|
+
const scrolls = height > CANVAS_MAX_HEIGHT2 ? `, so it scrolls past ${CANVAS_MAX_HEIGHT2} px` : "";
|
|
142
|
+
return `At ${CANVAS_PREVIEW_WIDTHS2[width]} px wide (${WIDTH_NAMES[width]}) it is ${height} px tall${scrolls}.`;
|
|
143
|
+
});
|
|
144
|
+
const errors = report.errors.length === 0 ? ["No errors."] : [
|
|
145
|
+
`Errors (${report.errors.length}):`,
|
|
146
|
+
...report.errors.map((error) => `- ${error.phase}: ${error.message}`)
|
|
147
|
+
];
|
|
148
|
+
const logs = report.console.length === 0 ? [] : [
|
|
149
|
+
`Console (${report.console.length}):`,
|
|
150
|
+
...report.console.map((entry) => `- [${entry.level}] ${entry.text}`)
|
|
151
|
+
];
|
|
152
|
+
return [
|
|
153
|
+
"Preview only; the user has not seen it. The screenshot is the chat-column render.",
|
|
154
|
+
...heights,
|
|
155
|
+
...errors,
|
|
156
|
+
...logs
|
|
157
|
+
].join(`
|
|
158
|
+
`);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export { CANVAS_PREVIEW_WIDTHS2, runCanvasPreview2, describeCanvasPreview2 };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// examples/claude-code/inert-mcp.ts
|
|
2
|
+
var INERT_MCP_SOURCE2 = `#!/usr/bin/env node
|
|
3
|
+
import { readFile } from "node:fs/promises";
|
|
4
|
+
import { createInterface } from "node:readline";
|
|
5
|
+
|
|
6
|
+
const manifestPath = process.argv[2];
|
|
7
|
+
if (!manifestPath) process.exit(2);
|
|
8
|
+
const tools = JSON.parse(await readFile(manifestPath, "utf8"));
|
|
9
|
+
const lines = createInterface({ input: process.stdin, crlfDelay: Infinity });
|
|
10
|
+
|
|
11
|
+
for await (const line of lines) {
|
|
12
|
+
let request;
|
|
13
|
+
try {
|
|
14
|
+
request = JSON.parse(line);
|
|
15
|
+
} catch {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let result = {};
|
|
20
|
+
if (request.method === "initialize") {
|
|
21
|
+
result = {
|
|
22
|
+
protocolVersion: "2024-11-05",
|
|
23
|
+
capabilities: { tools: {} },
|
|
24
|
+
serverInfo: { name: "nyte-inert-tool-inventory", version: "1" },
|
|
25
|
+
};
|
|
26
|
+
} else if (request.method === "tools/list") {
|
|
27
|
+
result = { tools };
|
|
28
|
+
} else if (request.method === "tools/call") {
|
|
29
|
+
result = {
|
|
30
|
+
isError: true,
|
|
31
|
+
content: [{ type: "text", text: "Denied: Claude Code tools are inert; only Nyte executes tools." }],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (request.id !== undefined) {
|
|
36
|
+
process.stdout.write(\`\${JSON.stringify({ jsonrpc: "2.0", id: request.id, result })}\\n\`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
export { INERT_MCP_SOURCE2 };
|