robisie 0.2.0 → 0.2.2
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 +32 -0
- package/README.md +4 -2
- package/dist/cli.js +16 -6
- package/dist/commands.d.ts +8 -0
- package/dist/commands.js +90 -3
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/delivery-local.d.ts +2 -2
- package/dist/delivery-local.js +26 -5
- package/dist/disk-guard.d.ts +20 -0
- package/dist/disk-guard.js +63 -0
- package/dist/engine/bundle-report.json +19 -13
- package/dist/engine/tick.cjs +650 -473
- package/dist/engine-inputs.d.ts +13 -0
- package/dist/engine-inputs.js +203 -0
- package/dist/git-commit.d.ts +5 -0
- package/dist/git-commit.js +23 -0
- package/dist/helpers.js +1 -1
- package/dist/k3-codex-role.js +4 -1
- package/dist/k3-helper-cli.js +28 -2
- package/dist/role-registry.d.ts +1 -1
- package/dist/role-registry.js +11 -8
- package/dist/roles.d.ts +1 -1
- package/docs/ENGINE-CONFIG.md +8 -0
- package/docs/README.en.md +8 -4
- package/docs/README.md +9 -5
- package/docs/RELEASE-0.1.0.md +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Ctx } from "./context.js";
|
|
2
|
+
import { type EngineConfig } from "./engine-config.js";
|
|
3
|
+
/** MCP-only installs have no engine; explicit selection never silently falls back. */
|
|
4
|
+
export declare function selectInputDirectory(ctx: Ctx, explicit?: string | null): {
|
|
5
|
+
directory: string;
|
|
6
|
+
configPath?: string;
|
|
7
|
+
} | null;
|
|
8
|
+
export declare function inputDirectory(config: EngineConfig): string;
|
|
9
|
+
export declare function preflightInputs(directory: string, configPath?: string): void;
|
|
10
|
+
/** Inputs belong to the client, not the role manifest or uninstall. */
|
|
11
|
+
export declare function createInputs(directory: string, configPath?: string): void;
|
|
12
|
+
export declare function checkInputs(directory: string, configPath?: string): void;
|
|
13
|
+
export declare const INPUTS_OK = "\u2713 Wej\u015Bcia instalacji: cel projektu i lista ochrony testera s\u0105 gotowe.";
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { accessSync, constants, lstatSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
3
|
+
import { RobisieError, shellQuote } from "./context.js";
|
|
4
|
+
import { CONFIG_FILE, loadEngineConfig } from "./engine-config.js";
|
|
5
|
+
// Every category uses the same segment boundary; fixed extensions stay exact.
|
|
6
|
+
function pathSegment(name, extension = String.raw `(\.[^/\r\n]*)?`) {
|
|
7
|
+
return String.raw `(^|/)(${name})${extension}(/|$)`;
|
|
8
|
+
}
|
|
9
|
+
const DEFAULT_INPUTS = {
|
|
10
|
+
"NORTH-STAR.md": "Dostarczaj sprawdzone zmiany w zakresie kart projektu.\n",
|
|
11
|
+
"tester-safety-v1.txt": [
|
|
12
|
+
"# Chronione ścieżki: zmiany wymagają odbioru.",
|
|
13
|
+
pathSegment("secrets?|credentials?"),
|
|
14
|
+
pathSegment("migrations"),
|
|
15
|
+
pathSegment("drizzle"),
|
|
16
|
+
pathSegment("src/lib/auth"),
|
|
17
|
+
pathSegment("src/lib/payments"),
|
|
18
|
+
pathSegment("src/app/api/auth"),
|
|
19
|
+
pathSegment("src/app/api/webhooks"),
|
|
20
|
+
pathSegment(String.raw `\.github/workflows`),
|
|
21
|
+
pathSegment("deploy", String.raw `\.ya?ml`),
|
|
22
|
+
pathSegment("wrangler", String.raw `\.(toml|jsonc?)`),
|
|
23
|
+
pathSegment(String.raw `\.git`),
|
|
24
|
+
pathSegment(String.raw `\.env[^/\r\n]*`), "",
|
|
25
|
+
].join("\n"),
|
|
26
|
+
};
|
|
27
|
+
function problem(path, configPath) {
|
|
28
|
+
return new RobisieError(`Nie mogę potwierdzić wejść instalacji: ${path}.`, `Sprawdź wskazany plik i jego uprawnienia, potem uruchom \`npx robisie init${configPath ? ` --engine-config ${shellQuote(configPath)}` : ""}\` w katalogu projektu.`);
|
|
29
|
+
}
|
|
30
|
+
function missing(error) { return error?.code === "ENOENT"; }
|
|
31
|
+
/** MCP-only installs have no engine; explicit selection never silently falls back. */
|
|
32
|
+
export function selectInputDirectory(ctx, explicit) {
|
|
33
|
+
const env = ctx.env.ROBISIE_ENGINE_CONFIG;
|
|
34
|
+
const selected = explicit ?? (env?.trim() ? env : undefined);
|
|
35
|
+
const path = resolve(ctx.cwd, selected ?? CONFIG_FILE);
|
|
36
|
+
const configPath = selected === undefined ? undefined : path;
|
|
37
|
+
try {
|
|
38
|
+
if (selected === undefined) {
|
|
39
|
+
try {
|
|
40
|
+
lstatSync(path);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
if (missing(error))
|
|
44
|
+
return null;
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
const raw = JSON.parse(readFileSync(path, "utf8").replace(/^\uFEFF/, ""));
|
|
48
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
49
|
+
throw problem(path);
|
|
50
|
+
if (!Object.hasOwn(raw, "engine"))
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
let config;
|
|
54
|
+
try {
|
|
55
|
+
config = loadEngineConfig(path);
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
if (error instanceof RobisieError)
|
|
59
|
+
throw error;
|
|
60
|
+
if (!(error instanceof Error))
|
|
61
|
+
throw error;
|
|
62
|
+
throw new RobisieError(error.message, `Popraw wskazane pole w pliku konfiguracji, potem sprawdź go offline: npx robisie doctor --engine-config ${shellQuote(path)}`);
|
|
63
|
+
}
|
|
64
|
+
return config.engine.delivery === "local" ? { directory: inputDirectory(config), configPath } : null;
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
if (error instanceof RobisieError)
|
|
68
|
+
throw error;
|
|
69
|
+
throw problem(path, configPath);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export function inputDirectory(config) {
|
|
73
|
+
try {
|
|
74
|
+
if (config.engine.delivery !== "local")
|
|
75
|
+
throw problem(config.configPath);
|
|
76
|
+
// Resolve the client environment, never links in inputs or its contents.
|
|
77
|
+
let existing = resolve(config.stateDir);
|
|
78
|
+
const suffix = ["inputs"];
|
|
79
|
+
while (true) {
|
|
80
|
+
try {
|
|
81
|
+
lstatSync(existing);
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
if (!missing(error))
|
|
86
|
+
throw error;
|
|
87
|
+
suffix.unshift(basename(existing));
|
|
88
|
+
existing = dirname(existing);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return join(realpathSync(existing), ...suffix);
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
if (error instanceof RobisieError)
|
|
95
|
+
throw error;
|
|
96
|
+
throw problem(config.stateDir, config.configPath);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/** Reject links along the write path; do not change modes on user-owned directories. */
|
|
100
|
+
function checkDirectory(directory, writing, configPath) {
|
|
101
|
+
try {
|
|
102
|
+
const parent = dirname(directory);
|
|
103
|
+
if (parent !== directory)
|
|
104
|
+
checkDirectory(parent, false, configPath);
|
|
105
|
+
let stat;
|
|
106
|
+
try {
|
|
107
|
+
stat = lstatSync(directory);
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
if (!missing(error))
|
|
111
|
+
throw error;
|
|
112
|
+
if (!writing)
|
|
113
|
+
return;
|
|
114
|
+
let existing = parent;
|
|
115
|
+
while (true) {
|
|
116
|
+
try {
|
|
117
|
+
lstatSync(existing);
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
catch (cause) {
|
|
121
|
+
if (!missing(cause))
|
|
122
|
+
throw cause;
|
|
123
|
+
existing = dirname(existing);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
accessSync(existing, constants.W_OK | constants.X_OK);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (!stat.isDirectory() || stat.isSymbolicLink())
|
|
130
|
+
throw problem(directory, configPath);
|
|
131
|
+
accessSync(directory, constants.R_OK | constants.X_OK | (writing ? constants.W_OK : 0));
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
if (error instanceof RobisieError)
|
|
135
|
+
throw error;
|
|
136
|
+
throw problem(directory, configPath);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
function readInput(directory, name, configPath) {
|
|
140
|
+
const file = join(directory, name);
|
|
141
|
+
try {
|
|
142
|
+
const stat = lstatSync(file);
|
|
143
|
+
if (!stat.isFile() || stat.isSymbolicLink())
|
|
144
|
+
throw problem(file, configPath);
|
|
145
|
+
const text = new TextDecoder("utf-8", { fatal: true }).decode(readFileSync(file));
|
|
146
|
+
if (!text.trim())
|
|
147
|
+
throw problem(file, configPath);
|
|
148
|
+
if (name === "tester-safety-v1.txt") {
|
|
149
|
+
const rules = text.split(/\r?\n/).map(line => line.trim()).filter(line => line && !line.startsWith("#"));
|
|
150
|
+
if (!rules.length)
|
|
151
|
+
throw problem(file, configPath);
|
|
152
|
+
for (const rule of rules)
|
|
153
|
+
new RegExp(rule, "mi");
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
throw problem(file, configPath);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
export function preflightInputs(directory, configPath) {
|
|
161
|
+
checkDirectory(directory, true, configPath);
|
|
162
|
+
for (const name of Object.keys(DEFAULT_INPUTS)) {
|
|
163
|
+
try {
|
|
164
|
+
lstatSync(join(directory, name));
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
if (missing(error))
|
|
168
|
+
continue;
|
|
169
|
+
throw problem(join(directory, name), configPath);
|
|
170
|
+
}
|
|
171
|
+
readInput(directory, name, configPath);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/** Inputs belong to the client, not the role manifest or uninstall. */
|
|
175
|
+
export function createInputs(directory, configPath) {
|
|
176
|
+
checkDirectory(directory, true, configPath);
|
|
177
|
+
try {
|
|
178
|
+
mkdirSync(directory, { recursive: true, mode: 0o700 });
|
|
179
|
+
const stat = lstatSync(directory);
|
|
180
|
+
if (!stat.isDirectory() || stat.isSymbolicLink())
|
|
181
|
+
throw problem(directory, configPath);
|
|
182
|
+
}
|
|
183
|
+
catch {
|
|
184
|
+
throw problem(directory, configPath);
|
|
185
|
+
}
|
|
186
|
+
for (const [name, content] of Object.entries(DEFAULT_INPUTS)) {
|
|
187
|
+
const file = join(directory, name);
|
|
188
|
+
try {
|
|
189
|
+
writeFileSync(file, content, { flag: "wx", mode: 0o600 });
|
|
190
|
+
}
|
|
191
|
+
catch (error) {
|
|
192
|
+
if (error?.code !== "EEXIST")
|
|
193
|
+
throw problem(file, configPath);
|
|
194
|
+
}
|
|
195
|
+
readInput(directory, name, configPath);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
export function checkInputs(directory, configPath) {
|
|
199
|
+
checkDirectory(directory, false, configPath);
|
|
200
|
+
for (const name of Object.keys(DEFAULT_INPUTS))
|
|
201
|
+
readInput(directory, name, configPath);
|
|
202
|
+
}
|
|
203
|
+
export const INPUTS_OK = "✓ Wejścia instalacji: cel projektu i lista ochrony testera są gotowe.";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
/** Per-command identity only: never persist factory defaults in the client's config. */
|
|
3
|
+
export function gitCommitOptions(args, cwd, timeout = 5_000) {
|
|
4
|
+
const configured = (key) => {
|
|
5
|
+
try {
|
|
6
|
+
return execFileSync("git", ["config", "--get", key], { cwd, encoding: "utf8", timeout, stdio: "pipe" }).trim();
|
|
7
|
+
}
|
|
8
|
+
catch (error) {
|
|
9
|
+
if (error.status === 1)
|
|
10
|
+
return ""; // Config key absent.
|
|
11
|
+
throw new Error(`Nie można odczytać git ${key}`, { cause: error });
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const name = configured("user.name"), email = configured("user.email");
|
|
15
|
+
const env = { ...process.env };
|
|
16
|
+
const complete = [env.GIT_AUTHOR_NAME ?? name, env.GIT_AUTHOR_EMAIL ?? email,
|
|
17
|
+
env.GIT_COMMITTER_NAME ?? name, env.GIT_COMMITTER_EMAIL ?? email].every(value => value.trim() !== "");
|
|
18
|
+
if (!complete) {
|
|
19
|
+
env.GIT_AUTHOR_NAME = env.GIT_COMMITTER_NAME = "robisie";
|
|
20
|
+
env.GIT_AUTHOR_EMAIL = env.GIT_COMMITTER_EMAIL = "robisie@localhost";
|
|
21
|
+
}
|
|
22
|
+
return { args: ["-c", "commit.gpgsign=false", "-c", "tag.gpgsign=false", ...args], env };
|
|
23
|
+
}
|
package/dist/helpers.js
CHANGED
|
@@ -26,7 +26,7 @@ export function runHelper(name) {
|
|
|
26
26
|
return Promise.reject(new RobisieError(`Brak pomocnika ${name} w paczce.`, "W katalogu projektu wykonaj `npm uninstall robisie`, potem `npm i robisie@<wersja-zgodna-z-kontraktem-serwera>` (zastąp placeholder numerem zgodnego wydania), potem lokalne `npx robisie init` i `npx robisie doctor`."));
|
|
27
27
|
}
|
|
28
28
|
return new Promise((resolve, reject) => {
|
|
29
|
-
const failure = (stage) => new RobisieError(`Nie mogę uruchomić lub zakończyć pomocnika ${name}: ${stage}.`, "Sprawdź instalację Node.js (wymagany
|
|
29
|
+
const failure = (stage) => new RobisieError(`Nie mogę uruchomić lub zakończyć pomocnika ${name}: ${stage}.`, "Sprawdź instalację Node.js (wymagany 24+).");
|
|
30
30
|
const detached = process.platform === "darwin" || process.platform === "linux";
|
|
31
31
|
let child;
|
|
32
32
|
try {
|
package/dist/k3-codex-role.js
CHANGED
|
@@ -52,7 +52,10 @@ export function runK3CodexRole(bundle, options, spawn = spawnSync) {
|
|
|
52
52
|
}
|
|
53
53
|
const argv = ["exec", "--json", "--ephemeral", "--skip-git-repo-check", "--ignore-user-config", "--ignore-rules",
|
|
54
54
|
"--model", bundle.execution.model, "-c", `model_reasoning_effort=${JSON.stringify(bundle.execution.effort)}`,
|
|
55
|
-
"-C", options.cwd,
|
|
55
|
+
"-C", options.cwd,
|
|
56
|
+
"-s", options.sandbox,
|
|
57
|
+
...(options.sandbox === "workspace-write" ? ["-c", "sandbox_workspace_write.writable_roots=[]",
|
|
58
|
+
"-c", "sandbox_workspace_write.exclude_slash_tmp=true"] : []), "-"];
|
|
56
59
|
let result;
|
|
57
60
|
try {
|
|
58
61
|
result = spawn(options.binary, argv, { input: bundle.instructions, encoding: "utf8", cwd: options.cwd,
|
package/dist/k3-helper-cli.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
import { accessSync, constants, lstatSync, mkdirSync, readFileSync, realpathSync, statSync } from "node:fs";
|
|
2
3
|
import { basename, delimiter, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
3
4
|
import { fileURLToPath } from "node:url";
|
|
4
5
|
import { cancelK3CodexJob, readK3CodexJob, startK3CodexJob } from "./k3-codex-job.js";
|
|
@@ -42,6 +43,23 @@ function repositoryRoot(cwd) {
|
|
|
42
43
|
return cwd;
|
|
43
44
|
}
|
|
44
45
|
}
|
|
46
|
+
function gitWorktreePaths(root, cwd, env) {
|
|
47
|
+
const marker = lstatSync(join(root, ".git"), { throwIfNoEntry: false });
|
|
48
|
+
if (!marker || marker.isDirectory())
|
|
49
|
+
return undefined;
|
|
50
|
+
if (!marker.isFile())
|
|
51
|
+
invalid();
|
|
52
|
+
// Metadata must describe cwd, never a Git context injected through the environment.
|
|
53
|
+
const gitEnv = { ...env };
|
|
54
|
+
for (const key of Object.keys(gitEnv))
|
|
55
|
+
if (key.startsWith("GIT_"))
|
|
56
|
+
delete gitEnv[key];
|
|
57
|
+
const gitPath = (flag) => realpathSync(execFileSync("git", ["rev-parse", "--path-format=absolute", flag], {
|
|
58
|
+
cwd, env: gitEnv, encoding: "utf8", timeout: 5000, maxBuffer: 64 * 1024, stdio: ["ignore", "pipe", "ignore"],
|
|
59
|
+
}).replace(/\r?\n$/, ""));
|
|
60
|
+
const gitDir = gitPath("--git-dir"), commonDir = gitPath("--git-common-dir");
|
|
61
|
+
return { gitDir, commonDir };
|
|
62
|
+
}
|
|
45
63
|
function executable(path) {
|
|
46
64
|
if (!statSync(path).isFile())
|
|
47
65
|
invalid("EACCES");
|
|
@@ -118,7 +136,8 @@ export async function runK3HelperCli(args, env = process.env) {
|
|
|
118
136
|
const cwd = realpathSync(resolve(values.get("--cwd") ?? process.cwd()));
|
|
119
137
|
if (!statSync(cwd).isDirectory())
|
|
120
138
|
invalid();
|
|
121
|
-
const
|
|
139
|
+
const root = repositoryRoot(cwd);
|
|
140
|
+
const stateRelative = relative(root, physical(stateDir));
|
|
122
141
|
if (!stateRelative || (!stateRelative.startsWith(`..${sep}`) && stateRelative !== ".." && !isAbsolute(stateRelative)))
|
|
123
142
|
invalid();
|
|
124
143
|
if (probe) {
|
|
@@ -136,6 +155,13 @@ export async function runK3HelperCli(args, env = process.env) {
|
|
|
136
155
|
const instructions = readFileSync(resolve(cwd, values.get("--prompt-file")), "utf8");
|
|
137
156
|
if (!instructions.trim())
|
|
138
157
|
invalid();
|
|
158
|
+
const discoveredGit = gitWorktreePaths(root, cwd, env);
|
|
159
|
+
if (discoveredGit)
|
|
160
|
+
for (const gitRoot of [discoveredGit.gitDir, discoveredGit.commonDir]) {
|
|
161
|
+
const stateRelative = relative(gitRoot, physical(stateDir));
|
|
162
|
+
if (!stateRelative || (!stateRelative.startsWith(`..${sep}`) && stateRelative !== ".." && !isAbsolute(stateRelative)))
|
|
163
|
+
invalid();
|
|
164
|
+
}
|
|
139
165
|
const handle = await startK3CodexJob({ disposition: "READY", instructions,
|
|
140
166
|
execution: { provider: "codex", model: values.get("--model"), effort: values.get("--effort") } }, { binary, cwd, env: { ...env, CODEX_HOME: codexHome }, sandbox: values.has("--write") ? "workspace-write" : "read-only",
|
|
141
167
|
timeoutMs: 2700000 }, stateDir);
|
package/dist/role-registry.d.ts
CHANGED
|
@@ -21,5 +21,5 @@ export declare function loadRoleRegistryConfig(path: string): {
|
|
|
21
21
|
config: EngineConfig;
|
|
22
22
|
roleRegistry: EngineRoleRegistry;
|
|
23
23
|
};
|
|
24
|
-
export declare function doctorEngineConfig(ctx: Ctx, path: string): number;
|
|
24
|
+
export declare function doctorEngineConfig(ctx: Ctx, path: string, afterLoad?: (config: EngineConfig) => void): number;
|
|
25
25
|
export {};
|
package/dist/role-registry.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
1
|
+
import { readFileSync, realpathSync } from "node:fs";
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
3
|
import { RobisieError, errorMessage } from "./context.js";
|
|
4
4
|
import { CONFIG_FILE, parseEngineConfig } from "./engine-config.js";
|
|
@@ -55,10 +55,12 @@ export function resolveRoleExecution(registry, role) {
|
|
|
55
55
|
}
|
|
56
56
|
/** One read and one JSON object shared by the K2 and registry validators. */
|
|
57
57
|
export function loadRoleRegistryConfig(path) {
|
|
58
|
-
const
|
|
59
|
-
|
|
58
|
+
const file = resolve(path);
|
|
59
|
+
let configPath = file;
|
|
60
|
+
const retry = `Popraw plik „${file}” (${CONFIG_FILE}) i ponów \`npx robisie doctor --engine-config <path>\` z tą ścieżką.`;
|
|
60
61
|
let contents;
|
|
61
62
|
try {
|
|
63
|
+
configPath = realpathSync(configPath);
|
|
62
64
|
contents = readFileSync(configPath, "utf8");
|
|
63
65
|
}
|
|
64
66
|
catch {
|
|
@@ -69,19 +71,20 @@ export function loadRoleRegistryConfig(path) {
|
|
|
69
71
|
raw = JSON.parse(contents.replace(/^\uFEFF/, ""));
|
|
70
72
|
}
|
|
71
73
|
catch {
|
|
72
|
-
throw new RobisieError(`${
|
|
74
|
+
throw new RobisieError(`${file}: niepoprawny JSON.`, retry);
|
|
73
75
|
}
|
|
74
76
|
let config;
|
|
75
77
|
try {
|
|
76
78
|
config = parseEngineConfig(raw, configPath);
|
|
77
79
|
}
|
|
78
80
|
catch (error) {
|
|
79
|
-
throw new RobisieError(errorMessage(error), retry);
|
|
81
|
+
throw new RobisieError(errorMessage(error).replaceAll(`${configPath}:`, () => `${file}:`), retry);
|
|
80
82
|
}
|
|
81
|
-
return { config, roleRegistry: parseRoleRegistry(raw,
|
|
83
|
+
return { config, roleRegistry: parseRoleRegistry(raw, file) };
|
|
82
84
|
}
|
|
83
|
-
export function doctorEngineConfig(ctx, path) {
|
|
84
|
-
const { roleRegistry } = loadRoleRegistryConfig(resolve(ctx.cwd, path));
|
|
85
|
+
export function doctorEngineConfig(ctx, path, afterLoad) {
|
|
86
|
+
const { roleRegistry, config } = loadRoleRegistryConfig(resolve(ctx.cwd, path));
|
|
87
|
+
afterLoad?.(config);
|
|
85
88
|
for (const role of ROLES) {
|
|
86
89
|
const { name, provider, model, effort } = roleRegistry[role];
|
|
87
90
|
ctx.out(`${role} → ${name} / ${provider} / ${model} / ${effort}`);
|
package/dist/roles.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export interface Role {
|
|
|
17
17
|
export declare function rolesDir(): string;
|
|
18
18
|
export declare function parseRole(file: Role["file"], text: string): Role;
|
|
19
19
|
export declare function loadRoles(dir?: string): Role[];
|
|
20
|
-
export declare const MANAGED_LINE = "<!-- robisie:managed 0.2.
|
|
20
|
+
export declare const MANAGED_LINE = "<!-- robisie:managed 0.2.2 \u2014 plik zarz\u0105dzany przez `npx robisie`; `npx robisie uninstall` go usunie -->";
|
|
21
21
|
export type AgentFlavor = "claude" | "codex" | "opencode";
|
|
22
22
|
/** How the operator starts the Builder for one card in its own session (the card id is not a secret). */
|
|
23
23
|
export declare function builderStartCommand(flavor: AgentFlavor, codexRolePath?: string): string;
|
package/docs/ENGINE-CONFIG.md
CHANGED
|
@@ -111,3 +111,11 @@ odczyt z niezerowym exit i komunikatem na stderr. Na przykład brak `test`
|
|
|
111
111
|
w `engine.commands` daje błąd zawierający `engine.commands.test`, a
|
|
112
112
|
`delivery: "invalid"` — `engine.delivery`. Odczyt nie dopisuje brakujących
|
|
113
113
|
komend ani nie zastępuje błędnego sposobu dostarczenia wartością domyślną.
|
|
114
|
+
|
|
115
|
+
## Wejścia instalacji lokalnej
|
|
116
|
+
|
|
117
|
+
W katalogu projektu z plikiem `robisie.config.json` zawierającym `engine.delivery: "local"` uruchom `npx robisie init`, potem `npx robisie doctor`. Init tworzy brakujące `NORTH-STAR.md` i `tester-safety-v1.txt` w `<stateDir>/inputs`; zachowuje istniejącą treść. Pliki należą do projektu: ponowne init ich nie nadpisuje, a uninstall ich nie usuwa.
|
|
118
|
+
|
|
119
|
+
Domyślny cel brzmi „Dostarczaj sprawdzone zmiany w zakresie kart projektu.” Możesz zastąpić go własnym celem. Lista testera zawiera po jednym wyrażeniu regularnym JavaScript na linię; puste linie i komentarze zaczynające się od `#` są pomijane. Domyślna lista chroni pliki repozytorium i sekretów, migracje, kod uwierzytelniania i płatności oraz konfigurację wdrożeń. Lista klasyfikuje zmiany do odbioru; nie nadaje uprawnień.
|
|
120
|
+
|
|
121
|
+
Dla konfiguracji w innym miejscu użyj `npx robisie init --engine-config /ścieżka/robisie.config.json`. Kolejność wyboru to jawna flaga, `ROBISIE_ENGINE_CONFIG`, następnie plik w bieżącym katalogu. Ścieżki stanu są liczone względem rzeczywistego pliku konfiguracji. Bez konfiguracji silnika zwykłe init nadal instaluje same role i MCP. Jawne `doctor --engine-config <ścieżka>` sprawdza konfigurację i wejścia offline, bez sprawdzania kluczy, uruchamiania dostawców ani wykonywania komend.
|
package/docs/README.en.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
# robisie — from account to accepted card (package 0.2.
|
|
1
|
+
# robisie — from account to accepted card (package 0.2.2)
|
|
2
|
+
|
|
3
|
+
In the project directory with its engine configuration, run `npx robisie init`, then `npx robisie doctor`: init prepares the project goal and tester protection list, and doctor checks both inputs.
|
|
2
4
|
|
|
3
5
|
Polski: [README.md](README.md).
|
|
4
6
|
|
|
5
7
|
<!-- sekcja: dostepnosc -->
|
|
6
8
|
## Availability
|
|
7
9
|
|
|
8
|
-
An account and key are needed for init and the roles. Offline configuration validation is a separate entry point when the CLI is available: it does not check the installation, start providers or require a project UUID from you. Separately, `npx robisie doctor --engine-config ./robisie.config.json` checks
|
|
10
|
+
An account and key are needed for init and the roles. Offline configuration validation is a separate entry point when the CLI is available: it does not check the installation, start providers or require a project UUID from you. Separately, `npx robisie doctor --engine-config ./robisie.config.json` checks configuration structure and local installation inputs offline: it does not confirm project UUID, repo, models or provider execution. The guides shipped in this package are local at `node_modules/robisie/docs/README.md` and `node_modules/robisie/docs/README.en.md`; no website fetch is needed.
|
|
9
11
|
|
|
10
12
|
Install robisie from npm in the prepared directory; run subsequent commands and agent sessions there. [Preparation](#wymagania) → [account](#konto) → [key](#klucz) → [installation](#instalacja) → [acceptance](#recenzja-i-odbior).
|
|
11
13
|
|
|
@@ -19,6 +21,8 @@ The human prepares Node.js 24+ (release used for checks: 24.3.0), npm, internet
|
|
|
19
21
|
|
|
20
22
|
Prepare an empty directory on disk. You do not need a website or your own `package.json`; the Node.js step below creates it before installation. This is the agents' working directory, separate from the dashboard project.
|
|
21
23
|
|
|
24
|
+
The client engine HOLDs work when free space on the installation volume falls below **15 GiB**. Clearing an active HOLD needs **18 GiB** free (hysteresis) — in the 15–18 GiB band a fresh admission is allowed, but an active HOLD does not clear. `npx robisie doctor` prints the measured free space and both thresholds.
|
|
25
|
+
|
|
22
26
|
<!-- sekcja: konto -->
|
|
23
27
|
<a id="konto"></a>
|
|
24
28
|
## Account and first project
|
|
@@ -214,7 +218,7 @@ The human runs this in a terminal with the correct environment, in the installat
|
|
|
214
218
|
npx robisie doctor
|
|
215
219
|
```
|
|
216
220
|
|
|
217
|
-
Doctor checks the contract, project reads, configuration, roles, helper startup
|
|
221
|
+
Doctor checks the contract, project reads, configuration, roles, helper startup, `ROBISIE_KEY`, and free disk on the installation volume. For disk it prints HOLD below 15 GiB and unblock hysteresis from 18 GiB; below 15 GiB it exits 1. It shows the map: null or mixed assignments give exit 1; return to the complete shared-provider assignment in init. “Powyższe kontrole przeszły” means those checks passed, without proving the whole work loop. The “Gotowość wykonawców Codex–Grok” line says separately whether the Codex login (`codex login status`) and Grok login (`grok models`, so only “prawdopodobnie zalogowany”) were checked.
|
|
218
222
|
|
|
219
223
|
Doctor runs the helper file via node, the agent via npx. `ROBISIE_PROJECT_CONTEXT` selects context later and does not change cwd for package lookup. Start the agent in the installation directory and ask it to list available tools from BOTH servers: `client-launch-context` (`get_launch_context`, `get_project_context`, `run_project_check`, `prepare_review`, `create_review_receipt`, `verify_stored_review`) and `ceo-client-launcher` (`spawn_builder`, `verify_review_receipt`). Result: both servers available with all these tools in that session. Do not call spawn_builder just as a probe. If a helper is missing, return to the installation cwd, check the local version and configuration, run init/doctor, then start a fresh agent session. Doctor alone does not confirm provider tool availability.
|
|
220
224
|
|
|
@@ -447,7 +451,7 @@ CLI messages remain in Polish. Match the message, then follow the English explan
|
|
|
447
451
|
Generate a new worker key; in zsh/bash run `unset ROBISIE_KEY`, then init with the hidden prompt.
|
|
448
452
|
- **brak-odczytu** — `Ten klucz nie ma uprawnień do odczytu tablicy (np. rola seeder).`
|
|
449
453
|
Select worker in Connect; `unset ROBISIE_KEY`, then init with the hidden prompt.
|
|
450
|
-
- **major** — `Wersja kontraktu serwera (2.0.0) nie pasuje do paczki robisie 0.2.
|
|
454
|
+
- **major** — `Wersja kontraktu serwera (2.0.0) nie pasuje do paczki robisie 0.2.2 (obsługuje 1.x).`
|
|
451
455
|
Example of a MAJOR mismatch: install a release compatible with the server contract.
|
|
452
456
|
- **brak-env** — `Zmienna ROBISIE_KEY nie jest ustawiona — role i agenci jej potrzebują.`
|
|
453
457
|
Check profile support; with --no-shell/another shell load the key file into the session environment as shown in init, then doctor.
|
package/docs/README.md
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
# robisie — od konta do odebranej karty (paczka 0.2.
|
|
1
|
+
# robisie — od konta do odebranej karty (paczka 0.2.2)
|
|
2
|
+
|
|
3
|
+
W katalogu projektu z konfiguracją silnika uruchom `npx robisie init`, potem `npx robisie doctor`: init przygotuje cel projektu i listę ochrony testera, a doctor sprawdzi oba wejścia.
|
|
2
4
|
|
|
3
5
|
English: [README.en.md](README.en.md).
|
|
4
6
|
|
|
@@ -7,7 +9,7 @@ English: [README.en.md](README.en.md).
|
|
|
7
9
|
<!-- sekcja: dostepnosc -->
|
|
8
10
|
## Dostępność
|
|
9
11
|
|
|
10
|
-
Konto i klucz są potrzebne do init i pracy ról. Osobne wejście to walidacja offline, gdy CLI jest dostępne: nie sprawdza instalacji, nie uruchamia dostawców i nie wymaga podawania UUID projektu. Osobno `npx robisie doctor --engine-config ./robisie.config.json` sprawdza offline
|
|
12
|
+
Konto i klucz są potrzebne do init i pracy ról. Osobne wejście to walidacja offline, gdy CLI jest dostępne: nie sprawdza instalacji, nie uruchamia dostawców i nie wymaga podawania UUID projektu. Osobno `npx robisie doctor --engine-config ./robisie.config.json` sprawdza offline strukturę konfiguracji i wejścia instalacji lokalnej: nie potwierdza UUID projektu, repo, modeli ani uruchomienia dostawców. Przewodniki z tej paczki znajdziesz lokalnie w `node_modules/robisie/docs/README.md` i `node_modules/robisie/docs/README.en.md`; nie trzeba pobierać ich ze strony.
|
|
11
13
|
|
|
12
14
|
Zainstaluj robisie z npm w przygotowanym katalogu; w nim uruchamiaj dalsze polecenia i sesje agentów. [Przygotowanie](#wymagania) → [konto](#konto) → [klucz](#klucz) → [instalacja](#instalacja) → [odbiór](#recenzja-i-odbior).
|
|
13
15
|
|
|
@@ -21,6 +23,8 @@ Człowiek przygotowuje Node.js 24+ (wydanie użyte przy sprawdzeniach: 24.3.0),
|
|
|
21
23
|
|
|
22
24
|
Przygotuj pusty katalog na dysku. Nie potrzebujesz strony ani własnego pliku `package.json`; przed instalacją utworzy go poniższy krok Node.js. To katalog pracy agentów, niezależny od projektu w panelu.
|
|
23
25
|
|
|
26
|
+
Silnik klienta wstrzymuje pracę (HOLD) gdy wolne miejsce na wolumenie instalacji spadnie poniżej **15 GiB**. Odblokowanie aktywnego HOLD wymaga histerezy **18 GiB** wolnego — w paśmie 15–18 GiB nowe wejście jest dopuszczone, ale aktywny HOLD nie znika. `npx robisie doctor` pokazuje zmierzoną wartość oraz oba progi.
|
|
27
|
+
|
|
24
28
|
<!-- sekcja: konto -->
|
|
25
29
|
<a id="konto"></a>
|
|
26
30
|
## Konto i pierwszy projekt
|
|
@@ -214,7 +218,7 @@ Człowiek w terminalu z poprawnym środowiskiem, w katalogu instalacji:
|
|
|
214
218
|
npx robisie doctor
|
|
215
219
|
```
|
|
216
220
|
|
|
217
|
-
Doctor sprawdza kontrakt, odczyt projektów, konfigurację, role, start pomocników
|
|
221
|
+
Doctor sprawdza kontrakt, odczyt projektów, konfigurację, role, start pomocników, `ROBISIE_KEY` oraz wolne miejsce na dysku instalacji. Przy dysku wypisuje HOLD poniżej 15 GiB i histerezę odblokowania od 18 GiB; poniżej 15 GiB kończy się exit 1. Pokazuje mapę: null lub mieszana mapa daje exit 1; wróć do pełnego przypisania jednego dostawcy w sekcji init. „Powyższe kontrole przeszły” oznacza powodzenie tych kontroli, nie pełnej pętli pracy. Linia „Gotowość wykonawców Codex–Grok” mówi osobno, czy sprawdzono logowanie Codex (`codex login status`) i Groka (`grok models`, więc tylko „prawdopodobnie zalogowany”).
|
|
218
222
|
|
|
219
223
|
Doctor uruchamia plik pomocnika przez node, agent przez npx. `ROBISIE_PROJECT_CONTEXT` wybiera kontekst później i nie zmienia cwd szukania paczki. Uruchom agenta w katalogu instalacji i poproś o wyświetlenie dostępnych narzędzi OBU serwerów: `client-launch-context` (`get_launch_context`, `get_project_context`, `run_project_check`, `prepare_review`, `create_review_receipt`, `verify_stored_review`) oraz `ceo-client-launcher` (`spawn_builder`, `verify_review_receipt`). Wynik: oba serwery dostępne z kompletem tych narzędzi w sesji. Nie uruchamiaj spawn_builder tylko dla próby. Przy braku pomocnika wróć do cwd instalacji, sprawdź lokalną wersję i konfigurację, uruchom init/doctor, potem nową sesję agenta. Sam doctor nie potwierdza dostępności narzędzi u dostawcy.
|
|
220
224
|
|
|
@@ -447,7 +451,7 @@ Komunikaty CLI pozostają po polsku. Dopasuj komunikat, a potem wykonaj wskazan
|
|
|
447
451
|
Wygeneruj nowy klucz worker; w zsh/bash wykonaj `unset ROBISIE_KEY`, potem init z ukrytym pytaniem.
|
|
448
452
|
- **brak-odczytu** — `Ten klucz nie ma uprawnień do odczytu tablicy (np. rola seeder).`
|
|
449
453
|
Wybierz worker w Connect; `unset ROBISIE_KEY`, potem init z ukrytym pytaniem.
|
|
450
|
-
- **major** — `Wersja kontraktu serwera (2.0.0) nie pasuje do paczki robisie 0.2.
|
|
454
|
+
- **major** — `Wersja kontraktu serwera (2.0.0) nie pasuje do paczki robisie 0.2.2 (obsługuje 1.x).`
|
|
451
455
|
Przykład niezgodnego MAJOR: zainstaluj wydanie zgodne z kontraktem serwera.
|
|
452
456
|
- **brak-env** — `Zmienna ROBISIE_KEY nie jest ustawiona — role i agenci jej potrzebują.`
|
|
453
457
|
Sprawdź obsługę profilu; przy --no-shell/innej powłoce wczytaj plik klucza do środowiska sesji jak w init, potem doctor.
|
|
@@ -467,6 +471,6 @@ Po naprawie przy istniejącej ewidencji wczytaj zapisany klucz według Aktualiza
|
|
|
467
471
|
|
|
468
472
|
Instalator nie uruchamia sam usług w tle ani Buildera; po zgodzie operatora CEO może uruchomić Buildera przez `spawn_builder`. Pomocniki działają podczas sesji agenta, z kontekstem katalogu projektu (lub `ROBISIE_PROJECT_CONTEXT`). Instalator łączy się z robisie w celu sprawdzenia kontraktu i klucza; plik paczki nie zapewnia konta ani dostępu do dostawcy AI. Jedna wspólna tożsamość klucza nie daje trzech różnych poziomów uprawnień. Odbiór wymaga niezależnej recenzji, dowodów i zgody operatora.
|
|
469
473
|
|
|
470
|
-
Windows/WSL są niezweryfikowane. Walidacja offline sprawdza strukturę konfiguracji, nie UUID projektu, istnienie repo, dostępność modeli ani uruchomienie dostawców.
|
|
474
|
+
Windows/WSL są niezweryfikowane. Walidacja offline sprawdza strukturę konfiguracji i wejścia instalacji lokalnej, nie UUID projektu, istnienie repo, dostępność modeli ani uruchomienie dostawców.
|
|
471
475
|
|
|
472
476
|
Silnik paczki (`dist/engine/tick.cjs`) jest odrębny od instalatora: uruchamia go `npx robisie factory run --engine-config ./robisie.config.json` i tylko na Linuxie; na innym systemie polecenie odmawia z kodem 2 i komunikatem. Opcja `--once` uruchamia jeden takt bez przerwy i wyklucza jawne `--interval`. Każdy niezerowy wynik taktu zatrzymuje nadzorcę („Fabryka zatrzymana: …”) z jedną linią diagnozy na stderr; kod 2 to eskalacja (np. brak klucza B po receiver PASS, odmowa testera, STOP odbioru) wymagająca rozstrzygnięcia przed ponowieniem, a kod 78 wskazuje konfigurację do poprawy. Realne użycie u klienta na Linuxie zostanie udowodnione w odbiorze D9; na innych systemach nie ma natywnego dowodu uruchomienia silnika. Automatyczne plany FJ u klienta są zapowiedziane („wkrótce”), ale nie ma ich w tym wydaniu; selektor zwraca prawdziwy wynik.
|
package/docs/RELEASE-0.1.0.md
CHANGED
|
@@ -81,11 +81,14 @@ export const config = parseConfig({
|
|
|
81
81
|
- `dist/context.js`
|
|
82
82
|
- `dist/delivery-local.js`
|
|
83
83
|
- `dist/dependency-readiness.js`
|
|
84
|
+
- `dist/disk-guard.js`
|
|
84
85
|
- `dist/dispatch-scope.js`
|
|
85
86
|
- `dist/done-evidence.js`
|
|
86
87
|
- `dist/engine-config.js`
|
|
88
|
+
- `dist/engine-inputs.js`
|
|
87
89
|
- `dist/factory-run.js`
|
|
88
90
|
- `dist/fsops.js`
|
|
91
|
+
- `dist/git-commit.js`
|
|
89
92
|
- `dist/helpers.js`
|
|
90
93
|
- `dist/intent-rules/admission.js`
|
|
91
94
|
- `dist/intent-rules/done-when-roles.js`
|
package/package.json
CHANGED