@love-moon/ai-sdk 0.2.42 → 0.3.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/CHANGELOG.md +19 -0
- package/dist/built-in-backends.d.ts +51 -0
- package/dist/built-in-backends.js +78 -0
- package/dist/external-provider-registry.js +15 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/providers/claude-agent-sdk-session.js +1 -1
- package/dist/providers/codex-app-server-session.js +6 -5
- package/dist/providers/codex-exec-session.js +1 -1
- package/dist/providers/copilot-sdk-session.js +1 -1
- package/dist/providers/kimi-cli-session.js +1 -1
- package/dist/providers/kimi-print-session.js +1 -1
- package/dist/providers/opencode-sdk-session.js +1 -1
- package/dist/resume/claude.d.ts +14 -0
- package/dist/resume/claude.js +138 -0
- package/dist/resume/codex.d.ts +14 -0
- package/dist/resume/codex.js +81 -0
- package/dist/resume/copilot.d.ts +14 -0
- package/dist/resume/copilot.js +375 -0
- package/dist/resume/index.d.ts +26 -0
- package/dist/resume/index.js +132 -0
- package/dist/resume/kimi.d.ts +14 -0
- package/dist/resume/kimi.js +89 -0
- package/dist/resume/opencode.d.ts +13 -0
- package/dist/resume/opencode.js +63 -0
- package/dist/resume/shared.d.ts +26 -0
- package/dist/resume/shared.js +115 -0
- package/dist/session-factory.d.ts +2 -1
- package/dist/session-factory.js +40 -62
- package/package.json +10 -4
- package/dist/resume.d.ts +0 -26
- package/dist/resume.js +0 -380
- package/dist/tui-session.d.ts +0 -153
- package/dist/tui-session.js +0 -941
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { buildResumeContext, isExistingDirectory, listCandidateWorkingDirectories, normalizeProjectPathCandidate, normalizeSessionId, } from "./shared.js";
|
|
2
|
+
export const BACKEND = "opencode";
|
|
3
|
+
export function buildCliArgs(sessionId) {
|
|
4
|
+
const normalizedSessionId = normalizeSessionId(sessionId);
|
|
5
|
+
if (!normalizedSessionId) {
|
|
6
|
+
return [];
|
|
7
|
+
}
|
|
8
|
+
// opencode sessions are reattached via the SDK (`session.get({ sessionID })`),
|
|
9
|
+
// not via CLI flags. We still return the canonical flag so CLI integrations
|
|
10
|
+
// that need to pass a sessionId on the command line have a consistent shape.
|
|
11
|
+
return ["--session", normalizedSessionId];
|
|
12
|
+
}
|
|
13
|
+
export async function findSessionPath() {
|
|
14
|
+
// opencode sessions live inside the opencode server; there is no local
|
|
15
|
+
// filesystem path to discover.
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
export async function resolveResumeContext(sessionId, options = {}) {
|
|
19
|
+
const normalizedSessionId = normalizeSessionId(sessionId);
|
|
20
|
+
if (!normalizedSessionId) {
|
|
21
|
+
throw new Error("--resume requires a session id");
|
|
22
|
+
}
|
|
23
|
+
const explicitCwd = normalizeProjectPathCandidate(options.cwd);
|
|
24
|
+
let selectedCwd = "";
|
|
25
|
+
let cwdSource = "";
|
|
26
|
+
if (explicitCwd) {
|
|
27
|
+
// When an explicit cwd is provided, require it to exist; do NOT fall
|
|
28
|
+
// through to PWD/process.cwd() so tests and callers get a deterministic
|
|
29
|
+
// result.
|
|
30
|
+
if (!(await isExistingDirectory(explicitCwd))) {
|
|
31
|
+
throw new Error(`Resume workspace path does not exist: ${explicitCwd}`);
|
|
32
|
+
}
|
|
33
|
+
selectedCwd = explicitCwd;
|
|
34
|
+
cwdSource = "options_cwd";
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
for (const candidate of listCandidateWorkingDirectories(options)) {
|
|
38
|
+
if (await isExistingDirectory(candidate)) {
|
|
39
|
+
selectedCwd = candidate;
|
|
40
|
+
cwdSource = "current_working_directory";
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (typeof options.resolveOpencodeCwd === "function" && !selectedCwd) {
|
|
46
|
+
const resolved = await options.resolveOpencodeCwd(normalizedSessionId, options);
|
|
47
|
+
const normalizedResolved = normalizeProjectPathCandidate(resolved);
|
|
48
|
+
if (normalizedResolved && (await isExistingDirectory(normalizedResolved))) {
|
|
49
|
+
selectedCwd = normalizedResolved;
|
|
50
|
+
cwdSource = "lookup";
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (!selectedCwd) {
|
|
54
|
+
throw new Error(`Could not resolve workspace for opencode session ${normalizedSessionId}. Re-run from the original workspace.`);
|
|
55
|
+
}
|
|
56
|
+
return buildResumeContext({
|
|
57
|
+
provider: "opencode",
|
|
58
|
+
sessionId: normalizedSessionId,
|
|
59
|
+
sessionPath: null,
|
|
60
|
+
cwd: selectedCwd,
|
|
61
|
+
cwdSource: cwdSource || "current_working_directory",
|
|
62
|
+
});
|
|
63
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export function normalizeBackend(backend: any): string;
|
|
2
|
+
export function normalizeSessionId(sessionId: any): string;
|
|
3
|
+
export function resolveHomeDir(options: any): any;
|
|
4
|
+
export function normalizeProjectPathCandidate(value: any): string;
|
|
5
|
+
export function pathExists(targetPath: any, expectedType: any): Promise<boolean>;
|
|
6
|
+
export function isExistingDirectory(targetPath: any): Promise<boolean>;
|
|
7
|
+
export function resolveSessionRunDirectory(sessionPath: any): Promise<string>;
|
|
8
|
+
export function listCandidateWorkingDirectories(options?: {}): any[];
|
|
9
|
+
export function iterateJsonlEntries(sessionPath: any): AsyncGenerator<any, void, unknown>;
|
|
10
|
+
export function buildResumeContext({ provider, sessionId, sessionPath, cwd, cwdSource, extraDebug, }: {
|
|
11
|
+
provider: any;
|
|
12
|
+
sessionId: any;
|
|
13
|
+
sessionPath?: null | undefined;
|
|
14
|
+
cwd: any;
|
|
15
|
+
cwdSource: any;
|
|
16
|
+
extraDebug?: {} | undefined;
|
|
17
|
+
}): {
|
|
18
|
+
provider: any;
|
|
19
|
+
sessionId: any;
|
|
20
|
+
sessionPath: null;
|
|
21
|
+
cwd: any;
|
|
22
|
+
debugMetadata: {
|
|
23
|
+
cwdSource: any;
|
|
24
|
+
sessionPath: null;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import { promises as fsp } from "node:fs";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import readline from "node:readline";
|
|
6
|
+
export function normalizeBackend(backend) {
|
|
7
|
+
return String(backend || "").trim().toLowerCase();
|
|
8
|
+
}
|
|
9
|
+
export function normalizeSessionId(sessionId) {
|
|
10
|
+
return typeof sessionId === "string" ? sessionId.trim() : "";
|
|
11
|
+
}
|
|
12
|
+
export function resolveHomeDir(options) {
|
|
13
|
+
if (options?.homeDir) {
|
|
14
|
+
return options.homeDir;
|
|
15
|
+
}
|
|
16
|
+
return os.homedir();
|
|
17
|
+
}
|
|
18
|
+
export function normalizeProjectPathCandidate(value) {
|
|
19
|
+
return typeof value === "string" && value.trim() ? value.trim() : "";
|
|
20
|
+
}
|
|
21
|
+
export async function pathExists(targetPath, expectedType) {
|
|
22
|
+
try {
|
|
23
|
+
const stats = await fsp.stat(targetPath);
|
|
24
|
+
if (expectedType === "file") {
|
|
25
|
+
return stats.isFile();
|
|
26
|
+
}
|
|
27
|
+
if (expectedType === "directory") {
|
|
28
|
+
return stats.isDirectory();
|
|
29
|
+
}
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export async function isExistingDirectory(targetPath) {
|
|
37
|
+
const normalizedPath = typeof targetPath === "string" ? targetPath.trim() : "";
|
|
38
|
+
if (!normalizedPath) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
const stats = await fsp.stat(normalizedPath);
|
|
43
|
+
return stats.isDirectory();
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export async function resolveSessionRunDirectory(sessionPath) {
|
|
50
|
+
const normalizedPath = typeof sessionPath === "string" ? sessionPath.trim() : "";
|
|
51
|
+
if (!normalizedPath) {
|
|
52
|
+
throw new Error("Invalid session path");
|
|
53
|
+
}
|
|
54
|
+
let stats;
|
|
55
|
+
try {
|
|
56
|
+
stats = await fsp.stat(normalizedPath);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
throw new Error(`Session path does not exist: ${normalizedPath}`);
|
|
60
|
+
}
|
|
61
|
+
return stats.isDirectory() ? normalizedPath : path.dirname(normalizedPath);
|
|
62
|
+
}
|
|
63
|
+
export function listCandidateWorkingDirectories(options = {}) {
|
|
64
|
+
const candidates = [];
|
|
65
|
+
const push = (value) => {
|
|
66
|
+
const normalized = typeof value === "string" ? value.trim() : "";
|
|
67
|
+
if (!normalized) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (!candidates.includes(normalized)) {
|
|
71
|
+
candidates.push(normalized);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
push(options.cwd);
|
|
75
|
+
push(options.currentWorkingDirectory);
|
|
76
|
+
push(process.env.PWD);
|
|
77
|
+
push(process.cwd());
|
|
78
|
+
return candidates;
|
|
79
|
+
}
|
|
80
|
+
export async function* iterateJsonlEntries(sessionPath) {
|
|
81
|
+
if (!sessionPath || !sessionPath.endsWith(".jsonl")) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const rl = readline.createInterface({
|
|
85
|
+
input: fs.createReadStream(sessionPath),
|
|
86
|
+
crlfDelay: Infinity,
|
|
87
|
+
});
|
|
88
|
+
for await (const line of rl) {
|
|
89
|
+
const trimmed = line.trim();
|
|
90
|
+
if (!trimmed) {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
let entry;
|
|
94
|
+
try {
|
|
95
|
+
entry = JSON.parse(trimmed);
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
yield entry;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
export function buildResumeContext({ provider, sessionId, sessionPath = null, cwd, cwdSource, extraDebug = {}, }) {
|
|
104
|
+
return {
|
|
105
|
+
provider,
|
|
106
|
+
sessionId,
|
|
107
|
+
sessionPath: sessionPath || null,
|
|
108
|
+
cwd,
|
|
109
|
+
debugMetadata: {
|
|
110
|
+
cwdSource,
|
|
111
|
+
sessionPath: sessionPath || null,
|
|
112
|
+
...extraDebug,
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
}
|
|
@@ -10,6 +10,7 @@ export const COPILOT_PROVIDER_VARIANT: "copilot-sdk";
|
|
|
10
10
|
export const KIMI_PROVIDER_VARIANT: "kimi-cli-wire";
|
|
11
11
|
export const KIMI_PRINT_PROVIDER_VARIANT: "kimi-cli-print";
|
|
12
12
|
export const OPENCODE_PROVIDER_VARIANT: "opencode-sdk";
|
|
13
|
+
import { BUILT_IN_BACKENDS } from "./built-in-backends.js";
|
|
13
14
|
import { CodexAppServerSession } from "./providers/codex-app-server-session.js";
|
|
14
15
|
import { CodexExecSession } from "./providers/codex-exec-session.js";
|
|
15
16
|
import { ClaudeAgentSdkSession } from "./providers/claude-agent-sdk-session.js";
|
|
@@ -17,4 +18,4 @@ import { CopilotSdkSession } from "./providers/copilot-sdk-session.js";
|
|
|
17
18
|
import { KimiCliSession } from "./providers/kimi-cli-session.js";
|
|
18
19
|
import { KimiPrintSession } from "./providers/kimi-print-session.js";
|
|
19
20
|
import { OpencodeSdkSession } from "./providers/opencode-sdk-session.js";
|
|
20
|
-
export { CodexAppServerSession, CodexExecSession, ClaudeAgentSdkSession, CopilotSdkSession, KimiCliSession, KimiPrintSession, OpencodeSdkSession };
|
|
21
|
+
export { BUILT_IN_BACKENDS, CodexAppServerSession, CodexExecSession, ClaudeAgentSdkSession, CopilotSdkSession, KimiCliSession, KimiPrintSession, OpencodeSdkSession };
|
package/dist/session-factory.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BUILT_IN_BACKENDS, CLAUDE_AGENT_SDK_VARIANT, CODEX_APP_SERVER_VARIANT, CODEX_EXEC_VARIANT, COPILOT_SDK_VARIANT, KIMI_CLI_PRINT_VARIANT, KIMI_CLI_WIRE_VARIANT, OPENCODE_SDK_VARIANT, getBuiltInBackendEntry, isBuiltInBackend, listBuiltInBackends, normalizeBuiltInBackend, } from "./built-in-backends.js";
|
|
1
2
|
import { CodexAppServerSession } from "./providers/codex-app-server-session.js";
|
|
2
3
|
import { CodexExecSession } from "./providers/codex-exec-session.js";
|
|
3
4
|
import { ClaudeAgentSdkSession } from "./providers/claude-agent-sdk-session.js";
|
|
@@ -6,13 +7,30 @@ import { KimiCliSession } from "./providers/kimi-cli-session.js";
|
|
|
6
7
|
import { KimiPrintSession } from "./providers/kimi-print-session.js";
|
|
7
8
|
import { OpencodeSdkSession } from "./providers/opencode-sdk-session.js";
|
|
8
9
|
import { getExternalProviderDescriptor, resolveExternalBackend, } from "./external-provider-registry.js";
|
|
9
|
-
export const DEFAULT_PROVIDER_VARIANT =
|
|
10
|
-
export const CODEX_EXEC_PROVIDER_VARIANT =
|
|
11
|
-
export const CLAUDE_PROVIDER_VARIANT =
|
|
12
|
-
export const COPILOT_PROVIDER_VARIANT =
|
|
13
|
-
export const KIMI_PROVIDER_VARIANT =
|
|
14
|
-
export const KIMI_PRINT_PROVIDER_VARIANT =
|
|
15
|
-
export const OPENCODE_PROVIDER_VARIANT =
|
|
10
|
+
export const DEFAULT_PROVIDER_VARIANT = CODEX_APP_SERVER_VARIANT;
|
|
11
|
+
export const CODEX_EXEC_PROVIDER_VARIANT = CODEX_EXEC_VARIANT;
|
|
12
|
+
export const CLAUDE_PROVIDER_VARIANT = CLAUDE_AGENT_SDK_VARIANT;
|
|
13
|
+
export const COPILOT_PROVIDER_VARIANT = COPILOT_SDK_VARIANT;
|
|
14
|
+
export const KIMI_PROVIDER_VARIANT = KIMI_CLI_WIRE_VARIANT;
|
|
15
|
+
export const KIMI_PRINT_PROVIDER_VARIANT = KIMI_CLI_PRINT_VARIANT;
|
|
16
|
+
export const OPENCODE_PROVIDER_VARIANT = OPENCODE_SDK_VARIANT;
|
|
17
|
+
const SESSION_FACTORIES_BY_BACKEND = new Map([
|
|
18
|
+
[
|
|
19
|
+
"codex",
|
|
20
|
+
(backend, options) => hasStructuredOutputPreference(options)
|
|
21
|
+
? new CodexExecSession(backend, options)
|
|
22
|
+
: new CodexAppServerSession(backend, options),
|
|
23
|
+
],
|
|
24
|
+
["claude", (backend, options) => new ClaudeAgentSdkSession(backend, options)],
|
|
25
|
+
["copilot", (backend, options) => new CopilotSdkSession(backend, options)],
|
|
26
|
+
[
|
|
27
|
+
"kimi",
|
|
28
|
+
(backend, options) => hasStructuredOutputPreference(options)
|
|
29
|
+
? new KimiPrintSession(backend, options)
|
|
30
|
+
: new KimiCliSession(backend, options),
|
|
31
|
+
],
|
|
32
|
+
["opencode", (backend, options) => new OpencodeSdkSession(backend, options)],
|
|
33
|
+
]);
|
|
16
34
|
function hasStructuredOutputPreference(options = {}) {
|
|
17
35
|
if (!options || typeof options !== "object") {
|
|
18
36
|
return false;
|
|
@@ -34,32 +52,16 @@ function hasStructuredOutputPreference(options = {}) {
|
|
|
34
52
|
}
|
|
35
53
|
return false;
|
|
36
54
|
}
|
|
37
|
-
function normalizeBuiltInBackendName(backend) {
|
|
38
|
-
const normalized = String(backend || "").trim().toLowerCase();
|
|
39
|
-
if (normalized === "code") {
|
|
40
|
-
return "codex";
|
|
41
|
-
}
|
|
42
|
-
if (normalized === "claude-code") {
|
|
43
|
-
return "claude";
|
|
44
|
-
}
|
|
45
|
-
if (normalized === "open-code" || normalized === "open_code") {
|
|
46
|
-
return "opencode";
|
|
47
|
-
}
|
|
48
|
-
if (normalized === "kimi-cli" || normalized === "kimi-code") {
|
|
49
|
-
return "kimi";
|
|
50
|
-
}
|
|
51
|
-
return normalized;
|
|
52
|
-
}
|
|
53
55
|
export async function normalizeBackend(backend, options = {}) {
|
|
54
|
-
const normalized =
|
|
55
|
-
if (normalized
|
|
56
|
+
const normalized = normalizeBuiltInBackend(backend);
|
|
57
|
+
if (isBuiltInBackend(normalized)) {
|
|
56
58
|
return normalized;
|
|
57
59
|
}
|
|
58
60
|
return await resolveExternalBackend(normalized, options);
|
|
59
61
|
}
|
|
60
62
|
export async function isSupportedBackend(backend, options = {}) {
|
|
61
63
|
const normalized = await normalizeBackend(backend, options);
|
|
62
|
-
if (normalized
|
|
64
|
+
if (isBuiltInBackend(normalized)) {
|
|
63
65
|
return true;
|
|
64
66
|
}
|
|
65
67
|
const descriptor = await getExternalProviderDescriptor(normalized, options);
|
|
@@ -67,20 +69,12 @@ export async function isSupportedBackend(backend, options = {}) {
|
|
|
67
69
|
}
|
|
68
70
|
export async function providerVariantForBackend(backend, options = {}) {
|
|
69
71
|
const normalized = await normalizeBackend(backend, options);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (normalized === "kimi") {
|
|
77
|
-
return hasStructuredOutputPreference(options) ? KIMI_PRINT_PROVIDER_VARIANT : KIMI_PROVIDER_VARIANT;
|
|
78
|
-
}
|
|
79
|
-
if (normalized === "opencode") {
|
|
80
|
-
return OPENCODE_PROVIDER_VARIANT;
|
|
81
|
-
}
|
|
82
|
-
if (normalized === "codex") {
|
|
83
|
-
return hasStructuredOutputPreference(options) ? CODEX_EXEC_PROVIDER_VARIANT : DEFAULT_PROVIDER_VARIANT;
|
|
72
|
+
const entry = getBuiltInBackendEntry(normalized);
|
|
73
|
+
if (entry) {
|
|
74
|
+
if (entry.structuredVariant && hasStructuredOutputPreference(options)) {
|
|
75
|
+
return entry.structuredVariant;
|
|
76
|
+
}
|
|
77
|
+
return entry.defaultVariant;
|
|
84
78
|
}
|
|
85
79
|
const descriptor = await getExternalProviderDescriptor(normalized, options);
|
|
86
80
|
if (descriptor?.variant) {
|
|
@@ -90,37 +84,20 @@ export async function providerVariantForBackend(backend, options = {}) {
|
|
|
90
84
|
}
|
|
91
85
|
export async function assertSupportedBackend(backend, options = {}) {
|
|
92
86
|
const normalized = await normalizeBackend(backend, options);
|
|
93
|
-
if (normalized
|
|
87
|
+
if (isBuiltInBackend(normalized)) {
|
|
94
88
|
return normalized;
|
|
95
89
|
}
|
|
96
90
|
const descriptor = await getExternalProviderDescriptor(normalized, options);
|
|
97
91
|
if (descriptor) {
|
|
98
92
|
return normalized;
|
|
99
93
|
}
|
|
100
|
-
throw new Error(`Unsupported AI SDK backend "${backend}". Built-in backends are
|
|
94
|
+
throw new Error(`Unsupported AI SDK backend "${backend}". Built-in backends are ${listBuiltInBackends().join(", ")}. Set AISDK_PROVIDER_PATH to load external providers.`);
|
|
101
95
|
}
|
|
102
96
|
export async function createLocalAiSession(backend, options = {}) {
|
|
103
97
|
const normalized = await assertSupportedBackend(backend, options);
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
if (normalized === "copilot") {
|
|
108
|
-
return new CopilotSdkSession(normalized, options);
|
|
109
|
-
}
|
|
110
|
-
if (normalized === "kimi") {
|
|
111
|
-
if (hasStructuredOutputPreference(options)) {
|
|
112
|
-
return new KimiPrintSession(normalized, options);
|
|
113
|
-
}
|
|
114
|
-
return new KimiCliSession(normalized, options);
|
|
115
|
-
}
|
|
116
|
-
if (normalized === "opencode") {
|
|
117
|
-
return new OpencodeSdkSession(normalized, options);
|
|
118
|
-
}
|
|
119
|
-
if (normalized === "codex") {
|
|
120
|
-
if (hasStructuredOutputPreference(options)) {
|
|
121
|
-
return new CodexExecSession(normalized, options);
|
|
122
|
-
}
|
|
123
|
-
return new CodexAppServerSession(normalized, options);
|
|
98
|
+
const factory = SESSION_FACTORIES_BY_BACKEND.get(normalized);
|
|
99
|
+
if (factory) {
|
|
100
|
+
return factory(normalized, options);
|
|
124
101
|
}
|
|
125
102
|
const descriptor = await getExternalProviderDescriptor(normalized, options);
|
|
126
103
|
if (!descriptor) {
|
|
@@ -128,6 +105,7 @@ export async function createLocalAiSession(backend, options = {}) {
|
|
|
128
105
|
}
|
|
129
106
|
return await descriptor.createSession(normalized, options);
|
|
130
107
|
}
|
|
108
|
+
export { BUILT_IN_BACKENDS };
|
|
131
109
|
export { CodexAppServerSession };
|
|
132
110
|
export { CodexExecSession };
|
|
133
111
|
export { ClaudeAgentSdkSession };
|
package/package.json
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@love-moon/ai-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/lovemoon-ai/conductor.git"
|
|
7
|
+
},
|
|
4
8
|
"type": "module",
|
|
5
9
|
"main": "dist/index.js",
|
|
6
10
|
"types": "dist/index.d.ts",
|
|
7
11
|
"files": [
|
|
8
|
-
"dist"
|
|
12
|
+
"dist",
|
|
13
|
+
"CHANGELOG.md"
|
|
9
14
|
],
|
|
10
15
|
"publishConfig": {
|
|
11
|
-
"access": "public"
|
|
16
|
+
"access": "public",
|
|
17
|
+
"provenance": true
|
|
12
18
|
},
|
|
13
19
|
"scripts": {
|
|
14
20
|
"build": "tsc -p tsconfig.json",
|
|
@@ -26,5 +32,5 @@
|
|
|
26
32
|
"@types/node": "^22.10.2",
|
|
27
33
|
"typescript": "^5.6.3"
|
|
28
34
|
},
|
|
29
|
-
"gitCommitId": "
|
|
35
|
+
"gitCommitId": "03b4582"
|
|
30
36
|
}
|
package/dist/resume.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export function resumeProviderForBackend(backend: any): "codex" | "claude" | "copilot" | null;
|
|
2
|
-
export function findSessionPath(provider: any, sessionId: any, options?: {}): Promise<any>;
|
|
3
|
-
export function findCodexSessionPath(sessionId: any, options?: {}): Promise<string | null>;
|
|
4
|
-
export function findClaudeSessionPath(sessionId: any, options?: {}): Promise<any>;
|
|
5
|
-
export function findCopilotSessionPath(sessionId: any, options?: {}): Promise<string | null>;
|
|
6
|
-
export function resolveSessionRunDirectory(sessionPath: any): Promise<string>;
|
|
7
|
-
export function inspectResumeTarget(backend: any, sessionId: any, options?: {}): Promise<{
|
|
8
|
-
provider: string;
|
|
9
|
-
sessionId: string;
|
|
10
|
-
sessionPath: any;
|
|
11
|
-
cwd: string;
|
|
12
|
-
debugMetadata: {
|
|
13
|
-
cwdSource: string;
|
|
14
|
-
sessionPath: any;
|
|
15
|
-
};
|
|
16
|
-
}>;
|
|
17
|
-
export function resolveResumeContext(backend: any, sessionId: any, options?: {}): Promise<{
|
|
18
|
-
provider: string;
|
|
19
|
-
sessionId: string;
|
|
20
|
-
sessionPath: any;
|
|
21
|
-
cwd: string;
|
|
22
|
-
debugMetadata: {
|
|
23
|
-
cwdSource: string;
|
|
24
|
-
sessionPath: any;
|
|
25
|
-
};
|
|
26
|
-
}>;
|