@nyte-ai/plugin 0.0.23 → 0.0.25-beta.1
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 +2 -38
- package/dist/chunks/{billing-mvc33pv6.js → bash-description-1neewp76.js} +20 -9
- package/dist/chunks/{billing-2v3g7rd9.js → bash-description-2v3g7rd9.js} +1 -1
- package/dist/chunks/{billing-3j77ss7y.js → bash-description-3j77ss7y.js} +1 -1
- package/dist/chunks/{billing-bv5zr32b.js → bash-description-dnvgk30y.js} +2 -2
- package/dist/chunks/{billing-r2ftaajy.js → bash-description-eqp7ap2w.js} +3 -9
- package/dist/chunks/{billing-hg64tqf1.js → bash-description-hg64tqf1.js} +1 -1
- package/dist/chunks/{billing-svrhh5a5.js → bash-description-svrhh5a5.js} +1 -1
- package/dist/chunks/{billing-wbe8w0te.js → bash-description-wbe8w0te.js} +1 -1
- package/dist/chunks/{billing-wmcbg6fw.js → bash-description-wmcbg6fw.js} +1 -1
- package/dist/chunks/{billing-sxc70w72.js → bash-description-yyd9jznf.js} +1 -1
- package/dist/chunks/{billing-gs2h17jb.js → bash-description-zz15raxk.js} +1 -1
- package/dist/src/acp/connection.js +3 -3
- package/dist/src/acp/index.d.ts +3 -3
- package/dist/src/acp/index.js +6 -6
- package/dist/src/acp/registry.js +2 -2
- package/dist/src/acp/thread.js +2 -2
- package/dist/src/acp/transcript.js +2 -2
- package/dist/src/acp/translate.js +1 -1
- package/dist/src/approvals/approvals.d.ts +16 -16
- package/dist/src/approvals/approvals.js +1 -1
- package/dist/src/approvals/schema.d.ts +18 -18
- package/dist/src/approvals/schema.js +1 -1
- package/dist/src/bash-description.d.ts +1 -1
- package/dist/src/bash-description.js +3 -5
- package/dist/src/canvas/canvas-compile.js +3 -3
- package/dist/src/canvas/canvas-libraries.js +1 -1
- package/dist/src/canvas/canvas-preview.js +3 -3
- package/dist/src/canvas/canvas-protocol.d.ts +12 -12
- package/dist/src/canvas/canvas-protocol.js +2 -2
- package/dist/src/canvas/canvas.d.ts +12 -3
- package/dist/src/canvas/canvas.js +37 -15
- package/dist/src/canvas/schema.d.ts +48 -8
- package/dist/src/canvas/schema.js +7 -3
- package/dist/src/claude-code-sdk/index.d.ts +1 -1
- package/dist/src/claude-code-sdk/index.js +6 -6
- package/dist/src/claude-code-sdk/session.js +2 -2
- package/dist/src/claude-code-sdk/transcript.js +2 -2
- package/dist/src/claude-code-sdk/translate.js +1 -1
- package/dist/src/client/notifications.d.ts +1 -1
- package/dist/src/client/presentation.d.ts +1 -27
- package/dist/src/client/presentation.js +1 -19
- package/dist/src/find-on-path.js +1 -1
- package/dist/src/question/client/questions-tui.js +1 -1
- package/dist/src/question/client/questions.js +1 -1
- package/dist/src/question/question.d.ts +14 -14
- package/dist/src/question/question.js +2 -2
- package/dist/src/question/schema.d.ts +23 -23
- package/dist/src/question/schema.js +1 -1
- package/dist/src/rename.d.ts +10 -10
- package/dist/src/telemetry.d.ts +1 -1
- package/dist/src/web-search.d.ts +2 -2
- package/package.json +5 -10
- package/dist/chunks/billing-0y7dfkp2.js +0 -146
- package/dist/chunks/billing-3scqmkzb.js +0 -559
- package/dist/chunks/billing-8rjk35gr.js +0 -444
- package/dist/chunks/billing-9qc0eqh4.js +0 -174
- package/dist/chunks/billing-a9vqn66p.js +0 -351
- package/dist/chunks/billing-cy1rg619.js +0 -302
- package/dist/chunks/billing-ejx2hv52.js +0 -323
- package/dist/chunks/billing-j643d12p.js +0 -197
- package/dist/chunks/billing-s4rrspsk.js +0 -7
- package/dist/chunks/billing-t1qrxe16.js +0 -41
- package/dist/chunks/billing-tzr3cebf.js +0 -20
- package/dist/examples/claude-code/LICENSE +0 -21
- package/dist/examples/claude-code/billing.d.ts +0 -7
- package/dist/examples/claude-code/billing.js +0 -11
- package/dist/examples/claude-code/claude-cli.d.ts +0 -35
- package/dist/examples/claude-code/claude-cli.js +0 -15
- package/dist/examples/claude-code/env.d.ts +0 -1
- package/dist/examples/claude-code/env.js +0 -6
- package/dist/examples/claude-code/index.d.ts +0 -24
- package/dist/examples/claude-code/index.js +0 -149
- package/dist/examples/claude-code/inert-mcp.d.ts +0 -1
- package/dist/examples/claude-code/inert-mcp.js +0 -6
- package/dist/examples/claude-code/model-catalog.d.ts +0 -27
- package/dist/examples/claude-code/model-catalog.js +0 -12
- package/dist/examples/claude-code/process.d.ts +0 -22
- package/dist/examples/claude-code/process.js +0 -25
- package/dist/examples/claude-code/replay.d.ts +0 -4
- package/dist/examples/claude-code/replay.js +0 -11
- package/dist/examples/claude-code/stream.d.ts +0 -3
- package/dist/examples/claude-code/stream.js +0 -16
- package/dist/examples/claude-code/transcript.d.ts +0 -83
- package/dist/examples/claude-code/transcript.js +0 -23
- package/dist/examples/claude-code/turn-relay.d.ts +0 -48
- package/dist/examples/claude-code/turn-relay.js +0 -9
- package/dist/examples/claude-code/wire.d.ts +0 -372
- package/dist/examples/claude-code/wire.js +0 -18
- /package/dist/chunks/{billing-4vz9pxyx.js → bash-description-4vz9pxyx.js} +0 -0
- /package/dist/chunks/{billing-6z2kgtyt.js → bash-description-6z2kgtyt.js} +0 -0
- /package/dist/chunks/{billing-9nn3yp18.js → bash-description-9nn3yp18.js} +0 -0
- /package/dist/chunks/{billing-h13r0byk.js → bash-description-h13r0byk.js} +0 -0
- /package/dist/chunks/{billing-ye3wk5r3.js → bash-description-ye3wk5r3.js} +0 -0
- /package/dist/chunks/{billing-zfpm2rt0.js → bash-description-zfpm2rt0.js} +0 -0
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Provider } from "@nyte-ai/ai";
|
|
2
|
-
/** Returns the Anthropic provider using Claude Code's login and CLI; Nyte owns history, approvals and tool execution. */
|
|
3
|
-
export declare function claudeCodeProvider(): Provider;
|
|
4
|
-
declare const _default: {
|
|
5
|
-
id: string;
|
|
6
|
-
activate({ session, signal }: {
|
|
7
|
-
readonly side: "core";
|
|
8
|
-
readonly sdk: import("@nyte-ai/core").Connection;
|
|
9
|
-
readonly contribute: import("@nyte-ai/core").Registries<"core">;
|
|
10
|
-
readonly storage: import("@nyte-ai/core").PluginStorage;
|
|
11
|
-
readonly signal: AbortSignal;
|
|
12
|
-
hook<N extends "session_activated" | "before_send" | "run_started" | "transform_transcript" | "before_compaction" | "before_request" | "before_tool" | "after_tool" | "after_request" | "run_ended">(name: N, entry: import("@nyte-ai/core").HookEntry<"core", N>): import("@nyte-ai/schema").Disposer;
|
|
13
|
-
report(issue: import("@nyte-ai/schema").ValidationIssue): void;
|
|
14
|
-
reload(): void;
|
|
15
|
-
} & {
|
|
16
|
-
readonly session: import("@nyte-ai/core").Session;
|
|
17
|
-
readonly env: import("@nyte-ai/core").ExecutionEnv;
|
|
18
|
-
wrapEnv(wrap: import("@nyte-ai/core").EnvironmentWrap): import("@nyte-ai/schema").Disposer;
|
|
19
|
-
readonly inputs: import("@nyte-ai/core").Resources;
|
|
20
|
-
request<T = string>(input: import("@nyte-ai/schema").ModelRequestInput<T>): Promise<import("@nyte-ai/schema").ModelRequestOutcome<T>>;
|
|
21
|
-
approve(call: import("@nyte-ai/core").RuntimeCall, signal: AbortSignal): Promise<import("@nyte-ai/core").RuntimeVerdict>;
|
|
22
|
-
}): void;
|
|
23
|
-
};
|
|
24
|
-
export default _default;
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import"../../chunks/billing-s4rrspsk.js";
|
|
2
|
-
import {
|
|
3
|
-
PROVIDER_ID2,
|
|
4
|
-
API_ID2,
|
|
5
|
-
createClaudeModelCatalog2
|
|
6
|
-
} from "../../chunks/billing-9qc0eqh4.js";
|
|
7
|
-
import"../../chunks/billing-0y7dfkp2.js";
|
|
8
|
-
import {
|
|
9
|
-
LOGIN_HINT2,
|
|
10
|
-
getClaudeStatus2,
|
|
11
|
-
discoverClaudeModels2
|
|
12
|
-
} from "../../chunks/billing-cy1rg619.js";
|
|
13
|
-
import"../../chunks/billing-tzr3cebf.js";
|
|
14
|
-
import"../../chunks/billing-t1qrxe16.js";
|
|
15
|
-
import"../../chunks/billing-j643d12p.js";
|
|
16
|
-
import"../../chunks/billing-a9vqn66p.js";
|
|
17
|
-
import"../../chunks/billing-ejx2hv52.js";
|
|
18
|
-
import"../../chunks/billing-3scqmkzb.js";
|
|
19
|
-
import {
|
|
20
|
-
streamClaudeCode2
|
|
21
|
-
} from "../../chunks/billing-8rjk35gr.js";
|
|
22
|
-
|
|
23
|
-
// examples/claude-code/index.ts
|
|
24
|
-
import process from "node:process";
|
|
25
|
-
import { acquireSessionResources, anthropicProvider } from "@nyte-ai/ai";
|
|
26
|
-
var ENV_NAMES = [
|
|
27
|
-
"NYTE_CLAUDE_CODE_COMMAND",
|
|
28
|
-
"NYTE_CLAUDE_CODE_CONFIG_DIR",
|
|
29
|
-
"NYTE_CLAUDE_CODE_ALLOW_USAGE_CREDITS",
|
|
30
|
-
"CLAUDE_CONFIG_DIR"
|
|
31
|
-
];
|
|
32
|
-
async function providerEnvironment(ctx) {
|
|
33
|
-
const env = {};
|
|
34
|
-
for (const name of ENV_NAMES) {
|
|
35
|
-
const value = await ctx.env(name);
|
|
36
|
-
if (value !== undefined)
|
|
37
|
-
env[name] = value;
|
|
38
|
-
}
|
|
39
|
-
return env;
|
|
40
|
-
}
|
|
41
|
-
function claudeCodeProvider() {
|
|
42
|
-
const catalog = anthropicProvider();
|
|
43
|
-
const routes = createClaudeModelCatalog2();
|
|
44
|
-
let env = {};
|
|
45
|
-
let discovered;
|
|
46
|
-
const check = async ({
|
|
47
|
-
ctx,
|
|
48
|
-
signal
|
|
49
|
-
}) => {
|
|
50
|
-
env = await providerEnvironment(ctx);
|
|
51
|
-
const status = await getClaudeStatus2({ ...process.env, ...env }, signal);
|
|
52
|
-
if (!status.available || !status.loggedIn)
|
|
53
|
-
return;
|
|
54
|
-
return {
|
|
55
|
-
type: status.subscription ? "oauth" : "api_key",
|
|
56
|
-
source: status.subscription ? `Claude Code ${status.plan ?? "subscription"}` : "Claude Code CLI"
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
return {
|
|
60
|
-
id: PROVIDER_ID2,
|
|
61
|
-
name: "Claude Code",
|
|
62
|
-
baseUrl: "process://claude-code",
|
|
63
|
-
auth: {
|
|
64
|
-
apiKey: {
|
|
65
|
-
name: "Claude Code login",
|
|
66
|
-
check,
|
|
67
|
-
async resolve({ ctx, signal }) {
|
|
68
|
-
signal.throwIfAborted();
|
|
69
|
-
env = await providerEnvironment(ctx);
|
|
70
|
-
return { auth: {}, env, source: "Claude Code CLI" };
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
oauth: {
|
|
74
|
-
check,
|
|
75
|
-
name: "Claude Code subscription",
|
|
76
|
-
isSubscription: true,
|
|
77
|
-
async login() {
|
|
78
|
-
throw new Error("Claude Code manages its login. Run `claude auth login` in a terminal; Nyte uses it automatically.");
|
|
79
|
-
},
|
|
80
|
-
async refresh(_credential, signal) {
|
|
81
|
-
const status = await getClaudeStatus2({ ...process.env, ...env }, signal);
|
|
82
|
-
if (!status.subscription)
|
|
83
|
-
throw new Error(LOGIN_HINT2);
|
|
84
|
-
return {
|
|
85
|
-
type: "oauth",
|
|
86
|
-
access: "claude-code-external",
|
|
87
|
-
refresh: "claude-code-external",
|
|
88
|
-
expires: Date.now() + 365 * 24 * 60 * 60 * 1000
|
|
89
|
-
};
|
|
90
|
-
},
|
|
91
|
-
toAuth: async () => ({})
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
getModels() {
|
|
95
|
-
const builtins = catalog.getModels();
|
|
96
|
-
routes.restoreAnthropicModels(builtins);
|
|
97
|
-
if (discovered)
|
|
98
|
-
return discovered.map(routes.modelFromDiscovery);
|
|
99
|
-
const models = builtins.map((model) => ({
|
|
100
|
-
...model,
|
|
101
|
-
api: API_ID2,
|
|
102
|
-
compat: undefined,
|
|
103
|
-
baseUrl: "process://claude-code"
|
|
104
|
-
}));
|
|
105
|
-
const ids = new Set(models.map((model) => model.id));
|
|
106
|
-
return [...models, ...routes.fallbackClaudeModels().filter((model) => !ids.has(model.id))];
|
|
107
|
-
},
|
|
108
|
-
async refreshModels(context) {
|
|
109
|
-
if (!context.allowNetwork) {
|
|
110
|
-
await catalog.refreshModels?.(context);
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
const results = await Promise.allSettled([
|
|
114
|
-
catalog.refreshModels?.(context),
|
|
115
|
-
discoverClaudeModels2({ ...process.env, ...env }, context.signal).then((next) => context.publish({
|
|
116
|
-
update: () => {
|
|
117
|
-
discovered = next;
|
|
118
|
-
}
|
|
119
|
-
}))
|
|
120
|
-
]);
|
|
121
|
-
context.signal.throwIfAborted();
|
|
122
|
-
const discovery = results[1];
|
|
123
|
-
if (discovery?.status === "rejected")
|
|
124
|
-
throw discovery.reason;
|
|
125
|
-
},
|
|
126
|
-
stream: (model, context, options) => streamClaudeCode2(model, context, {
|
|
127
|
-
signal: options?.signal,
|
|
128
|
-
env: options?.env,
|
|
129
|
-
timeoutMs: options?.timeoutMs,
|
|
130
|
-
maxTokens: options?.maxTokens,
|
|
131
|
-
sessionId: options?.sessionId,
|
|
132
|
-
cacheRetention: options?.cacheRetention
|
|
133
|
-
}, routes),
|
|
134
|
-
streamSimple: (model, context, options) => streamClaudeCode2(model, context, options, routes)
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
var claude_code_default = {
|
|
138
|
-
id: "claude-code",
|
|
139
|
-
activate({ session, signal }) {
|
|
140
|
-
const release = acquireSessionResources(session.id);
|
|
141
|
-
signal.addEventListener("abort", release, { once: true });
|
|
142
|
-
if (signal.aborted)
|
|
143
|
-
release();
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
export {
|
|
147
|
-
claudeCodeProvider,
|
|
148
|
-
claude_code_default as default
|
|
149
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const INERT_MCP_SOURCE = "#!/usr/bin/env node\nimport { readFile } from \"node:fs/promises\";\nimport { createInterface } from \"node:readline\";\n\nconst manifestPath = process.argv[2];\nif (!manifestPath) process.exit(2);\nconst tools = JSON.parse(await readFile(manifestPath, \"utf8\"));\nconst lines = createInterface({ input: process.stdin, crlfDelay: Infinity });\n\nfor await (const line of lines) {\n let request;\n try {\n request = JSON.parse(line);\n } catch {\n continue;\n }\n\n let result = {};\n if (request.method === \"initialize\") {\n result = {\n protocolVersion: \"2024-11-05\",\n capabilities: { tools: {} },\n serverInfo: { name: \"nyte-inert-tool-inventory\", version: \"1\" },\n };\n } else if (request.method === \"tools/list\") {\n result = { tools };\n } else if (request.method === \"tools/call\") {\n result = {\n isError: true,\n content: [{ type: \"text\", text: \"Denied: Claude Code tools are inert; only Nyte executes tools.\" }],\n };\n }\n\n if (request.id !== undefined) {\n process.stdout.write(`${JSON.stringify({ jsonrpc: \"2.0\", id: request.id, result })}\\n`);\n }\n}\n";
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { Model } from "@nyte-ai/ai";
|
|
2
|
-
import { Type } from "typebox";
|
|
3
|
-
import type { Static } from "typebox";
|
|
4
|
-
export declare const PROVIDER_ID = "anthropic";
|
|
5
|
-
export declare const API_ID = "claude-code-stream-json";
|
|
6
|
-
export type ClaudeCodeModel = Model<typeof API_ID>;
|
|
7
|
-
export declare const discoveredModelSchema: Type.TObject<{
|
|
8
|
-
value: Type.TString;
|
|
9
|
-
resolvedModel: Type.TOptional<Type.TString>;
|
|
10
|
-
displayName: Type.TString;
|
|
11
|
-
description: Type.TString;
|
|
12
|
-
supportsEffort: Type.TOptional<Type.TBoolean>;
|
|
13
|
-
supportedEffortLevels: Type.TOptional<Type.TArray<Type.TUnion<[Type.TLiteral<"low">, Type.TLiteral<"medium">, Type.TLiteral<"high">, Type.TLiteral<"xhigh">, Type.TLiteral<"max">]>>>;
|
|
14
|
-
supportsAdaptiveThinking: Type.TOptional<Type.TBoolean>;
|
|
15
|
-
supportsFastMode: Type.TOptional<Type.TBoolean>;
|
|
16
|
-
supportsAutoMode: Type.TOptional<Type.TBoolean>;
|
|
17
|
-
}>;
|
|
18
|
-
export type DiscoveredClaudeModel = Static<typeof discoveredModelSchema>;
|
|
19
|
-
export declare function createClaudeModelCatalog(): {
|
|
20
|
-
restoreAnthropicModels: (models: readonly Model<"anthropic-messages">[]) => void;
|
|
21
|
-
modelFromDiscovery: (info: DiscoveredClaudeModel) => ClaudeCodeModel;
|
|
22
|
-
fallbackClaudeModels: () => ClaudeCodeModel[];
|
|
23
|
-
nativeModel: (model: string) => string;
|
|
24
|
-
supportsAdaptiveThinking: (model: string) => boolean;
|
|
25
|
-
supportsNativeToolChanges: (model: string) => boolean;
|
|
26
|
-
};
|
|
27
|
-
export type ClaudeModelCatalog = ReturnType<typeof createClaudeModelCatalog>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PROVIDER_ID2,
|
|
3
|
-
API_ID2,
|
|
4
|
-
discoveredModelSchema2,
|
|
5
|
-
createClaudeModelCatalog2
|
|
6
|
-
} from "../../chunks/billing-9qc0eqh4.js";
|
|
7
|
-
export {
|
|
8
|
-
API_ID2 as API_ID,
|
|
9
|
-
PROVIDER_ID2 as PROVIDER_ID,
|
|
10
|
-
createClaudeModelCatalog2 as createClaudeModelCatalog,
|
|
11
|
-
discoveredModelSchema2 as discoveredModelSchema
|
|
12
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { spawn } from "node:child_process";
|
|
2
|
-
import type { ChildProcess } from "node:child_process";
|
|
3
|
-
import type { DiscoveredClaudeModel } from "./model-catalog.ts";
|
|
4
|
-
import type { JsonRecord } from "./wire.ts";
|
|
5
|
-
export declare const LOGIN_HINT = "Claude Code is installed but not logged in. Run `claude auth login` and try again.";
|
|
6
|
-
export interface ClaudeStatus {
|
|
7
|
-
available: boolean;
|
|
8
|
-
loggedIn: boolean;
|
|
9
|
-
subscription: boolean;
|
|
10
|
-
authMethod?: string;
|
|
11
|
-
plan?: string;
|
|
12
|
-
detail?: string;
|
|
13
|
-
command?: string;
|
|
14
|
-
}
|
|
15
|
-
export declare function configuredCommand(env: Record<string, string | undefined>): string;
|
|
16
|
-
export declare function getClaudeStatus(envInput?: Record<string, string | undefined>, signal?: AbortSignal): Promise<ClaudeStatus>;
|
|
17
|
-
export declare function readyClaudeCommand(envInput: Record<string, string | undefined>, signal?: AbortSignal): Promise<string>;
|
|
18
|
-
export declare function discoverClaudeModels(envInput?: Record<string, string | undefined>, signal?: AbortSignal, timeoutMs?: number): Promise<DiscoveredClaudeModel[]>;
|
|
19
|
-
export declare function spawnCommand(command: string, args: string[], options: Parameters<typeof spawn>[2]): ChildProcess;
|
|
20
|
-
export declare function childExit(child: ChildProcess): Promise<number>;
|
|
21
|
-
export declare function killProcessTree(child: ChildProcess): void;
|
|
22
|
-
export declare function processEnvironment(input: Record<string, string | undefined> | undefined, extraBody: JsonRecord): Record<string, string>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
LOGIN_HINT2,
|
|
3
|
-
configuredCommand2,
|
|
4
|
-
getClaudeStatus2,
|
|
5
|
-
readyClaudeCommand2,
|
|
6
|
-
discoverClaudeModels2,
|
|
7
|
-
spawnCommand2,
|
|
8
|
-
childExit2,
|
|
9
|
-
killProcessTree2,
|
|
10
|
-
processEnvironment2
|
|
11
|
-
} from "../../chunks/billing-cy1rg619.js";
|
|
12
|
-
import"../../chunks/billing-s4rrspsk.js";
|
|
13
|
-
import"../../chunks/billing-9qc0eqh4.js";
|
|
14
|
-
import"../../chunks/billing-0y7dfkp2.js";
|
|
15
|
-
export {
|
|
16
|
-
LOGIN_HINT2 as LOGIN_HINT,
|
|
17
|
-
childExit2 as childExit,
|
|
18
|
-
configuredCommand2 as configuredCommand,
|
|
19
|
-
discoverClaudeModels2 as discoverClaudeModels,
|
|
20
|
-
getClaudeStatus2 as getClaudeStatus,
|
|
21
|
-
killProcessTree2 as killProcessTree,
|
|
22
|
-
processEnvironment2 as processEnvironment,
|
|
23
|
-
readyClaudeCommand2 as readyClaudeCommand,
|
|
24
|
-
spawnCommand2 as spawnCommand
|
|
25
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { NativeSystemInjection } from "./transcript.ts";
|
|
2
|
-
export declare function deriveInitialUserPrefix(body: Buffer | undefined, canonicalContent: unknown[]): unknown[] | undefined;
|
|
3
|
-
export declare function deriveInitialSystemMessages(body: Buffer | undefined): unknown[] | undefined;
|
|
4
|
-
export declare function rewriteInitialRequest(body: Buffer, prefix: unknown[] | undefined, canonicalContent: unknown[], initialSystemMessages: unknown[] | undefined, nativeSystemInjections?: NativeSystemInjection[]): Buffer;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
deriveInitialUserPrefix2,
|
|
3
|
-
deriveInitialSystemMessages2,
|
|
4
|
-
rewriteInitialRequest2
|
|
5
|
-
} from "../../chunks/billing-j643d12p.js";
|
|
6
|
-
import"../../chunks/billing-0y7dfkp2.js";
|
|
7
|
-
export {
|
|
8
|
-
deriveInitialSystemMessages2 as deriveInitialSystemMessages,
|
|
9
|
-
deriveInitialUserPrefix2 as deriveInitialUserPrefix,
|
|
10
|
-
rewriteInitialRequest2 as rewriteInitialRequest
|
|
11
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { Api, AssistantMessageEventStream, Model, SimpleStreamOptions, TranscriptContext } from "@nyte-ai/ai";
|
|
2
|
-
import type { ClaudeModelCatalog } from "./model-catalog.ts";
|
|
3
|
-
export declare function streamClaudeCode(model: Model<Api>, context: TranscriptContext, options: SimpleStreamOptions | undefined, catalog: ClaudeModelCatalog): AssistantMessageEventStream;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
streamClaudeCode2
|
|
3
|
-
} from "../../chunks/billing-8rjk35gr.js";
|
|
4
|
-
import"../../chunks/billing-3scqmkzb.js";
|
|
5
|
-
import"../../chunks/billing-ejx2hv52.js";
|
|
6
|
-
import"../../chunks/billing-a9vqn66p.js";
|
|
7
|
-
import"../../chunks/billing-tzr3cebf.js";
|
|
8
|
-
import"../../chunks/billing-t1qrxe16.js";
|
|
9
|
-
import"../../chunks/billing-cy1rg619.js";
|
|
10
|
-
import"../../chunks/billing-s4rrspsk.js";
|
|
11
|
-
import"../../chunks/billing-9qc0eqh4.js";
|
|
12
|
-
import"../../chunks/billing-j643d12p.js";
|
|
13
|
-
import"../../chunks/billing-0y7dfkp2.js";
|
|
14
|
-
export {
|
|
15
|
-
streamClaudeCode2 as streamClaudeCode
|
|
16
|
-
};
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import type { JsonRecord } from "./wire.ts";
|
|
2
|
-
import type { AssistantMessage, Message, SimpleStreamOptions, Tool } from "@nyte-ai/ai";
|
|
3
|
-
import type { NativeFrame, NativeMessage } from "./wire.ts";
|
|
4
|
-
export declare const TOOL_PREFIX = "mcp__nyte__";
|
|
5
|
-
export declare const NATIVE_TOOL_CHANGES_BETA = "mid-conversation-tool-changes-2026-07-01";
|
|
6
|
-
export interface NativeSystemInjection {
|
|
7
|
-
beforeAssistant: number | null;
|
|
8
|
-
content: Array<JsonRecord>;
|
|
9
|
-
}
|
|
10
|
-
export interface NativeTranscriptPlan {
|
|
11
|
-
requestTools: Array<JsonRecord>;
|
|
12
|
-
systemInjections: NativeSystemInjection[];
|
|
13
|
-
}
|
|
14
|
-
interface AssistantProjection {
|
|
15
|
-
text: string;
|
|
16
|
-
toolCalls: Array<{
|
|
17
|
-
id: string;
|
|
18
|
-
name: string;
|
|
19
|
-
input: JsonRecord;
|
|
20
|
-
}>;
|
|
21
|
-
}
|
|
22
|
-
export declare function getInitialUserPrefix(messages: Message[]): unknown[] | undefined;
|
|
23
|
-
export declare function getInitialSystemMessages(messages: Message[]): unknown[] | undefined;
|
|
24
|
-
export declare function prepareFrames(messages: Message[]): NativeFrame[];
|
|
25
|
-
export interface ToolManifestEntry {
|
|
26
|
-
name: string;
|
|
27
|
-
description: string;
|
|
28
|
-
inputSchema: JsonRecord;
|
|
29
|
-
}
|
|
30
|
-
export declare function prepareTools(tools: Tool[]): {
|
|
31
|
-
manifest: ToolManifestEntry[];
|
|
32
|
-
nativeTools: Array<JsonRecord>;
|
|
33
|
-
names: Set<string>;
|
|
34
|
-
};
|
|
35
|
-
export declare function prepareNativeTranscript(messages: Message[], supported: boolean): NativeTranscriptPlan | undefined;
|
|
36
|
-
export declare function buildExtraBody(nativeTools: Array<JsonRecord>, options: SimpleStreamOptions | undefined, adaptive: boolean): JsonRecord;
|
|
37
|
-
export declare function makeReplayDiagnostic(message: NativeMessage, output: AssistantMessage, initialUserPrefix?: unknown[], initialSystemMessages?: unknown[]): {
|
|
38
|
-
type: string;
|
|
39
|
-
timestamp: number;
|
|
40
|
-
details: {
|
|
41
|
-
carrier: {
|
|
42
|
-
initialSystemMessages?: unknown[] | undefined;
|
|
43
|
-
initialUserPrefix?: unknown[] | undefined;
|
|
44
|
-
version: number;
|
|
45
|
-
message: Record<string, unknown> & {
|
|
46
|
-
id?: string | undefined;
|
|
47
|
-
usage?: {
|
|
48
|
-
cache_creation?: {
|
|
49
|
-
ephemeral_1h_input_tokens?: number | undefined;
|
|
50
|
-
} | undefined;
|
|
51
|
-
cache_read_input_tokens?: number | undefined;
|
|
52
|
-
cache_creation_input_tokens?: number | undefined;
|
|
53
|
-
output_tokens_details?: {
|
|
54
|
-
thinking_tokens?: number | undefined;
|
|
55
|
-
} | undefined;
|
|
56
|
-
input_tokens: number;
|
|
57
|
-
output_tokens: number;
|
|
58
|
-
} | undefined;
|
|
59
|
-
stop_sequence?: string | null | undefined;
|
|
60
|
-
stop_reason?: string | null | undefined;
|
|
61
|
-
content: ({
|
|
62
|
-
type: "text";
|
|
63
|
-
text: string;
|
|
64
|
-
} | {
|
|
65
|
-
signature?: string | undefined;
|
|
66
|
-
thinking: string;
|
|
67
|
-
type: "thinking";
|
|
68
|
-
} | {
|
|
69
|
-
type: "redacted_thinking";
|
|
70
|
-
data: string;
|
|
71
|
-
} | {
|
|
72
|
-
id: string;
|
|
73
|
-
name: string;
|
|
74
|
-
type: "tool_use";
|
|
75
|
-
input: Record<string, unknown>;
|
|
76
|
-
})[];
|
|
77
|
-
role: "assistant";
|
|
78
|
-
};
|
|
79
|
-
projection: AssistantProjection;
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
TOOL_PREFIX2,
|
|
3
|
-
NATIVE_TOOL_CHANGES_BETA2,
|
|
4
|
-
getInitialUserPrefix2,
|
|
5
|
-
getInitialSystemMessages2,
|
|
6
|
-
prepareFrames2,
|
|
7
|
-
prepareTools2,
|
|
8
|
-
prepareNativeTranscript2,
|
|
9
|
-
buildExtraBody2,
|
|
10
|
-
makeReplayDiagnostic2
|
|
11
|
-
} from "../../chunks/billing-ejx2hv52.js";
|
|
12
|
-
import"../../chunks/billing-0y7dfkp2.js";
|
|
13
|
-
export {
|
|
14
|
-
NATIVE_TOOL_CHANGES_BETA2 as NATIVE_TOOL_CHANGES_BETA,
|
|
15
|
-
TOOL_PREFIX2 as TOOL_PREFIX,
|
|
16
|
-
buildExtraBody2 as buildExtraBody,
|
|
17
|
-
getInitialSystemMessages2 as getInitialSystemMessages,
|
|
18
|
-
getInitialUserPrefix2 as getInitialUserPrefix,
|
|
19
|
-
makeReplayDiagnostic2 as makeReplayDiagnostic,
|
|
20
|
-
prepareFrames2 as prepareFrames,
|
|
21
|
-
prepareNativeTranscript2 as prepareNativeTranscript,
|
|
22
|
-
prepareTools2 as prepareTools
|
|
23
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { AnthropicStreamEvent, NativeMessage } from "./wire.ts";
|
|
2
|
-
export declare class AnthropicCapture {
|
|
3
|
-
message?: NativeMessage;
|
|
4
|
-
complete: boolean;
|
|
5
|
-
error?: string;
|
|
6
|
-
private pending;
|
|
7
|
-
private readonly decoder;
|
|
8
|
-
private readonly argumentsByIndex;
|
|
9
|
-
private readonly onEvent?;
|
|
10
|
-
constructor(onEvent?: (event: AnthropicStreamEvent) => void);
|
|
11
|
-
feed(chunk: Uint8Array): void;
|
|
12
|
-
finish(): void;
|
|
13
|
-
private consumeFrames;
|
|
14
|
-
private apply;
|
|
15
|
-
}
|
|
16
|
-
export declare class TurnRelay {
|
|
17
|
-
capture: AnthropicCapture;
|
|
18
|
-
used: boolean;
|
|
19
|
-
denied: number;
|
|
20
|
-
status?: number;
|
|
21
|
-
requestId?: string;
|
|
22
|
-
failure?: string;
|
|
23
|
-
errorBody: Buffer<ArrayBuffer>;
|
|
24
|
-
originalRequestBody?: Buffer;
|
|
25
|
-
requestBody?: Buffer;
|
|
26
|
-
private readonly upstream;
|
|
27
|
-
private readonly prefix;
|
|
28
|
-
private readonly server;
|
|
29
|
-
private readonly sockets;
|
|
30
|
-
private readonly active;
|
|
31
|
-
private cancelled;
|
|
32
|
-
private closed;
|
|
33
|
-
private baseUrl?;
|
|
34
|
-
private transformRequest?;
|
|
35
|
-
private requestBetas;
|
|
36
|
-
private readonly timeoutMs;
|
|
37
|
-
constructor(upstream?: string, timeoutMs?: number, onEvent?: (event: AnthropicStreamEvent) => void, transformRequest?: (body: Buffer) => Buffer, requestBetas?: string[]);
|
|
38
|
-
beginTurn(onEvent?: (event: AnthropicStreamEvent) => void, transformRequest?: (body: Buffer) => Buffer, requestBetas?: string[]): void;
|
|
39
|
-
finishTurn(): void;
|
|
40
|
-
start(): Promise<string>;
|
|
41
|
-
errorText(): string;
|
|
42
|
-
abort(): void;
|
|
43
|
-
settled(): Promise<void>;
|
|
44
|
-
close(): Promise<void>;
|
|
45
|
-
private handle;
|
|
46
|
-
private waitForDrain;
|
|
47
|
-
private readBody;
|
|
48
|
-
}
|