larkin 0.4.25 → 0.4.26
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/app/agent-cli.mjs +1 -1
- package/dist/app/agent-config.mjs +9 -3
- package/dist/app/runtime-model-directory.mjs +22 -3
- package/dist/dashboard/dashboard-config-controller.mjs +24 -14
- package/dist/dashboard/dashboard-view-model.mjs +5 -1
- package/dist/dashboard/web/assets/dashboard.css +1 -1
- package/dist/dashboard/web/assets/dashboard.js +15 -15
- package/dist/runtime/pi-distribution-label.cjs +6 -0
- package/dist/runtime/pi-distribution-label.mjs +3 -0
- package/dist/runtime/pi-provider-config.cjs +20 -1
- package/dist/runtime/pi-provider-config.mjs +16 -0
- package/package.json +1 -1
|
@@ -3,19 +3,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PI_PROVIDER_PRESETS = exports.BUNDLED_PI_VERSION = void 0;
|
|
6
|
+
exports.PI_PROVIDER_PRESETS = exports.BUNDLED_PI_VERSION = exports.piDistributionLabel = void 0;
|
|
7
7
|
exports.validatePiBaseUrl = validatePiBaseUrl;
|
|
8
8
|
exports.listProviderModels = listProviderModels;
|
|
9
9
|
exports.resolveBuiltinPiProviderSetupSelection = resolveBuiltinPiProviderSetupSelection;
|
|
10
10
|
exports.validateBuiltinPiProviderSelection = validateBuiltinPiProviderSelection;
|
|
11
11
|
exports.piAgentDirectory = piAgentDirectory;
|
|
12
|
+
exports.ownedPiCatalogAgentDir = ownedPiCatalogAgentDir;
|
|
13
|
+
exports.piCatalogCommandSpec = piCatalogCommandSpec;
|
|
12
14
|
exports.assertBuiltinPiAgentDirectory = assertBuiltinPiAgentDirectory;
|
|
13
15
|
exports.configureBuiltinPiProviderModel = configureBuiltinPiProviderModel;
|
|
14
16
|
exports.stageBuiltinPiProvider = stageBuiltinPiProvider;
|
|
15
17
|
const node_crypto_1 = __importDefault(require("node:crypto"));
|
|
16
18
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
17
19
|
const node_path_1 = __importDefault(require("node:path"));
|
|
20
|
+
const internal_command_js_1 = require("../app/internal-command.cjs");
|
|
18
21
|
const secure_metadata_js_1 = require("../platform/secure-metadata.cjs");
|
|
22
|
+
var pi_distribution_label_js_1 = require("./pi-distribution-label.cjs");
|
|
23
|
+
Object.defineProperty(exports, "piDistributionLabel", { enumerable: true, get: function () { return pi_distribution_label_js_1.piDistributionLabel; } });
|
|
19
24
|
exports.BUNDLED_PI_VERSION = "0.84.2";
|
|
20
25
|
// These values mirror the catalog shipped by the pinned official Pi distribution.
|
|
21
26
|
// Keeping the user-facing defaults here makes endpoint changes reviewable in Larkin.
|
|
@@ -137,6 +142,20 @@ function piAgentDirectory(configDir, agentId) {
|
|
|
137
142
|
throw new Error("Pi Agent ID 格式无效");
|
|
138
143
|
return node_path_1.default.join(node_path_1.default.resolve(configDir), "providers", "pi", agentId);
|
|
139
144
|
}
|
|
145
|
+
/** Catalog/CLI/dashboard must use the Agent-owned provider dir, never host ~/.pi. */
|
|
146
|
+
function ownedPiCatalogAgentDir(configDir, agentId) {
|
|
147
|
+
return piAgentDirectory(configDir, agentId);
|
|
148
|
+
}
|
|
149
|
+
function piCatalogCommandSpec(distribution, env = process.env) {
|
|
150
|
+
if (distribution === "builtin") {
|
|
151
|
+
const spec = (0, internal_command_js_1.internalCommandSpec)("pi-rpc", [], env);
|
|
152
|
+
return { command: spec.command, commandArgs: spec.args };
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
command: env.LARKIN_PI_COMMAND ?? process.env.LARKIN_PI_COMMAND ?? "pi",
|
|
156
|
+
commandArgs: [],
|
|
157
|
+
};
|
|
158
|
+
}
|
|
140
159
|
function assertPrivateDirectory(directory) {
|
|
141
160
|
if (secure_metadata_js_1.isWindows) {
|
|
142
161
|
// Windows 无 POSIX 权限位:icacls 收紧为「当前用户 + SYSTEM」并回读校验。
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import crypto from "node:crypto";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
|
+
import { internalCommandSpec } from "../app/internal-command.mjs";
|
|
4
5
|
import { isWindows, secureWindowsDirectoryAcl } from "../platform/secure-metadata.mjs";
|
|
6
|
+
export { piDistributionLabel } from "./pi-distribution-label.mjs";
|
|
5
7
|
export const BUNDLED_PI_VERSION = "0.84.2";
|
|
6
8
|
// These values mirror the catalog shipped by the pinned official Pi distribution.
|
|
7
9
|
// Keeping the user-facing defaults here makes endpoint changes reviewable in Larkin.
|
|
@@ -123,6 +125,20 @@ export function piAgentDirectory(configDir, agentId) {
|
|
|
123
125
|
throw new Error("Pi Agent ID 格式无效");
|
|
124
126
|
return path.join(path.resolve(configDir), "providers", "pi", agentId);
|
|
125
127
|
}
|
|
128
|
+
/** Catalog/CLI/dashboard must use the Agent-owned provider dir, never host ~/.pi. */
|
|
129
|
+
export function ownedPiCatalogAgentDir(configDir, agentId) {
|
|
130
|
+
return piAgentDirectory(configDir, agentId);
|
|
131
|
+
}
|
|
132
|
+
export function piCatalogCommandSpec(distribution, env = process.env) {
|
|
133
|
+
if (distribution === "builtin") {
|
|
134
|
+
const spec = internalCommandSpec("pi-rpc", [], env);
|
|
135
|
+
return { command: spec.command, commandArgs: spec.args };
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
command: env.LARKIN_PI_COMMAND ?? process.env.LARKIN_PI_COMMAND ?? "pi",
|
|
139
|
+
commandArgs: [],
|
|
140
|
+
};
|
|
141
|
+
}
|
|
126
142
|
function assertPrivateDirectory(directory) {
|
|
127
143
|
if (isWindows) {
|
|
128
144
|
// Windows 无 POSIX 权限位:icacls 收紧为「当前用户 + SYSTEM」并回读校验。
|