priiisk 0.1.1 → 0.1.3
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/{chunk-FZICDHTN.js → chunk-4IQLMJ25.js} +32 -7
- package/dist/{chunk-F77DHFYU.js → chunk-C7GQZ3PV.js} +1 -1
- package/dist/{chunk-YCBBC5MH.js → chunk-GCJD6IMI.js} +1 -1
- package/dist/{chunk-RJO6Z3SQ.js → chunk-T6NUWP6F.js} +217 -81
- package/dist/{chunk-UCN75R46.js → chunk-VHGA3U67.js} +2 -2
- package/dist/priiisk-host.js +5 -5
- package/dist/priiisk.js +54 -23
- package/package.json +8 -8
- /package/dist/{chunk-YCBBC5MH.js.LEGAL.txt → chunk-GCJD6IMI.js.LEGAL.txt} +0 -0
- /package/dist/{chunk-RJO6Z3SQ.js.LEGAL.txt → chunk-T6NUWP6F.js.LEGAL.txt} +0 -0
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
makeDoctorReport,
|
|
9
9
|
resolveCampSurface,
|
|
10
10
|
withCampRpc
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-VHGA3U67.js";
|
|
12
12
|
import {
|
|
13
13
|
PI_RUNTIME_VERSION,
|
|
14
14
|
PiModelCatalogIssueCode,
|
|
15
15
|
inspectPiModelCatalog,
|
|
16
16
|
makePiOperatorResources
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-GCJD6IMI.js";
|
|
18
18
|
import {
|
|
19
19
|
CampHealthComponentStatus,
|
|
20
20
|
CampHealthOverallStatus,
|
|
@@ -32,16 +32,19 @@ import {
|
|
|
32
32
|
campManifestHostGeneration,
|
|
33
33
|
campProjectPaths,
|
|
34
34
|
campRecoveryDiagnosticFromCause,
|
|
35
|
+
describeProjectConfigOverrides,
|
|
35
36
|
findCampControllerHealthFailure,
|
|
36
37
|
findCampRecoveryHealthComponent,
|
|
37
38
|
listWorkerModelCatalogEntries,
|
|
38
39
|
loadCampHealth,
|
|
39
40
|
loadCampManifest,
|
|
41
|
+
loadProjectWorkerConfig,
|
|
40
42
|
loadWorkerConfig,
|
|
43
|
+
projectConfigPath,
|
|
41
44
|
resolveCredentialsPath,
|
|
42
45
|
resolveProjectScope,
|
|
43
46
|
resolveWorkerConfigPath
|
|
44
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-T6NUWP6F.js";
|
|
45
48
|
import {
|
|
46
49
|
Clock_exports,
|
|
47
50
|
Effect_exports,
|
|
@@ -71,12 +74,34 @@ var checkRuntime = () => {
|
|
|
71
74
|
}
|
|
72
75
|
);
|
|
73
76
|
};
|
|
74
|
-
var
|
|
77
|
+
var projectConfigDetails = (fs) => resolveProjectScope.pipe(
|
|
78
|
+
Effect_exports.flatMap(
|
|
79
|
+
(scope) => loadProjectWorkerConfig(fs, scope.cwd).pipe(
|
|
80
|
+
Effect_exports.map(
|
|
81
|
+
(project) => project === void 0 ? {} : {
|
|
82
|
+
projectConfigPath: projectConfigPath(scope.cwd),
|
|
83
|
+
projectOverrides: describeProjectConfigOverrides(project)
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
Effect_exports.catchAll(() => Effect_exports.succeed({ projectConfigPath: projectConfigPath(scope.cwd) }))
|
|
87
|
+
)
|
|
88
|
+
)
|
|
89
|
+
);
|
|
90
|
+
var checkConfig = (fs) => Effect_exports.all([resolveWorkerConfigPath, loadWorkerConfig(fs), projectConfigDetails(fs)]).pipe(
|
|
75
91
|
Effect_exports.map(
|
|
76
|
-
([path, config]) => config === void 0 ? doctorCheck("config", DoctorCheckStatus.warning, "User config is missing", {
|
|
92
|
+
([path, config, project]) => config === void 0 ? doctorCheck("config", DoctorCheckStatus.warning, "User config is missing", {
|
|
77
93
|
path,
|
|
78
|
-
|
|
79
|
-
})
|
|
94
|
+
...project
|
|
95
|
+
}) : doctorCheck(
|
|
96
|
+
"config",
|
|
97
|
+
DoctorCheckStatus.pass,
|
|
98
|
+
project.projectOverrides === void 0 ? "TOML config is valid" : `TOML config is valid, ${String(project.projectOverrides.length)} field(s) overridden by the project`,
|
|
99
|
+
{
|
|
100
|
+
path,
|
|
101
|
+
schemaVersion: config.schemaVersion,
|
|
102
|
+
...project
|
|
103
|
+
}
|
|
104
|
+
)
|
|
80
105
|
),
|
|
81
106
|
Effect_exports.catchAll(
|
|
82
107
|
(cause) => resolveWorkerConfigPath.pipe(
|
|
@@ -9008,10 +9008,10 @@ var CloseLatch = /* @__PURE__ */ Reference()("@effect/platform/WorkerRunner/Clos
|
|
|
9008
9008
|
var PlatformRunner2 = PlatformRunner;
|
|
9009
9009
|
var CloseLatch2 = CloseLatch;
|
|
9010
9010
|
|
|
9011
|
-
// packages/config/src/project/
|
|
9011
|
+
// packages/config/src/project/projectScope.ts
|
|
9012
9012
|
import { createHash } from "node:crypto";
|
|
9013
|
-
import {
|
|
9014
|
-
import { join as join3, resolve as resolve4 } from "node:path";
|
|
9013
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
9014
|
+
import { basename, dirname, join as join3, parse as parse3, resolve as resolve4 } from "node:path";
|
|
9015
9015
|
|
|
9016
9016
|
// packages/config/src/loaders/storageRoots.ts
|
|
9017
9017
|
import { homedir } from "node:os";
|
|
@@ -9027,78 +9027,22 @@ var resolveConfigRootSync = () => xdgRoot("XDG_CONFIG_HOME", join2(homedir(), ".
|
|
|
9027
9027
|
var resolveStateRootSync = () => configuredRoot(PRIIISK_STATE_ROOT_ENV) ?? xdgRoot("XDG_STATE_HOME", join2(homedir(), ".local", "state"));
|
|
9028
9028
|
var resolveCacheRootSync = () => configuredRoot(PRIIISK_CACHE_ROOT_ENV) ?? xdgRoot("XDG_CACHE_HOME", join2(homedir(), ".cache"));
|
|
9029
9029
|
|
|
9030
|
-
// packages/config/src/project/projectPaths.ts
|
|
9031
|
-
var PRIIISK_RUNTIME_DIR_ENV = "PRIIISK_RUNTIME_DIR";
|
|
9032
|
-
var PRIIISK_PI_AGENT_DIR_ENV = "PRIIISK_PI_AGENT_DIR";
|
|
9033
|
-
var campRunStorageKey = (runId) => createHash("sha256").update(runId).digest("hex").slice(0, 24);
|
|
9034
|
-
var campRunPaths = (paths, runId) => {
|
|
9035
|
-
const runDir = join3(paths.runsDir, campRunStorageKey(runId));
|
|
9036
|
-
const controllerDir = join3(runDir, "controller");
|
|
9037
|
-
return {
|
|
9038
|
-
runDir,
|
|
9039
|
-
manifestPath: join3(runDir, "camp.json"),
|
|
9040
|
-
sessionsDir: join3(runDir, "sessions"),
|
|
9041
|
-
controllerDir,
|
|
9042
|
-
eventsDir: join3(controllerDir, "events"),
|
|
9043
|
-
consumersPath: join3(controllerDir, "consumers.json"),
|
|
9044
|
-
receiptsPath: join3(controllerDir, "receipts.json")
|
|
9045
|
-
};
|
|
9046
|
-
};
|
|
9047
|
-
var runtimeOwner = () => {
|
|
9048
|
-
const uid = process.getuid?.();
|
|
9049
|
-
return uid === void 0 ? "user" : String(uid);
|
|
9050
|
-
};
|
|
9051
|
-
var resolveRuntimeDirSync = () => {
|
|
9052
|
-
const override = process.env[PRIIISK_RUNTIME_DIR_ENV]?.trim();
|
|
9053
|
-
if (override !== void 0 && override !== "") return resolve4(override);
|
|
9054
|
-
const platformRuntime = process.env.XDG_RUNTIME_DIR?.trim();
|
|
9055
|
-
if (platformRuntime !== void 0 && platformRuntime !== "") {
|
|
9056
|
-
return join3(resolve4(platformRuntime), "priiisk");
|
|
9057
|
-
}
|
|
9058
|
-
return join3(tmpdir(), `priiisk-${runtimeOwner()}`);
|
|
9059
|
-
};
|
|
9060
|
-
var campProjectPaths = (scope3) => {
|
|
9061
|
-
const runtimeDir = resolveRuntimeDirSync();
|
|
9062
|
-
const controllerDir = join3(scope3.stateDir, "controller");
|
|
9063
|
-
return {
|
|
9064
|
-
stateDir: scope3.stateDir,
|
|
9065
|
-
runsDir: join3(scope3.stateDir, "runs"),
|
|
9066
|
-
quarantineDir: join3(scope3.stateDir, "quarantine"),
|
|
9067
|
-
sessionsDir: join3(scope3.stateDir, "sessions"),
|
|
9068
|
-
controllerDir,
|
|
9069
|
-
eventsDir: join3(controllerDir, "events"),
|
|
9070
|
-
consumersPath: join3(controllerDir, "consumers.json"),
|
|
9071
|
-
receiptsPath: join3(controllerDir, "receipts.json"),
|
|
9072
|
-
agentDir: join3(scope3.stateDir, "pi-agent"),
|
|
9073
|
-
logsDir: join3(scope3.stateDir, "logs"),
|
|
9074
|
-
cacheDir: join3(resolveCacheRootSync(), "projects", scope3.hash),
|
|
9075
|
-
runtimeDir,
|
|
9076
|
-
socketPath: join3(runtimeDir, `${scope3.hash}.sock`),
|
|
9077
|
-
lifecycleLockPath: join3(runtimeDir, `${scope3.hash}.lifecycle.lock`),
|
|
9078
|
-
manifestPath: join3(scope3.stateDir, "camp.json"),
|
|
9079
|
-
healthPath: join3(scope3.stateDir, "logs", "health.json")
|
|
9080
|
-
};
|
|
9081
|
-
};
|
|
9082
|
-
|
|
9083
9030
|
// packages/config/src/project/projectScope.ts
|
|
9084
|
-
import { createHash as createHash2 } from "node:crypto";
|
|
9085
|
-
import { existsSync, realpathSync } from "node:fs";
|
|
9086
|
-
import { basename, dirname, join as join4, parse as parse3, resolve as resolve5 } from "node:path";
|
|
9087
9031
|
var PRIIISK_PROJECT_CWD_ENV = "PRIIISK_PROJECT_CWD";
|
|
9088
9032
|
var PROJECTS_DIR_NAME = "projects";
|
|
9089
9033
|
var PROJECT_HASH_HEX_LENGTH = 12;
|
|
9090
|
-
var normalizeProjectCwd = (cwd) => realpathSync.native(
|
|
9034
|
+
var normalizeProjectCwd = (cwd) => realpathSync.native(resolve4(cwd));
|
|
9091
9035
|
var findProjectRootSync = (cwd) => {
|
|
9092
9036
|
let current = normalizeProjectCwd(cwd);
|
|
9093
9037
|
const filesystemRoot = parse3(current).root;
|
|
9094
9038
|
while (current !== filesystemRoot) {
|
|
9095
|
-
if (existsSync(
|
|
9039
|
+
if (existsSync(join3(current, ".git"))) return current;
|
|
9096
9040
|
current = dirname(current);
|
|
9097
9041
|
}
|
|
9098
|
-
return existsSync(
|
|
9042
|
+
return existsSync(join3(filesystemRoot, ".git")) ? filesystemRoot : normalizeProjectCwd(cwd);
|
|
9099
9043
|
};
|
|
9100
|
-
var projectHashFromCwd = (cwd) =>
|
|
9101
|
-
var projectStateDirFromHash = (hash) =>
|
|
9044
|
+
var projectHashFromCwd = (cwd) => createHash("sha256").update(normalizeProjectCwd(cwd)).digest("hex").slice(0, PROJECT_HASH_HEX_LENGTH);
|
|
9045
|
+
var projectStateDirFromHash = (hash) => join3(resolveStateRootSync(), PROJECTS_DIR_NAME, hash);
|
|
9102
9046
|
var projectScopeFromCwd = (cwd) => {
|
|
9103
9047
|
const normalized = findProjectRootSync(cwd);
|
|
9104
9048
|
const hash = projectHashFromCwd(normalized);
|
|
@@ -9119,6 +9063,62 @@ var resolveProjectScope = Effect_exports.gen(function* () {
|
|
|
9119
9063
|
return projectScopeFromCwd(cwd);
|
|
9120
9064
|
}).pipe(Effect_exports.catchAll(() => Effect_exports.succeed(resolveProjectScopeSync())));
|
|
9121
9065
|
|
|
9066
|
+
// packages/config/src/project/projectPaths.ts
|
|
9067
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
9068
|
+
import { tmpdir } from "node:os";
|
|
9069
|
+
import { join as join4, resolve as resolve5 } from "node:path";
|
|
9070
|
+
var PRIIISK_RUNTIME_DIR_ENV = "PRIIISK_RUNTIME_DIR";
|
|
9071
|
+
var PRIIISK_PI_AGENT_DIR_ENV = "PRIIISK_PI_AGENT_DIR";
|
|
9072
|
+
var campRunStorageKey = (runId) => createHash2("sha256").update(runId).digest("hex").slice(0, 24);
|
|
9073
|
+
var campRunPaths = (paths, runId) => {
|
|
9074
|
+
const runDir = join4(paths.runsDir, campRunStorageKey(runId));
|
|
9075
|
+
const controllerDir = join4(runDir, "controller");
|
|
9076
|
+
return {
|
|
9077
|
+
runDir,
|
|
9078
|
+
manifestPath: join4(runDir, "camp.json"),
|
|
9079
|
+
sessionsDir: join4(runDir, "sessions"),
|
|
9080
|
+
controllerDir,
|
|
9081
|
+
eventsDir: join4(controllerDir, "events"),
|
|
9082
|
+
consumersPath: join4(controllerDir, "consumers.json"),
|
|
9083
|
+
receiptsPath: join4(controllerDir, "receipts.json")
|
|
9084
|
+
};
|
|
9085
|
+
};
|
|
9086
|
+
var runtimeOwner = () => {
|
|
9087
|
+
const uid = process.getuid?.();
|
|
9088
|
+
return uid === void 0 ? "user" : String(uid);
|
|
9089
|
+
};
|
|
9090
|
+
var resolveRuntimeDirSync = () => {
|
|
9091
|
+
const override = process.env[PRIIISK_RUNTIME_DIR_ENV]?.trim();
|
|
9092
|
+
if (override !== void 0 && override !== "") return resolve5(override);
|
|
9093
|
+
const platformRuntime = process.env.XDG_RUNTIME_DIR?.trim();
|
|
9094
|
+
if (platformRuntime !== void 0 && platformRuntime !== "") {
|
|
9095
|
+
return join4(resolve5(platformRuntime), "priiisk");
|
|
9096
|
+
}
|
|
9097
|
+
return join4(tmpdir(), `priiisk-${runtimeOwner()}`);
|
|
9098
|
+
};
|
|
9099
|
+
var campProjectPaths = (scope3) => {
|
|
9100
|
+
const runtimeDir = resolveRuntimeDirSync();
|
|
9101
|
+
const controllerDir = join4(scope3.stateDir, "controller");
|
|
9102
|
+
return {
|
|
9103
|
+
stateDir: scope3.stateDir,
|
|
9104
|
+
runsDir: join4(scope3.stateDir, "runs"),
|
|
9105
|
+
quarantineDir: join4(scope3.stateDir, "quarantine"),
|
|
9106
|
+
sessionsDir: join4(scope3.stateDir, "sessions"),
|
|
9107
|
+
controllerDir,
|
|
9108
|
+
eventsDir: join4(controllerDir, "events"),
|
|
9109
|
+
consumersPath: join4(controllerDir, "consumers.json"),
|
|
9110
|
+
receiptsPath: join4(controllerDir, "receipts.json"),
|
|
9111
|
+
agentDir: join4(scope3.stateDir, "pi-agent"),
|
|
9112
|
+
logsDir: join4(scope3.stateDir, "logs"),
|
|
9113
|
+
cacheDir: join4(resolveCacheRootSync(), "projects", scope3.hash),
|
|
9114
|
+
runtimeDir,
|
|
9115
|
+
socketPath: join4(runtimeDir, `${scope3.hash}.sock`),
|
|
9116
|
+
lifecycleLockPath: join4(runtimeDir, `${scope3.hash}.lifecycle.lock`),
|
|
9117
|
+
manifestPath: join4(scope3.stateDir, "camp.json"),
|
|
9118
|
+
healthPath: join4(scope3.stateDir, "logs", "health.json")
|
|
9119
|
+
};
|
|
9120
|
+
};
|
|
9121
|
+
|
|
9122
9122
|
// packages/config/src/domain/configErrors.ts
|
|
9123
9123
|
var StateIoError = class extends Data_exports.TaggedError("StateIoError") {
|
|
9124
9124
|
};
|
|
@@ -9194,8 +9194,8 @@ var loadReferencedMcpCredentials = (fs, names) => Effect_exports.gen(function* (
|
|
|
9194
9194
|
);
|
|
9195
9195
|
});
|
|
9196
9196
|
|
|
9197
|
-
// packages/config/src/loaders/
|
|
9198
|
-
import {
|
|
9197
|
+
// packages/config/src/loaders/projectConfigLoader.ts
|
|
9198
|
+
import { join as join6 } from "node:path";
|
|
9199
9199
|
|
|
9200
9200
|
// node_modules/.pnpm/smol-toml@1.7.0/node_modules/smol-toml/dist/date.js
|
|
9201
9201
|
var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;
|
|
@@ -9966,6 +9966,133 @@ var WorkerDefaultsSchema = Schema_exports.Struct({
|
|
|
9966
9966
|
directTools: Schema_exports.optional(DirectToolsConfigSchema)
|
|
9967
9967
|
});
|
|
9968
9968
|
|
|
9969
|
+
// packages/config/src/schema/projectConfig.ts
|
|
9970
|
+
var ProjectRolePresetSchema = RolePresetSchema.omit("readTools");
|
|
9971
|
+
var ProjectDefaultsSchema = Schema_exports.partial(WorkerDefaultsSchema.omit("readTools"));
|
|
9972
|
+
var ProjectWorkerConfigSchema = Schema_exports.Struct({
|
|
9973
|
+
schemaVersion: Schema_exports.Literal(1),
|
|
9974
|
+
models: Schema_exports.optional(Schema_exports.Record({ key: Schema_exports.String, value: ModelAliasSchema })),
|
|
9975
|
+
roles: Schema_exports.optional(Schema_exports.Record({ key: Schema_exports.String, value: ProjectRolePresetSchema })),
|
|
9976
|
+
hirePresets: Schema_exports.optional(Schema_exports.Record({ key: Schema_exports.String, value: HirePresetSchema })),
|
|
9977
|
+
skillGroups: Schema_exports.optional(SkillGroupsSchema),
|
|
9978
|
+
defaults: Schema_exports.optional(ProjectDefaultsSchema)
|
|
9979
|
+
});
|
|
9980
|
+
var executableReason = (what) => `${what} \u0437\u0430\u0434\u0430\u0435\u0442 \u0442\u043E, \u0447\u0442\u043E \u043B\u0430\u0433\u0435\u0440\u044C \u0437\u0430\u043F\u0443\u0441\u043A\u0430\u0435\u0442, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u0438\u0437 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u043E\u0433\u043E config`;
|
|
9981
|
+
var findProjectConfigForbiddenFields = (parsed) => {
|
|
9982
|
+
if (typeof parsed !== "object" || parsed === null) return [];
|
|
9983
|
+
const found = [];
|
|
9984
|
+
if (Reflect.get(parsed, "mcpServers") !== void 0) {
|
|
9985
|
+
found.push({ field: "mcpServers", reason: executableReason("\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435 MCP-\u0441\u0435\u0440\u0432\u0435\u0440\u0430") });
|
|
9986
|
+
}
|
|
9987
|
+
const defaults = Reflect.get(parsed, "defaults");
|
|
9988
|
+
if (typeof defaults === "object" && defaults !== null && Reflect.get(defaults, "readTools") !== void 0) {
|
|
9989
|
+
found.push({ field: "defaults.readTools", reason: executableReason("\u043A\u0430\u0442\u0430\u043B\u043E\u0433 \u0431\u0438\u043D\u0430\u0440\u0435\u0439") });
|
|
9990
|
+
}
|
|
9991
|
+
const roles = Reflect.get(parsed, "roles");
|
|
9992
|
+
if (typeof roles === "object" && roles !== null) {
|
|
9993
|
+
for (const [role, entry] of Object.entries(roles)) {
|
|
9994
|
+
if (typeof entry === "object" && entry !== null && Reflect.get(entry, "readTools") !== void 0) {
|
|
9995
|
+
found.push({
|
|
9996
|
+
field: `roles.${role}.readTools`,
|
|
9997
|
+
reason: executableReason("\u043A\u0430\u0442\u0430\u043B\u043E\u0433 \u0431\u0438\u043D\u0430\u0440\u0435\u0439 \u0440\u043E\u043B\u0438")
|
|
9998
|
+
});
|
|
9999
|
+
}
|
|
10000
|
+
}
|
|
10001
|
+
}
|
|
10002
|
+
return found;
|
|
10003
|
+
};
|
|
10004
|
+
|
|
10005
|
+
// packages/config/src/loaders/projectConfigLoader.ts
|
|
10006
|
+
var PROJECT_CONFIG_DIRECTORY = ".priiisk";
|
|
10007
|
+
var PROJECT_CONFIG_FILE = "config.toml";
|
|
10008
|
+
var projectConfigPath = (projectCwd) => join6(projectCwd, PROJECT_CONFIG_DIRECTORY, PROJECT_CONFIG_FILE);
|
|
10009
|
+
var decodeProjectConfig = Schema_exports.decodeUnknown(ProjectWorkerConfigSchema, {
|
|
10010
|
+
onExcessProperty: "error"
|
|
10011
|
+
});
|
|
10012
|
+
var loadProjectWorkerConfig = (fs, projectCwd) => Effect_exports.gen(function* () {
|
|
10013
|
+
const path = projectConfigPath(projectCwd);
|
|
10014
|
+
const raw3 = yield* fs.readFileString(path).pipe(
|
|
10015
|
+
Effect_exports.map((content) => content),
|
|
10016
|
+
Effect_exports.catchIf(
|
|
10017
|
+
(error) => error._tag === "SystemError" && error.reason === "NotFound",
|
|
10018
|
+
() => Effect_exports.succeed(void 0)
|
|
10019
|
+
),
|
|
10020
|
+
Effect_exports.mapError((cause) => new WorkerConfigInvalidError({ path, message: String(cause) }))
|
|
10021
|
+
);
|
|
10022
|
+
if (raw3 === void 0) return void 0;
|
|
10023
|
+
const parsed = yield* Effect_exports.try({
|
|
10024
|
+
try: () => parse4(raw3),
|
|
10025
|
+
catch: (cause) => new WorkerConfigInvalidError({ path, message: `\u043D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u044B\u0439 TOML: ${String(cause)}` })
|
|
10026
|
+
});
|
|
10027
|
+
const forbidden = findProjectConfigForbiddenFields(parsed);
|
|
10028
|
+
if (forbidden.length > 0) {
|
|
10029
|
+
return yield* Effect_exports.fail(
|
|
10030
|
+
new WorkerConfigInvalidError({
|
|
10031
|
+
path,
|
|
10032
|
+
message: forbidden.map((entry) => `\u043F\u043E\u043B\u0435 ${entry.field} \u043D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u043E \u0432 project config: ${entry.reason}`).join("; ")
|
|
10033
|
+
})
|
|
10034
|
+
);
|
|
10035
|
+
}
|
|
10036
|
+
return yield* decodeProjectConfig(parsed).pipe(
|
|
10037
|
+
Effect_exports.mapError(
|
|
10038
|
+
(parseError) => new WorkerConfigInvalidError({
|
|
10039
|
+
path,
|
|
10040
|
+
message: `\u043D\u0435 \u043F\u0440\u043E\u0448\u0435\u043B \u0441\u0445\u0435\u043C\u0443: ${String(parseError)}`
|
|
10041
|
+
})
|
|
10042
|
+
)
|
|
10043
|
+
);
|
|
10044
|
+
});
|
|
10045
|
+
var mergeRecords = (user, project, mergeEntry) => {
|
|
10046
|
+
if (project === void 0) return user;
|
|
10047
|
+
const merged = { ...user ?? {} };
|
|
10048
|
+
for (const [key, entry] of Object.entries(project)) {
|
|
10049
|
+
merged[key] = mergeEntry(user?.[key], entry);
|
|
10050
|
+
}
|
|
10051
|
+
return merged;
|
|
10052
|
+
};
|
|
10053
|
+
var mergeWorkerConfigs = (user, project) => {
|
|
10054
|
+
if (project === void 0) return user;
|
|
10055
|
+
const models = { ...user?.models ?? {}, ...project.models ?? {} };
|
|
10056
|
+
const defaults = {
|
|
10057
|
+
...user?.defaults ?? {},
|
|
10058
|
+
...project.defaults ?? {},
|
|
10059
|
+
...user?.defaults?.readTools === void 0 ? {} : { readTools: user.defaults.readTools }
|
|
10060
|
+
};
|
|
10061
|
+
const roles = mergeRecords(user?.roles, project.roles, (userRole, projectRole) => ({
|
|
10062
|
+
...userRole,
|
|
10063
|
+
...projectRole,
|
|
10064
|
+
...userRole?.readTools === void 0 ? {} : { readTools: userRole.readTools }
|
|
10065
|
+
}));
|
|
10066
|
+
const hirePresets = mergeRecords(
|
|
10067
|
+
user?.hirePresets,
|
|
10068
|
+
project.hirePresets,
|
|
10069
|
+
(userPreset, preset) => ({
|
|
10070
|
+
...userPreset,
|
|
10071
|
+
...preset
|
|
10072
|
+
})
|
|
10073
|
+
);
|
|
10074
|
+
const skillGroups = mergeRecords(user?.skillGroups, project.skillGroups, (_, groups) => groups);
|
|
10075
|
+
return {
|
|
10076
|
+
schemaVersion: 1,
|
|
10077
|
+
models,
|
|
10078
|
+
defaults,
|
|
10079
|
+
...roles === void 0 ? {} : { roles },
|
|
10080
|
+
...hirePresets === void 0 ? {} : { hirePresets },
|
|
10081
|
+
...skillGroups === void 0 ? {} : { skillGroups },
|
|
10082
|
+
...user?.mcpServers === void 0 ? {} : { mcpServers: user.mcpServers }
|
|
10083
|
+
};
|
|
10084
|
+
};
|
|
10085
|
+
var describeProjectConfigOverrides = (project) => [
|
|
10086
|
+
...project.defaults === void 0 ? [] : ["defaults"],
|
|
10087
|
+
...project.models === void 0 ? [] : Object.keys(project.models).map((n) => `models.${n}`),
|
|
10088
|
+
...project.roles === void 0 ? [] : Object.keys(project.roles).map((n) => `roles.${n}`),
|
|
10089
|
+
...project.hirePresets === void 0 ? [] : Object.keys(project.hirePresets).map((n) => `hirePresets.${n}`),
|
|
10090
|
+
...project.skillGroups === void 0 ? [] : Object.keys(project.skillGroups).map((n) => `skillGroups.${n}`)
|
|
10091
|
+
];
|
|
10092
|
+
|
|
10093
|
+
// packages/config/src/loaders/userStoragePreparation.ts
|
|
10094
|
+
import { dirname as dirname2 } from "node:path";
|
|
10095
|
+
|
|
9969
10096
|
// packages/config/src/schema/workerConfig.ts
|
|
9970
10097
|
var WorkerConfigSchema = Schema_exports.Struct({
|
|
9971
10098
|
schemaVersion: Schema_exports.Literal(1),
|
|
@@ -9979,7 +10106,7 @@ var WorkerConfigSchema = Schema_exports.Struct({
|
|
|
9979
10106
|
|
|
9980
10107
|
// packages/config/src/loaders/workerConfigLoader.ts
|
|
9981
10108
|
var decodeWorkerConfig = Schema_exports.decodeUnknown(WorkerConfigSchema, { onExcessProperty: "error" });
|
|
9982
|
-
var
|
|
10109
|
+
var loadUserWorkerConfig = (fs) => Effect_exports.gen(function* () {
|
|
9983
10110
|
const configPath = yield* resolveWorkerConfigPath;
|
|
9984
10111
|
const raw3 = yield* fs.readFileString(configPath).pipe(
|
|
9985
10112
|
Effect_exports.map((content) => content),
|
|
@@ -10010,19 +10137,25 @@ var loadWorkerConfig = (fs) => Effect_exports.gen(function* () {
|
|
|
10010
10137
|
)
|
|
10011
10138
|
);
|
|
10012
10139
|
});
|
|
10140
|
+
var loadWorkerConfig = (fs, options4 = {}) => Effect_exports.gen(function* () {
|
|
10141
|
+
const user = yield* loadUserWorkerConfig(fs);
|
|
10142
|
+
const projectCwd = options4.projectCwd ?? (yield* resolveProjectScope.pipe(Effect_exports.map((scope3) => scope3.cwd)));
|
|
10143
|
+
const project = yield* loadProjectWorkerConfig(fs, projectCwd);
|
|
10144
|
+
return mergeWorkerConfigs(user, project);
|
|
10145
|
+
});
|
|
10013
10146
|
|
|
10014
10147
|
// packages/config/src/project/roleProfile.ts
|
|
10015
10148
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
10016
10149
|
|
|
10017
10150
|
// packages/config/src/project/runtimeAssets.ts
|
|
10018
10151
|
import { existsSync as existsSync2 } from "node:fs";
|
|
10019
|
-
import { dirname as dirname3, join as
|
|
10152
|
+
import { dirname as dirname3, join as join7, parse as parse5 } from "node:path";
|
|
10020
10153
|
import { fileURLToPath } from "node:url";
|
|
10021
10154
|
var findAssetRoot = (moduleUrl, directoryName) => {
|
|
10022
10155
|
const root = parse5(fileURLToPath(moduleUrl)).root;
|
|
10023
10156
|
let current = dirname3(fileURLToPath(moduleUrl));
|
|
10024
10157
|
for (; ; ) {
|
|
10025
|
-
const candidate =
|
|
10158
|
+
const candidate = join7(current, directoryName);
|
|
10026
10159
|
if (existsSync2(candidate)) return candidate;
|
|
10027
10160
|
if (current === root) return candidate;
|
|
10028
10161
|
current = dirname3(current);
|
|
@@ -10420,7 +10553,7 @@ var listWorkerModelCatalogEntries = (config) => {
|
|
|
10420
10553
|
|
|
10421
10554
|
// packages/protocol/src/domain/protocolVersion.ts
|
|
10422
10555
|
var PRIIISK_PROTOCOL_VERSION = "11";
|
|
10423
|
-
var PRIIISK_PROTOCOL_PACKAGE_VERSION = "0.1.
|
|
10556
|
+
var PRIIISK_PROTOCOL_PACKAGE_VERSION = "0.1.3";
|
|
10424
10557
|
var ProtocolVersionSchema = Schema_exports.String.pipe(Schema_exports.minLength(1));
|
|
10425
10558
|
|
|
10426
10559
|
// packages/protocol/src/domain/protocolIdentifiers.ts
|
|
@@ -13295,7 +13428,7 @@ var CampProtocol = class extends RpcGroup_exports.make(
|
|
|
13295
13428
|
};
|
|
13296
13429
|
|
|
13297
13430
|
// packages/camp-state/src/bootstrap/campHostVersion.ts
|
|
13298
|
-
var PRIIISK_HOST_VERSION = "0.1.
|
|
13431
|
+
var PRIIISK_HOST_VERSION = "0.1.3";
|
|
13299
13432
|
|
|
13300
13433
|
// packages/surface/src/domain/surfaceModel.ts
|
|
13301
13434
|
var NonEmptyString7 = Schema_exports.String.pipe(Schema_exports.minLength(1));
|
|
@@ -14091,7 +14224,7 @@ var launchCampPrepared = (surface, request, persistIntent, handshake, persist) =
|
|
|
14091
14224
|
|
|
14092
14225
|
// packages/camp-state/src/history/campLegacyState.ts
|
|
14093
14226
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
14094
|
-
import { join as
|
|
14227
|
+
import { join as join8 } from "node:path";
|
|
14095
14228
|
var LEGACY_CAMP_MANIFEST_VERSION = 1;
|
|
14096
14229
|
var CampLegacyStateErrorCode = {
|
|
14097
14230
|
invalidManifest: "legacy_manifest_invalid",
|
|
@@ -14156,7 +14289,7 @@ var moveStateFile = (fs, source, destination, message) => fs.rename(source, dest
|
|
|
14156
14289
|
);
|
|
14157
14290
|
var quarantineLegacyCampState = (fs, paths) => Effect_exports.gen(function* () {
|
|
14158
14291
|
const timestamp = yield* Clock_exports.currentTimeMillis;
|
|
14159
|
-
const directory =
|
|
14292
|
+
const directory = join8(
|
|
14160
14293
|
paths.quarantineDir,
|
|
14161
14294
|
`legacy-v${String(LEGACY_CAMP_MANIFEST_VERSION)}-${String(timestamp)}-${randomUUID4()}`
|
|
14162
14295
|
);
|
|
@@ -14170,8 +14303,8 @@ var quarantineLegacyCampState = (fs, paths) => Effect_exports.gen(function* () {
|
|
|
14170
14303
|
)
|
|
14171
14304
|
)
|
|
14172
14305
|
);
|
|
14173
|
-
const manifestPath =
|
|
14174
|
-
const healthPath =
|
|
14306
|
+
const manifestPath = join8(directory, "camp.json");
|
|
14307
|
+
const healthPath = join8(directory, "health.json");
|
|
14175
14308
|
const hasHealth = yield* fs.exists(paths.healthPath).pipe(
|
|
14176
14309
|
Effect_exports.mapError(
|
|
14177
14310
|
(cause) => legacyError(
|
|
@@ -14224,7 +14357,7 @@ var quarantineLegacyCampState = (fs, paths) => Effect_exports.gen(function* () {
|
|
|
14224
14357
|
});
|
|
14225
14358
|
|
|
14226
14359
|
// packages/camp-state/src/history/campRunCatalog.ts
|
|
14227
|
-
import { join as
|
|
14360
|
+
import { join as join9 } from "node:path";
|
|
14228
14361
|
|
|
14229
14362
|
// packages/camp-state/src/history/campRunCatalogModel.ts
|
|
14230
14363
|
var CampRunCatalogErrorCode = {
|
|
@@ -14314,7 +14447,7 @@ var listCampRuns = (fs, project, paths) => Effect_exports.gen(function* () {
|
|
|
14314
14447
|
);
|
|
14315
14448
|
const historical = yield* Effect_exports.forEach(
|
|
14316
14449
|
entries,
|
|
14317
|
-
(entry) => loadCampManifest(fs,
|
|
14450
|
+
(entry) => loadCampManifest(fs, join9(paths.runsDir, entry, "camp.json")).pipe(
|
|
14318
14451
|
Effect_exports.mapError(
|
|
14319
14452
|
(cause) => catalogError(
|
|
14320
14453
|
"list",
|
|
@@ -14326,7 +14459,7 @@ var listCampRuns = (fs, project, paths) => Effect_exports.gen(function* () {
|
|
|
14326
14459
|
Effect_exports.flatMap(
|
|
14327
14460
|
Option_exports.match({
|
|
14328
14461
|
onNone: () => Effect_exports.succeed(void 0),
|
|
14329
|
-
onSome: (manifest) => campRunPaths(paths, manifest.runId).manifestPath !==
|
|
14462
|
+
onSome: (manifest) => campRunPaths(paths, manifest.runId).manifestPath !== join9(paths.runsDir, entry, "camp.json") ? Effect_exports.fail(
|
|
14330
14463
|
catalogError(
|
|
14331
14464
|
"list",
|
|
14332
14465
|
CampRunCatalogErrorCode.nonCanonicalRun,
|
|
@@ -14638,13 +14771,16 @@ export {
|
|
|
14638
14771
|
AgentRoleSchema,
|
|
14639
14772
|
PiThinkingLevel,
|
|
14640
14773
|
PiThinkingLevelSchema,
|
|
14774
|
+
projectConfigPath,
|
|
14775
|
+
loadProjectWorkerConfig,
|
|
14776
|
+
describeProjectConfigOverrides,
|
|
14777
|
+
projectScopeFromCwd,
|
|
14778
|
+
resolveProjectScopeSync,
|
|
14779
|
+
resolveProjectScope,
|
|
14641
14780
|
loadWorkerConfig,
|
|
14642
14781
|
PRIIISK_PI_AGENT_DIR_ENV,
|
|
14643
14782
|
campRunPaths,
|
|
14644
14783
|
campProjectPaths,
|
|
14645
|
-
projectScopeFromCwd,
|
|
14646
|
-
resolveProjectScopeSync,
|
|
14647
|
-
resolveProjectScope,
|
|
14648
14784
|
resolveRoleProfilePath,
|
|
14649
14785
|
prepareCampStorage,
|
|
14650
14786
|
prepareCampRunStorage,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
layerNet,
|
|
21
21
|
makeCampSurfaceName,
|
|
22
22
|
resolveProjectScopeSync
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-T6NUWP6F.js";
|
|
24
24
|
import {
|
|
25
25
|
Clock_exports,
|
|
26
26
|
Config_exports,
|
|
@@ -111,7 +111,7 @@ var CliSurfaceSelectionError = class extends Data_exports.TaggedError("CliSurfac
|
|
|
111
111
|
import { randomUUID } from "node:crypto";
|
|
112
112
|
|
|
113
113
|
// packages/cli/src/domain/cliVersion.ts
|
|
114
|
-
var PRIIISK_CLI_VERSION = "0.1.
|
|
114
|
+
var PRIIISK_CLI_VERSION = "0.1.3";
|
|
115
115
|
|
|
116
116
|
// packages/cli/src/client/campRpcConnection.ts
|
|
117
117
|
var PRIIISK_CONTROLLER_ID_ENV = "PRIIISK_CONTROLLER_ID";
|
package/dist/priiisk-host.js
CHANGED
|
@@ -4,7 +4,7 @@ const require = __priiiskCreateRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
NodeContext_exports,
|
|
6
6
|
NodeRuntime_exports
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-C7GQZ3PV.js";
|
|
8
8
|
import {
|
|
9
9
|
CampUiBackendError,
|
|
10
10
|
CampUiHealthStatus,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
makePiTransportLayer,
|
|
20
20
|
requirePiModelCatalog,
|
|
21
21
|
require_undici
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-GCJD6IMI.js";
|
|
23
23
|
import {
|
|
24
24
|
AgentRole,
|
|
25
25
|
AgentRoleSchema,
|
|
@@ -96,7 +96,7 @@ import {
|
|
|
96
96
|
runningCampManifest,
|
|
97
97
|
saveCampHealth,
|
|
98
98
|
saveCampManifest
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-T6NUWP6F.js";
|
|
100
100
|
import {
|
|
101
101
|
CampAskRouter,
|
|
102
102
|
CampCancellationCode,
|
|
@@ -22412,7 +22412,7 @@ var Client = class extends Protocol {
|
|
|
22412
22412
|
};
|
|
22413
22413
|
|
|
22414
22414
|
// packages/mcp-backend/src/connections/clientIdentity.ts
|
|
22415
|
-
var backendVersion = "0.1.
|
|
22415
|
+
var backendVersion = "0.1.3";
|
|
22416
22416
|
|
|
22417
22417
|
// packages/mcp-backend/src/connections/mcpFailure.ts
|
|
22418
22418
|
var McpFailure = class extends Data_exports.TaggedError("McpFailure") {
|
|
@@ -26645,7 +26645,7 @@ var acquireLiveCampHost = (options = {}) => Effect_exports.gen(function* () {
|
|
|
26645
26645
|
if (options.manifestRunId !== void 0) {
|
|
26646
26646
|
yield* prepareCampRunStorage(fs, paths, options.manifestRunId);
|
|
26647
26647
|
}
|
|
26648
|
-
const config2 = yield* loadWorkerConfig(fs);
|
|
26648
|
+
const config2 = yield* loadWorkerConfig(fs, { projectCwd: project.cwd });
|
|
26649
26649
|
const piResources = options.piResources ?? (yield* makePiOperatorResources(
|
|
26650
26650
|
options.piAgentDir === void 0 ? {} : { agentDir: options.piAgentDir }
|
|
26651
26651
|
));
|
package/dist/priiisk.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
fromReadable,
|
|
6
6
|
layer,
|
|
7
7
|
runMain
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-C7GQZ3PV.js";
|
|
9
9
|
import {
|
|
10
10
|
CliCampLifecycleError,
|
|
11
11
|
CliEquipmentConflict,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
resolveCampSurface,
|
|
24
24
|
withCampRpc,
|
|
25
25
|
withCampRpcSession
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-VHGA3U67.js";
|
|
27
27
|
import {
|
|
28
28
|
CampCommandFailure,
|
|
29
29
|
CampHostReadiness,
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
resolveProjectScopeSync,
|
|
59
59
|
saveCampManifest,
|
|
60
60
|
startingCampManifest
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-T6NUWP6F.js";
|
|
62
62
|
import {
|
|
63
63
|
Cause_exports,
|
|
64
64
|
CommitPrototype,
|
|
@@ -19082,7 +19082,7 @@ var asksCommand = Command_exports.make(
|
|
|
19082
19082
|
}),
|
|
19083
19083
|
{ operation: "asks", timeoutMs: 15e3 }
|
|
19084
19084
|
).pipe(printValue(json, formatAsks))
|
|
19085
|
-
);
|
|
19085
|
+
).pipe(Command_exports.withDescription("Lists worker questions waiting for the orchestrator."));
|
|
19086
19086
|
var replyCommand = Command_exports.make(
|
|
19087
19087
|
"reply",
|
|
19088
19088
|
{ askId: askIdArgument, answer: answerArgument, file: fileOption, json: jsonOption },
|
|
@@ -19097,7 +19097,7 @@ var replyCommand = Command_exports.make(
|
|
|
19097
19097
|
),
|
|
19098
19098
|
printValue(json, () => "Reply delivered")
|
|
19099
19099
|
)
|
|
19100
|
-
);
|
|
19100
|
+
).pipe(Command_exports.withDescription("Answers a worker question and releases its tool call."));
|
|
19101
19101
|
|
|
19102
19102
|
// packages/cli/src/lifecycle/campLifecycleErrors.ts
|
|
19103
19103
|
var lifecycleError = (operation, code2, message, cause) => new CliCampLifecycleError({
|
|
@@ -19858,6 +19858,10 @@ var pingCommand = Command_exports.make(
|
|
|
19858
19858
|
(result) => result.running ? `Camp ${result.projectHash}, host ${result.hostVersion}, ${result.readiness}, generation ${result.generation}, cursor ${String(result.latestCursor)}` : `Camp ${result.projectHash} \u043D\u0435 \u0437\u0430\u043F\u0443\u0449\u0435\u043D`
|
|
19859
19859
|
)
|
|
19860
19860
|
)
|
|
19861
|
+
).pipe(
|
|
19862
|
+
Command_exports.withDescription(
|
|
19863
|
+
"Answers whether a camp runs for this project, without failing when it does not."
|
|
19864
|
+
)
|
|
19861
19865
|
);
|
|
19862
19866
|
var listCommand = Command_exports.make(
|
|
19863
19867
|
"list",
|
|
@@ -19865,7 +19869,7 @@ var listCommand = Command_exports.make(
|
|
|
19865
19869
|
({ json }) => withCampRpc(({ client, context }) => client.ListWorkers(context), { operation: "list" }).pipe(
|
|
19866
19870
|
printWorkers(json)
|
|
19867
19871
|
)
|
|
19868
|
-
);
|
|
19872
|
+
).pipe(Command_exports.withDescription("Lists the workers of the running camp with their state."));
|
|
19869
19873
|
var formatCampUp = (result) => result.outcome === "already_running" ? `Camp \u0443\u0436\u0435 \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442: ${result.projectHash}, run ${result.runId}, ${result.handshake.readiness}` : `Camp ${result.resumed ? "\u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0435\u043D" : "\u0437\u0430\u043F\u0443\u0449\u0435\u043D"}: ${result.projectHash}, run ${result.runId}, ${result.handshake.readiness}, surface ${result.surface?.providerAlias ?? "unknown"}`;
|
|
19870
19874
|
var formatCampDown = (result) => {
|
|
19871
19875
|
if (result.outcome === "already_stopped") return `Camp \u0443\u0436\u0435 \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D: ${result.projectHash}`;
|
|
@@ -19875,11 +19879,17 @@ var campUpCommand = Command_exports.make(
|
|
|
19875
19879
|
"up",
|
|
19876
19880
|
{ json: jsonOption },
|
|
19877
19881
|
({ json }) => upExternalCamp.pipe(printValue(json, formatCampUp))
|
|
19882
|
+
).pipe(
|
|
19883
|
+
Command_exports.withDescription("Starts a camp for this project, or reports the one already running.")
|
|
19878
19884
|
);
|
|
19879
19885
|
var campContinueCommand = Command_exports.make(
|
|
19880
19886
|
"continue",
|
|
19881
19887
|
{ json: jsonOption },
|
|
19882
19888
|
({ json }) => continueExternalCamp.pipe(printValue(json, formatCampUp))
|
|
19889
|
+
).pipe(
|
|
19890
|
+
Command_exports.withDescription(
|
|
19891
|
+
"Reattaches the last run of this project, keeping its workers and transcripts."
|
|
19892
|
+
)
|
|
19883
19893
|
);
|
|
19884
19894
|
var formatCampRun = (run5) => `${run5.runId}: ${run5.lifecycle}, ${String(run5.workerCount)} workers, ${run5.updatedAt}${run5.active ? " \xB7 active" : ""}`;
|
|
19885
19895
|
var campResumeListCommand = Command_exports.make(
|
|
@@ -19891,7 +19901,7 @@ var campResumeListCommand = Command_exports.make(
|
|
|
19891
19901
|
(runs) => runs.length === 0 ? "No saved runs" : runs.map(formatCampRun).join("\n")
|
|
19892
19902
|
)
|
|
19893
19903
|
)
|
|
19894
|
-
);
|
|
19904
|
+
).pipe(Command_exports.withDescription("Lists saved runs of this project that resume can restore."));
|
|
19895
19905
|
var runIdArgument = Args_exports.text({ name: "runId" }).pipe(Args_exports.optional);
|
|
19896
19906
|
var selectCampRunOnDemand = (items) => Effect_exports.promise(() => import("./chunk-PIZUXHCN.js")).pipe(
|
|
19897
19907
|
Effect_exports.flatMap((ui) => ui.selectCampRun({ items }))
|
|
@@ -19934,18 +19944,21 @@ var campResumeCommand = Command_exports.make(
|
|
|
19934
19944
|
onNone: () => selectAndResume(json),
|
|
19935
19945
|
onSome: (selectedRunId) => resumeExternalCamp(selectedRunId).pipe(printValue(json, formatCampUp))
|
|
19936
19946
|
})
|
|
19937
|
-
).pipe(Command_exports.withSubcommands([campResumeListCommand]))
|
|
19947
|
+
).pipe(Command_exports.withSubcommands([campResumeListCommand])).pipe(
|
|
19948
|
+
Command_exports.withDescription("Restores a saved run by id, or asks which one when no id is given.")
|
|
19949
|
+
);
|
|
19938
19950
|
var campDownCommand = Command_exports.make(
|
|
19939
19951
|
"down",
|
|
19940
19952
|
{ json: jsonOption },
|
|
19941
19953
|
({ json }) => downExternalCamp.pipe(printValue(json, formatCampDown))
|
|
19942
|
-
);
|
|
19954
|
+
).pipe(Command_exports.withDescription("Stops the camp of this project and releases its surface."));
|
|
19943
19955
|
var campOpenCommand = Command_exports.make(
|
|
19944
19956
|
"open",
|
|
19945
19957
|
{ json: jsonOption },
|
|
19946
19958
|
({ json }) => focusExternalCamp.pipe(printValue(json, (result) => `Camp \u043E\u0442\u043A\u0440\u044B\u0442: ${result.projectHash}`))
|
|
19947
|
-
);
|
|
19959
|
+
).pipe(Command_exports.withDescription("Brings the camp cabin to the front."));
|
|
19948
19960
|
var campCommand = Command_exports.make("camp").pipe(
|
|
19961
|
+
Command_exports.withDescription("Camp lifecycle: start, reattach, restore, stop and focus."),
|
|
19949
19962
|
Command_exports.withSubcommands([
|
|
19950
19963
|
campUpCommand,
|
|
19951
19964
|
campContinueCommand,
|
|
@@ -19960,10 +19973,10 @@ var rootCommand = Command_exports.make(
|
|
|
19960
19973
|
() => withCampRpc(({ client, context }) => client.ListWorkers(context), { operation: "status" }).pipe(
|
|
19961
19974
|
printWorkers(false)
|
|
19962
19975
|
)
|
|
19963
|
-
);
|
|
19976
|
+
).pipe(Command_exports.withDescription("Runs and observes a camp of collaborating workers."));
|
|
19964
19977
|
|
|
19965
19978
|
// packages/cli/src/commands/doctorCommand.ts
|
|
19966
|
-
var runDoctorOnDemand = Effect_exports.promise(() => import("./chunk-
|
|
19979
|
+
var runDoctorOnDemand = Effect_exports.promise(() => import("./chunk-4IQLMJ25.js")).pipe(
|
|
19967
19980
|
Effect_exports.flatMap((doctor) => doctor.runDoctor)
|
|
19968
19981
|
);
|
|
19969
19982
|
var statusLabel = {
|
|
@@ -19989,6 +20002,10 @@ var doctorCommand = Command_exports.make(
|
|
|
19989
20002
|
),
|
|
19990
20003
|
Effect_exports.flatMap((report) => Console_exports.log(json ? JSON.stringify(report) : formatDoctor(report)))
|
|
19991
20004
|
)
|
|
20005
|
+
).pipe(
|
|
20006
|
+
Command_exports.withDescription(
|
|
20007
|
+
"Checks the environment, the camp and the model catalog without calling a provider."
|
|
20008
|
+
)
|
|
19992
20009
|
);
|
|
19993
20010
|
|
|
19994
20011
|
// packages/cli/src/commands/equipmentOptions.ts
|
|
@@ -20172,6 +20189,8 @@ var equipCommand = Command_exports.make(
|
|
|
20172
20189
|
),
|
|
20173
20190
|
printValue(json, formatWorker)
|
|
20174
20191
|
)
|
|
20192
|
+
).pipe(
|
|
20193
|
+
Command_exports.withDescription("Changes the equipment of a live worker without recreating its session.")
|
|
20175
20194
|
);
|
|
20176
20195
|
|
|
20177
20196
|
// packages/cli/src/client/campStartupFlow.ts
|
|
@@ -20331,7 +20350,7 @@ var eventsCommand = Command_exports.make(
|
|
|
20331
20350
|
)
|
|
20332
20351
|
);
|
|
20333
20352
|
}
|
|
20334
|
-
);
|
|
20353
|
+
).pipe(Command_exports.withDescription("Reads the camp event journal, once or as a follow."));
|
|
20335
20354
|
|
|
20336
20355
|
// packages/cli/src/commands/hireCommand.ts
|
|
20337
20356
|
var promptArgument = Args_exports.text({ name: "prompt" }).pipe(Args_exports.optional);
|
|
@@ -20377,6 +20396,8 @@ var hireCommand = Command_exports.make(
|
|
|
20377
20396
|
),
|
|
20378
20397
|
printValue(json, formatWorker)
|
|
20379
20398
|
)
|
|
20399
|
+
).pipe(
|
|
20400
|
+
Command_exports.withDescription("Hires a worker with a role, a model and an explicit set of tools.")
|
|
20380
20401
|
);
|
|
20381
20402
|
|
|
20382
20403
|
// packages/cli/src/commands/reconcileCommands.ts
|
|
@@ -20417,7 +20438,7 @@ var reconcileCommand = Command_exports.make(
|
|
|
20417
20438
|
}
|
|
20418
20439
|
).pipe(printValue(json, (result) => formatReconcile(result.reconcile)));
|
|
20419
20440
|
}
|
|
20420
|
-
);
|
|
20441
|
+
).pipe(Command_exports.withDescription("Replays commands a consumer missed and settles its cursor."));
|
|
20421
20442
|
|
|
20422
20443
|
// packages/cli/src/commands/workerCommands.ts
|
|
20423
20444
|
var messageArgument = Args_exports.text({ name: "message" }).pipe(Args_exports.optional);
|
|
@@ -20426,12 +20447,14 @@ var deliveryCommandSpecs = {
|
|
|
20426
20447
|
commandName: "send",
|
|
20427
20448
|
operation: "send",
|
|
20428
20449
|
acceptedMessage: "Message accepted",
|
|
20450
|
+
description: "Sends a message to a worker, steering its current turn.",
|
|
20429
20451
|
invoke: (client, request) => client.Send(request)
|
|
20430
20452
|
},
|
|
20431
20453
|
followUp: {
|
|
20432
20454
|
commandName: "follow-up",
|
|
20433
20455
|
operation: "follow-up",
|
|
20434
20456
|
acceptedMessage: "Follow-up accepted",
|
|
20457
|
+
description: "Queues a message for a worker to read after its current turn.",
|
|
20435
20458
|
invoke: (client, request) => client.FollowUp(request)
|
|
20436
20459
|
}
|
|
20437
20460
|
};
|
|
@@ -20461,7 +20484,7 @@ var makeDeliveryCommand = (specification) => Command_exports.make(
|
|
|
20461
20484
|
),
|
|
20462
20485
|
printValue(json, () => specification.acceptedMessage)
|
|
20463
20486
|
)
|
|
20464
|
-
);
|
|
20487
|
+
).pipe(Command_exports.withDescription(specification.description));
|
|
20465
20488
|
var waitOption = Options_exports.boolean("wait");
|
|
20466
20489
|
var waitTimeoutOption = Options_exports.integer("wait-timeout").pipe(Options_exports.optional);
|
|
20467
20490
|
var DEFAULT_WAIT_TIMEOUT_SECONDS = 300;
|
|
@@ -20509,6 +20532,10 @@ var sendWaitCommand = Command_exports.make(
|
|
|
20509
20532
|
printValue(json, formatDeliveryOutcome)
|
|
20510
20533
|
);
|
|
20511
20534
|
}
|
|
20535
|
+
).pipe(
|
|
20536
|
+
Command_exports.withDescription(
|
|
20537
|
+
"Sends a message to a worker, optionally waiting for the turn to settle."
|
|
20538
|
+
)
|
|
20512
20539
|
);
|
|
20513
20540
|
var openWorkerRetry = Schedule_exports.spaced("50 millis").pipe(Schedule_exports.intersect(Schedule_exports.recurs(20)));
|
|
20514
20541
|
var statusCommand = Command_exports.make(
|
|
@@ -20518,7 +20545,7 @@ var statusCommand = Command_exports.make(
|
|
|
20518
20545
|
({ client, context }) => client.WorkerStatus({ ...context, worker: workerSelector(worker, byId) }),
|
|
20519
20546
|
{ operation: "status" }
|
|
20520
20547
|
).pipe(printValue(json, formatWorker))
|
|
20521
|
-
);
|
|
20548
|
+
).pipe(Command_exports.withDescription("Shows one worker: state, session, equipment and last activity."));
|
|
20522
20549
|
var followUpCommand = makeDeliveryCommand(deliveryCommandSpecs.followUp);
|
|
20523
20550
|
var openCommand = Command_exports.make(
|
|
20524
20551
|
"open",
|
|
@@ -20535,7 +20562,7 @@ var openCommand = Command_exports.make(
|
|
|
20535
20562
|
Effect_exports.zipRight(focusExternalCamp),
|
|
20536
20563
|
printValue(json, () => `Worker \u043E\u0442\u043A\u0440\u044B\u0442: ${worker}`)
|
|
20537
20564
|
)
|
|
20538
|
-
);
|
|
20565
|
+
).pipe(Command_exports.withDescription("Opens the worker session in the cabin."));
|
|
20539
20566
|
var cursorOption2 = Options_exports.integer("cursor").pipe(Options_exports.optional);
|
|
20540
20567
|
var limitOption = Options_exports.integer("limit").pipe(Options_exports.optional);
|
|
20541
20568
|
var lastTurnOption = Options_exports.boolean("last-turn");
|
|
@@ -20559,7 +20586,7 @@ var transcriptCommand = Command_exports.make(
|
|
|
20559
20586
|
}),
|
|
20560
20587
|
{ operation: "transcript", timeoutMs: 3e4 }
|
|
20561
20588
|
).pipe(printValue(json, formatTranscriptPage))
|
|
20562
|
-
);
|
|
20589
|
+
).pipe(Command_exports.withDescription("Prints the stored transcript of a worker, whole or last turn."));
|
|
20563
20590
|
var interruptCommand = Command_exports.make(
|
|
20564
20591
|
"interrupt",
|
|
20565
20592
|
{ worker: workerArgument, byId: byIdOption, json: jsonOption },
|
|
@@ -20571,7 +20598,7 @@ var interruptCommand = Command_exports.make(
|
|
|
20571
20598
|
),
|
|
20572
20599
|
{ operation: "interrupt", timeoutMs: 15e3, retryTransientErrors: true }
|
|
20573
20600
|
).pipe(printValue(json, () => "Turn interrupted"))
|
|
20574
|
-
);
|
|
20601
|
+
).pipe(Command_exports.withDescription("Stops the current turn of a worker, keeping its session alive."));
|
|
20575
20602
|
var forgetCommand = Command_exports.make(
|
|
20576
20603
|
"forget",
|
|
20577
20604
|
{ worker: workerArgument, byId: byIdOption, json: jsonOption },
|
|
@@ -20583,7 +20610,7 @@ var forgetCommand = Command_exports.make(
|
|
|
20583
20610
|
),
|
|
20584
20611
|
{ operation: "forget", timeoutMs: 15e3, retryTransientErrors: true }
|
|
20585
20612
|
).pipe(printValue(json, () => "Worker forgotten"))
|
|
20586
|
-
);
|
|
20613
|
+
).pipe(Command_exports.withDescription("Removes a dismissed worker from the camp roster."));
|
|
20587
20614
|
var dismissMessageOption = Options_exports.text("message").pipe(Options_exports.optional);
|
|
20588
20615
|
var dismissCommand = Command_exports.make(
|
|
20589
20616
|
"dismiss",
|
|
@@ -20605,7 +20632,7 @@ var dismissCommand = Command_exports.make(
|
|
|
20605
20632
|
),
|
|
20606
20633
|
{ operation: "dismiss", timeoutMs: 15e3, retryTransientErrors: true }
|
|
20607
20634
|
).pipe(printValue(json, () => "Worker dismissed"))
|
|
20608
|
-
);
|
|
20635
|
+
).pipe(Command_exports.withDescription("Ends a worker and closes its session."));
|
|
20609
20636
|
|
|
20610
20637
|
// packages/cli/src/application/cliApplication.ts
|
|
20611
20638
|
var consumerOption3 = Options_exports.text("consumer").pipe(Options_exports.optional);
|
|
@@ -20615,7 +20642,11 @@ var stdioCommand = Command_exports.make("stdio", { consumer: consumerOption3 },
|
|
|
20615
20642
|
(argumentsList) => runCliCommand([process.execPath, "priiisk", ...argumentsList]),
|
|
20616
20643
|
consumerId === void 0 ? {} : { consumerId }
|
|
20617
20644
|
);
|
|
20618
|
-
})
|
|
20645
|
+
}).pipe(
|
|
20646
|
+
Command_exports.withDescription(
|
|
20647
|
+
"Runs commands over one long-lived connection, reading them as JSON lines."
|
|
20648
|
+
)
|
|
20649
|
+
);
|
|
20619
20650
|
var command = rootCommand.pipe(
|
|
20620
20651
|
Command_exports.withSubcommands([
|
|
20621
20652
|
pingCommand,
|
|
@@ -20641,7 +20672,7 @@ var command = rootCommand.pipe(
|
|
|
20641
20672
|
);
|
|
20642
20673
|
var cli = Command_exports.run(command, {
|
|
20643
20674
|
name: "priiisk camp control",
|
|
20644
|
-
version: "0.1.
|
|
20675
|
+
version: "0.1.3"
|
|
20645
20676
|
});
|
|
20646
20677
|
var runCliCommand = (argumentsList) => cli(argumentsList).pipe(
|
|
20647
20678
|
Effect_exports.matchEffect({
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "priiisk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "CLI for running and observing a camp of collaborating agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"priiisk": "./dist/priiisk.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
|
-
"dist/chunk-
|
|
11
|
-
"dist/chunk-
|
|
10
|
+
"dist/chunk-4IQLMJ25.js",
|
|
11
|
+
"dist/chunk-C7GQZ3PV.js",
|
|
12
|
+
"dist/chunk-GCJD6IMI.js",
|
|
13
|
+
"dist/chunk-GCJD6IMI.js.LEGAL.txt",
|
|
12
14
|
"dist/chunk-KFSFN6L5.js",
|
|
13
15
|
"dist/chunk-PIZUXHCN.js",
|
|
14
|
-
"dist/chunk-
|
|
15
|
-
"dist/chunk-
|
|
16
|
-
"dist/chunk-
|
|
17
|
-
"dist/chunk-YCBBC5MH.js",
|
|
18
|
-
"dist/chunk-YCBBC5MH.js.LEGAL.txt",
|
|
16
|
+
"dist/chunk-T6NUWP6F.js",
|
|
17
|
+
"dist/chunk-T6NUWP6F.js.LEGAL.txt",
|
|
18
|
+
"dist/chunk-VHGA3U67.js",
|
|
19
19
|
"dist/chunk-Z64QXV3O.js",
|
|
20
20
|
"dist/priiisk-host.js",
|
|
21
21
|
"dist/priiisk.js",
|
|
File without changes
|
|
File without changes
|