@flowrunner/cli 0.1.0 → 0.1.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/ai-docs/instructions/service-code-format/13-runtime-contracts.md +7 -7
- package/ai-docs/instructions/service-code-format/14-reference-service.md +1 -1
- package/ai-docs/instructions/service-code-format/16-gotchas.md +1 -1
- package/ai-docs/instructions/service-code-format/README.md +2 -2
- package/ai-docs/providers/claude/agents/flowrunner-service-code-engineer.md +4 -4
- package/ai-docs/providers/claude/agents/flowrunner-service-test-engineer.md +1 -1
- package/ai-docs/providers/claude/main-orchestrator-segment.md +2 -2
- package/bin/flowrunner.js +3 -3
- package/bin/resolve-local.js +14 -6
- package/dist/cli.js +18 -15
- package/dist/cli.js.map +2 -2
- package/dist/index.js +13 -10
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/project-files/sandbox/files-mock.js +1 -1
- package/project-files/sandbox/nock-mock.js +1 -1
- package/project-files/sandbox/service.js +1 -1
- package/runtime/index.js.map +1 -1
package/dist/index.js
CHANGED
|
@@ -4275,7 +4275,7 @@ var UnknownServerError = class extends CliError {
|
|
|
4275
4275
|
}
|
|
4276
4276
|
};
|
|
4277
4277
|
var AiDocsMissingError = class extends CliError {
|
|
4278
|
-
constructor(directory, message = `The installed
|
|
4278
|
+
constructor(directory, message = `The installed FlowRunner CLI ships no AI docs at ${directory}.`) {
|
|
4279
4279
|
super("FR_AI_DOCS_MISSING", message, "AiDocsMissingError");
|
|
4280
4280
|
this.directory = directory;
|
|
4281
4281
|
}
|
|
@@ -8815,7 +8815,7 @@ var import_path18 = __toESM(require("path"));
|
|
|
8815
8815
|
// src/templates/package-root.ts
|
|
8816
8816
|
var import_fs8 = __toESM(require("fs"));
|
|
8817
8817
|
var import_path12 = __toESM(require("path"));
|
|
8818
|
-
var
|
|
8818
|
+
var PACKAGE_NAMES = ["@flowrunner/cli", "flowrunner-cli"];
|
|
8819
8819
|
var cached = null;
|
|
8820
8820
|
function findPackageRoot() {
|
|
8821
8821
|
let dir = __dirname;
|
|
@@ -8823,7 +8823,7 @@ function findPackageRoot() {
|
|
|
8823
8823
|
const manifest = import_path12.default.join(dir, "package.json");
|
|
8824
8824
|
if (import_fs8.default.existsSync(manifest)) {
|
|
8825
8825
|
try {
|
|
8826
|
-
if (JSON.parse(import_fs8.default.readFileSync(manifest, "utf-8")).name
|
|
8826
|
+
if (PACKAGE_NAMES.includes(JSON.parse(import_fs8.default.readFileSync(manifest, "utf-8")).name)) {
|
|
8827
8827
|
return dir;
|
|
8828
8828
|
}
|
|
8829
8829
|
} catch {
|
|
@@ -8831,7 +8831,7 @@ function findPackageRoot() {
|
|
|
8831
8831
|
}
|
|
8832
8832
|
const parent = import_path12.default.dirname(dir);
|
|
8833
8833
|
if (parent === dir) {
|
|
8834
|
-
throw new Error(`Could not locate the "${
|
|
8834
|
+
throw new Error(`Could not locate the "${PACKAGE_NAMES[0]}" package root above ${__dirname}`);
|
|
8835
8835
|
}
|
|
8836
8836
|
dir = parent;
|
|
8837
8837
|
}
|
|
@@ -9291,6 +9291,8 @@ function writeTestingFiles(projectRoot) {
|
|
|
9291
9291
|
|
|
9292
9292
|
// src/operations/init/index.ts
|
|
9293
9293
|
var GITIGNORE_ENTRIES = ["node_modules/", `${TOKEN_DIR}/`, ...TEST_GITIGNORE_ENTRIES];
|
|
9294
|
+
var CLI_PACKAGE = "@flowrunner/cli";
|
|
9295
|
+
var CLI_PACKAGE_NAMES = [CLI_PACKAGE, "flowrunner-cli"];
|
|
9294
9296
|
function cliVersion() {
|
|
9295
9297
|
return JSON.parse(import_fs13.default.readFileSync(import_path18.default.join(packageRoot(), "package.json"), "utf-8")).version;
|
|
9296
9298
|
}
|
|
@@ -9311,7 +9313,7 @@ function addMissing(section, additions, placeholders = {}) {
|
|
|
9311
9313
|
function writePackageJson(projectRoot, tests) {
|
|
9312
9314
|
const fullPath = import_path18.default.join(projectRoot, "package.json");
|
|
9313
9315
|
const version = cliVersion();
|
|
9314
|
-
const devDependencies = {
|
|
9316
|
+
const devDependencies = { [CLI_PACKAGE]: version, ...tests ? TEST_DEV_DEPENDENCIES : {} };
|
|
9315
9317
|
const scripts = { deploy: "flowrunner deploy --all", ...tests ? TEST_SCRIPTS : {} };
|
|
9316
9318
|
if (!import_fs13.default.existsSync(fullPath)) {
|
|
9317
9319
|
const manifest2 = {
|
|
@@ -9326,7 +9328,8 @@ function writePackageJson(projectRoot, tests) {
|
|
|
9326
9328
|
return "created";
|
|
9327
9329
|
}
|
|
9328
9330
|
const manifest = JSON.parse(import_fs13.default.readFileSync(fullPath, "utf-8"));
|
|
9329
|
-
const
|
|
9331
|
+
const alreadyDeclared = CLI_PACKAGE_NAMES.some((name) => manifest.dependencies?.[name] || manifest.devDependencies?.[name]);
|
|
9332
|
+
const additions = alreadyDeclared ? Object.fromEntries(Object.entries(devDependencies).filter(([name]) => name !== CLI_PACKAGE)) : devDependencies;
|
|
9330
9333
|
manifest.devDependencies ??= {};
|
|
9331
9334
|
manifest.scripts ??= {};
|
|
9332
9335
|
const changed = [
|
|
@@ -9375,7 +9378,7 @@ cd services/<id> && npm install # add a dependency to one service
|
|
|
9375
9378
|
npm test # run the unit suites in services/*/tests/
|
|
9376
9379
|
\`\`\`
|
|
9377
9380
|
|
|
9378
|
-
With \`npm i -g flowrunner
|
|
9381
|
+
With \`npm i -g @flowrunner/cli\` you can drop the \`npx\` and just write \`flowrunner cs\`. The global copy only
|
|
9379
9382
|
launches the one in this project's \`node_modules\`, so the version pinned in \`package.json\` is still the one
|
|
9380
9383
|
that runs.
|
|
9381
9384
|
|
|
@@ -9383,16 +9386,16 @@ To move this project to a newer CLI, upgrade the dependency and commit it \u2014
|
|
|
9383
9386
|
runs, for you and for CI:
|
|
9384
9387
|
|
|
9385
9388
|
\`\`\`bash
|
|
9386
|
-
npm i -D flowrunner
|
|
9389
|
+
npm i -D @flowrunner/cli@<version>
|
|
9387
9390
|
\`\`\`
|
|
9388
9391
|
|
|
9389
|
-
Updating the global copy (\`npm i -g flowrunner
|
|
9392
|
+
Updating the global copy (\`npm i -g @flowrunner/cli@latest\`) is rarely needed and changes nothing here.
|
|
9390
9393
|
|
|
9391
9394
|
Tests run each service the way the platform does, with HTTP intercepted at the socket \u2014 see
|
|
9392
9395
|
\`sandbox/index.js\`, which \`${PORTABLE_CLI_COMMAND} init\` copied here for you to edit.
|
|
9393
9396
|
|
|
9394
9397
|
The authoring reference the CLI ships lives in
|
|
9395
|
-
\`node_modules/
|
|
9398
|
+
\`node_modules/@flowrunner/cli/ai-docs/instructions/service-code-format/\`. Point your AI agent at it \u2014 or run
|
|
9396
9399
|
\`${PORTABLE_CLI_COMMAND} init-claude\` and Claude Code is wired up for you.
|
|
9397
9400
|
|
|
9398
9401
|
\`flowrunner.json\` names the server and the workspace and belongs in git.
|