@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
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
The other documents describe what to declare. This one collects the handful of **runtime** facts that change
|
|
4
4
|
what you write and that are otherwise visible only by reading the CLI bundle.
|
|
5
5
|
|
|
6
|
-
> **Do not read the CLI bundle** (
|
|
6
|
+
> **Do not read the CLI bundle** (`@flowrunner/cli/runtime/index.js`, its `.d.ts` tree, or the templates) to
|
|
7
7
|
> answer a question about authoring, and do not reason from what the runtime "probably" does. This document
|
|
8
8
|
> is meant to be complete: if a fact you needed is missing, that is a defect here. Report it and proceed on
|
|
9
9
|
> what *is* documented, saying which part you could not confirm — do not go and read the source, and do not
|
|
10
10
|
> fill the gap with an assumption.
|
|
11
11
|
|
|
12
|
-
## The `Flowrunner` global vs the
|
|
12
|
+
## The `Flowrunner` global vs the `@flowrunner/cli/runtime` module
|
|
13
13
|
|
|
14
14
|
Two different surfaces, easily confused:
|
|
15
15
|
|
|
16
16
|
| Surface | How you get it | Contains |
|
|
17
17
|
|---|---|---|
|
|
18
|
-
| **`Flowrunner` global** | always present when the platform runs your service; a harness gets it as a side effect of importing
|
|
19
|
-
| **`require('flowrunner
|
|
18
|
+
| **`Flowrunner` global** | always present when the platform runs your service; a harness gets it as a side effect of importing `@flowrunner/cli/runtime` | `Request`, `z`, `crypto`, `createExtension`, `getExtension`, `ServerCode` |
|
|
19
|
+
| **`require('@flowrunner/cli/runtime')`** | explicit import — **harness-side only** | `buildServiceDefinition`, `getServiceConfigs`, `runServiceMethod`, `detectVersion`, `resetRegistry`, `parseJsDocToServiceJson` |
|
|
20
20
|
|
|
21
21
|
A service module uses only the global, and `require`s nothing. Note that importing the module is what
|
|
22
22
|
installs the global — there is no separate namespace export to pull in.
|
|
@@ -37,13 +37,13 @@ than a syntax error. Check it directly:
|
|
|
37
37
|
```js
|
|
38
38
|
// throwaway check — run it, read it, delete it
|
|
39
39
|
const path = require('path')
|
|
40
|
-
const { buildServiceDefinition } = require('flowrunner
|
|
40
|
+
const { buildServiceDefinition } = require('@flowrunner/cli/runtime')
|
|
41
41
|
|
|
42
42
|
const model = buildServiceDefinition('telegram', path.resolve('services/telegram/src/index.js'))
|
|
43
43
|
console.log(Object.keys(model.methodsMap))
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
**Put the script in the project root.** `require('flowrunner
|
|
46
|
+
**Put the script in the project root.** `require('@flowrunner/cli/runtime')` resolves relative to the
|
|
47
47
|
script's own location, so the same file fails with `MODULE_NOT_FOUND` from `/tmp` and works from the root.
|
|
48
48
|
If the project's `package.json` sets `"type": "module"`, name it `.cjs`.
|
|
49
49
|
|
|
@@ -125,7 +125,7 @@ and conclusions drawn that way have been wrong.
|
|
|
125
125
|
Verify the parts you own by calling them directly instead — your `subscribe` body is an ordinary function:
|
|
126
126
|
|
|
127
127
|
```js
|
|
128
|
-
require('flowrunner
|
|
128
|
+
require('@flowrunner/cli/runtime') // installs the Flowrunner global
|
|
129
129
|
require(ENTRY) // registers the service
|
|
130
130
|
const ext = Flowrunner.getExtension('telegram') // note: on the global, not the module export
|
|
131
131
|
// → { props, actions, dictionaries, pollingTriggers, realtimeTriggers, loaders, realtime }
|
|
@@ -6,7 +6,7 @@ including the layout, the naming and the formatting, which are rules rather than
|
|
|
6
6
|
([01-service-structure.md](01-service-structure.md), [03-parameters.md](03-parameters.md)).
|
|
7
7
|
|
|
8
8
|
> **Read this instead of the CLI templates.** The templates that ship with the CLI are project scaffolding,
|
|
9
|
-
> not authoring reference. Do not open `node_modules/
|
|
9
|
+
> not authoring reference. Do not open `node_modules/@flowrunner/cli/templates/`, or anything else inside the
|
|
10
10
|
> package.
|
|
11
11
|
|
|
12
12
|
This file is verified against the runtime: it builds, and the model it produces is the one annotated at the
|
|
@@ -177,7 +177,7 @@ tempting move is defensive code that tries to work either way — feature-detect
|
|
|
177
177
|
shapes. **That hedge is how a silent bug gets written**: it looks careful, it type-checks, and it picks the
|
|
178
178
|
wrong branch without complaining.
|
|
179
179
|
|
|
180
|
-
Establish the fact instead. A scratch script against
|
|
180
|
+
Establish the fact instead. A scratch script against `@flowrunner/cli/runtime` settles most runtime questions
|
|
181
181
|
in a minute (see [13-runtime-contracts.md](13-runtime-contracts.md) for the pattern and the reload caveat),
|
|
182
182
|
and a local `http` server settles any question about what actually goes out on the wire. Then write the one
|
|
183
183
|
branch that is true — and add the fact to 13, which is the fix that stops the next service repeating it.
|
|
@@ -9,7 +9,7 @@ declare a service — use it both for new services and for changes to existing o
|
|
|
9
9
|
|
|
10
10
|
> **This reference is complete, and it is the only source.** Everything needed to build a service — the
|
|
11
11
|
> declaration surface, the runtime behaviour it depends on, and the naming and layout rules — is written
|
|
12
|
-
> down here. So: **never read the
|
|
12
|
+
> down here. So: **never read the `@flowrunner/cli` source, its bundled runtime, its type definitions or its
|
|
13
13
|
> templates**, and never infer a rule from a neighbouring service or from what an API "probably" does.
|
|
14
14
|
>
|
|
15
15
|
> If you cannot find something here, that is a defect in this reference, not an invitation to go and look.
|
|
@@ -113,7 +113,7 @@ the platform does with HTTP intercepted at the socket. It is a separate document
|
|
|
113
113
|
and testing one are separate jobs; do not read it while writing a service.
|
|
114
114
|
|
|
115
115
|
That is also separate from **checking that a service builds**, which needs no suite at all and is part of
|
|
116
|
-
writing one: `require('flowrunner
|
|
116
|
+
writing one: `require('@flowrunner/cli/runtime')` exports `buildServiceDefinition`, `getServiceConfigs`,
|
|
117
117
|
`runServiceMethod`, `detectVersion`, `resetRegistry` and `parseJsDocToServiceJson`, and importing it installs
|
|
118
118
|
the `Flowrunner` global (`Request`, `z`, `crypto`, `createExtension`, `getExtension`, `ServerCode`).
|
|
119
119
|
Signatures, a copy-paste snippet, and the boundary between a throwaway check and a suite are in
|
|
@@ -13,9 +13,9 @@ factory props and zod schemas (`Flowrunner.z`).
|
|
|
13
13
|
|
|
14
14
|
The canonical authoring reference ships inside the installed CLI, versioned with it:
|
|
15
15
|
|
|
16
|
-
`node_modules/
|
|
16
|
+
`node_modules/@flowrunner/cli/ai-docs/instructions/service-code-format/`
|
|
17
17
|
|
|
18
|
-
If that directory does not exist, stop and ask the developer to install or update
|
|
18
|
+
If that directory does not exist, stop and ask the developer to install or update `@flowrunner/cli` — do not
|
|
19
19
|
proceed from memory.
|
|
20
20
|
|
|
21
21
|
**Read `README.md` there before anything else, then the documents it routes you to.** It carries the
|
|
@@ -36,7 +36,7 @@ conflicts with those documents, the documents win** — this file describes *how
|
|
|
36
36
|
is correct*.
|
|
37
37
|
|
|
38
38
|
**The reference is complete, and it is the only source.** Those documents are the one thing you read out
|
|
39
|
-
of `node_modules/` — never the rest of the
|
|
39
|
+
of `node_modules/` — never the rest of the `@flowrunner/cli` package: not its source, not its bundled
|
|
40
40
|
runtime, not its type definitions, not its `templates/`. And never reason from what the runtime "probably"
|
|
41
41
|
does. If something you need is not documented, that is a defect in the reference: say so in your report,
|
|
42
42
|
proceed on what *is* documented, and mark plainly which part you could not confirm. A supposition that
|
|
@@ -106,7 +106,7 @@ test engineer can always rebuild the authoritative list itself.
|
|
|
106
106
|
item kinds. The reference states the full rule; treat every existing `id` as untouchable.
|
|
107
107
|
- All changes stay inside the one `services/{id}/` folder; service logic lives only in `src/index.js`.
|
|
108
108
|
- **Never read `node_modules/` as project source.** The authoring reference under
|
|
109
|
-
`node_modules/
|
|
109
|
+
`node_modules/@flowrunner/cli/ai-docs/` is the only exception; everything else in that package is off
|
|
110
110
|
limits, including the CLI's bundled runtime, its type definitions and its `templates/`. If a runtime fact
|
|
111
111
|
seems undocumented it belongs in `13-runtime-contracts.md`: report the gap rather than going to look.
|
|
112
112
|
- **Do not reverse-engineer an undocumented runtime contract by probing it.** Calling a SYSTEM method with
|
|
@@ -43,7 +43,7 @@ A suite lives at `services/{id}/tests/{id}.test.js` and runs with `npm test`. Ev
|
|
|
43
43
|
3. **Note the auth shape** from `configItems`: which values are config, and whether the service declares
|
|
44
44
|
OAuth2. Both change what you pass to `runServiceMethod`.
|
|
45
45
|
4. **Read the authoring reference for anything you are unsure about**, at
|
|
46
|
-
`node_modules/
|
|
46
|
+
`node_modules/@flowrunner/cli/ai-docs/instructions/service-code-format/` — it ships inside the installed
|
|
47
47
|
CLI. `15-unit-tests.md` is the testing document and the authority where this file is silent. Add
|
|
48
48
|
`18-test-recipes.md` **only for the kinds this service actually registers** (dictionaries, triggers,
|
|
49
49
|
files); an actions-only service does not need it. `04-http-requests.md`
|
|
@@ -26,12 +26,12 @@ here duplicates that cost without producing anything.
|
|
|
26
26
|
The reference ships inside the installed CLI, versioned with it, so it describes the format this project
|
|
27
27
|
actually deploys:
|
|
28
28
|
|
|
29
|
-
`node_modules/
|
|
29
|
+
`node_modules/@flowrunner/cli/ai-docs/instructions/service-code-format/`
|
|
30
30
|
|
|
31
31
|
Its `README.md` is the source of truth for service format — the reading order, the identity-and-naming
|
|
32
32
|
rules, and which document covers what. Where anything conflicts with it, it wins.
|
|
33
33
|
|
|
34
|
-
If that directory does not exist, stop and ask the developer to install or update
|
|
34
|
+
If that directory does not exist, stop and ask the developer to install or update `@flowrunner/cli` — do not
|
|
35
35
|
proceed from memory.
|
|
36
36
|
|
|
37
37
|
## Testing
|
package/bin/flowrunner.js
CHANGED
|
@@ -11,7 +11,7 @@ const srcEntry = path.resolve(cliRoot, 'src', 'cli', 'index.ts')
|
|
|
11
11
|
// ─── Hand over to the project's own copy, if there is one ────────────────────
|
|
12
12
|
//
|
|
13
13
|
// A global install exists to put `flowrunner` on PATH; the project's copy is what should actually run, so
|
|
14
|
-
// that `npm i -D flowrunner
|
|
14
|
+
// that `npm i -D @flowrunner/cli@x` is the single thing deciding a project's version — and so that the
|
|
15
15
|
// templates and ai-docs used are the ones that project pinned. See ./resolve-local.js.
|
|
16
16
|
//
|
|
17
17
|
// `FLOWRUNNER_DELEGATED` makes the hop one-way: the child must run itself whatever it finds, or a copy that
|
|
@@ -20,7 +20,7 @@ if (!process.env.FLOWRUNNER_DELEGATED) {
|
|
|
20
20
|
const resolution = resolveLocalCli(process.cwd(), cliRoot)
|
|
21
21
|
|
|
22
22
|
if (resolution.kind === 'not-installed') {
|
|
23
|
-
console.error('This project depends on
|
|
23
|
+
console.error('This project depends on the FlowRunner CLI, but it is not installed.')
|
|
24
24
|
console.error(' Run `npm install` first — running the globally installed CLI here would use its')
|
|
25
25
|
console.error(' templates and ai-docs instead of the versions this project pinned.')
|
|
26
26
|
process.exit(1)
|
|
@@ -35,7 +35,7 @@ if (!process.env.FLOWRUNNER_DELEGATED) {
|
|
|
35
35
|
})
|
|
36
36
|
|
|
37
37
|
if (result.error) {
|
|
38
|
-
console.error(`Could not run this project's
|
|
38
|
+
console.error(`Could not run this project's FlowRunner CLI (${ resolution.bin }):`)
|
|
39
39
|
console.error(` ${ result.error.message }`)
|
|
40
40
|
process.exit(1)
|
|
41
41
|
}
|
package/bin/resolve-local.js
CHANGED
|
@@ -7,14 +7,18 @@
|
|
|
7
7
|
// CLI reads from its own package — `templates/`, `ai-docs/`, `project-files/` — is resolved from the
|
|
8
8
|
// executing copy (see src/templates/package-root.ts), so running the global's code against a local project
|
|
9
9
|
// would scaffold from the wrong templates and deploy against the wrong runtime docs. Delegating is what
|
|
10
|
-
// keeps `npm i -D flowrunner
|
|
10
|
+
// keeps `npm i -D @flowrunner/cli@x` the one thing that decides which version a project uses.
|
|
11
11
|
//
|
|
12
12
|
// Plain CommonJS with no dependencies: `bin/flowrunner.js` runs before any build step or loader exists.
|
|
13
13
|
|
|
14
14
|
const fs = require('fs')
|
|
15
15
|
const path = require('path')
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
// The CLI moved to the `@flowrunner` npm org. The old name is still installed in every project scaffolded
|
|
18
|
+
// before the move, and those must keep working: a launcher that only looked for the new name would find no
|
|
19
|
+
// local copy in an old project and run its OWN templates and ai-docs there — the exact failure this module
|
|
20
|
+
// exists to prevent. Ordered by preference, so a project holding both resolves to the current one.
|
|
21
|
+
const PACKAGE_NAMES = ['@flowrunner/cli', 'flowrunner-cli']
|
|
18
22
|
const DEFAULT_BIN = path.join('bin', 'flowrunner.js')
|
|
19
23
|
|
|
20
24
|
function realpath(target) {
|
|
@@ -43,7 +47,7 @@ function binOf(packageDirectory) {
|
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
function declaresCli(manifest) {
|
|
46
|
-
return
|
|
50
|
+
return PACKAGE_NAMES.some(name => manifest?.dependencies?.[name] || manifest?.devDependencies?.[name])
|
|
47
51
|
}
|
|
48
52
|
|
|
49
53
|
/**
|
|
@@ -66,9 +70,13 @@ function resolveLocalCli(cwd, cliRoot) {
|
|
|
66
70
|
let directory = path.resolve(cwd)
|
|
67
71
|
|
|
68
72
|
for (;;) {
|
|
69
|
-
const
|
|
73
|
+
for (const name of PACKAGE_NAMES) {
|
|
74
|
+
const candidate = path.join(directory, 'node_modules', ...name.split('/'))
|
|
75
|
+
|
|
76
|
+
if (!fs.existsSync(candidate)) {
|
|
77
|
+
continue
|
|
78
|
+
}
|
|
70
79
|
|
|
71
|
-
if (fs.existsSync(candidate)) {
|
|
72
80
|
if (realpath(candidate) === self) {
|
|
73
81
|
return { kind: 'run-self', reason: 'self' }
|
|
74
82
|
}
|
|
@@ -95,4 +103,4 @@ function resolveLocalCli(cwd, cliRoot) {
|
|
|
95
103
|
return declared ? { kind: 'not-installed' } : { kind: 'run-self', reason: 'no-local-copy' }
|
|
96
104
|
}
|
|
97
105
|
|
|
98
|
-
module.exports = { resolveLocalCli,
|
|
106
|
+
module.exports = { resolveLocalCli, PACKAGE_NAMES }
|
package/dist/cli.js
CHANGED
|
@@ -4011,7 +4011,7 @@ var require_package = __commonJS({
|
|
|
4011
4011
|
publishConfig: {
|
|
4012
4012
|
access: "public"
|
|
4013
4013
|
},
|
|
4014
|
-
version: "0.1.
|
|
4014
|
+
version: "0.1.1",
|
|
4015
4015
|
description: "Flowrunner CLI for deploying Custom Extensions",
|
|
4016
4016
|
bin: {
|
|
4017
4017
|
flowrunner: "./bin/flowrunner.js"
|
|
@@ -4247,7 +4247,7 @@ var UnknownServerError = class extends CliError {
|
|
|
4247
4247
|
}
|
|
4248
4248
|
};
|
|
4249
4249
|
var AiDocsMissingError = class extends CliError {
|
|
4250
|
-
constructor(directory, message = `The installed
|
|
4250
|
+
constructor(directory, message = `The installed FlowRunner CLI ships no AI docs at ${directory}.`) {
|
|
4251
4251
|
super("FR_AI_DOCS_MISSING", message, "AiDocsMissingError");
|
|
4252
4252
|
this.directory = directory;
|
|
4253
4253
|
}
|
|
@@ -4355,7 +4355,7 @@ var TemplateManifestSchema = import_zod.z.object({
|
|
|
4355
4355
|
// src/templates/package-root.ts
|
|
4356
4356
|
var import_fs2 = __toESM(require("fs"));
|
|
4357
4357
|
var import_path2 = __toESM(require("path"));
|
|
4358
|
-
var
|
|
4358
|
+
var PACKAGE_NAMES = ["@flowrunner/cli", "flowrunner-cli"];
|
|
4359
4359
|
var cached = null;
|
|
4360
4360
|
function findPackageRoot() {
|
|
4361
4361
|
let dir = __dirname;
|
|
@@ -4363,7 +4363,7 @@ function findPackageRoot() {
|
|
|
4363
4363
|
const manifest = import_path2.default.join(dir, "package.json");
|
|
4364
4364
|
if (import_fs2.default.existsSync(manifest)) {
|
|
4365
4365
|
try {
|
|
4366
|
-
if (JSON.parse(import_fs2.default.readFileSync(manifest, "utf-8")).name
|
|
4366
|
+
if (PACKAGE_NAMES.includes(JSON.parse(import_fs2.default.readFileSync(manifest, "utf-8")).name)) {
|
|
4367
4367
|
return dir;
|
|
4368
4368
|
}
|
|
4369
4369
|
} catch {
|
|
@@ -4371,7 +4371,7 @@ function findPackageRoot() {
|
|
|
4371
4371
|
}
|
|
4372
4372
|
const parent = import_path2.default.dirname(dir);
|
|
4373
4373
|
if (parent === dir) {
|
|
4374
|
-
throw new Error(`Could not locate the "${
|
|
4374
|
+
throw new Error(`Could not locate the "${PACKAGE_NAMES[0]}" package root above ${__dirname}`);
|
|
4375
4375
|
}
|
|
4376
4376
|
dir = parent;
|
|
4377
4377
|
}
|
|
@@ -4756,7 +4756,7 @@ var ADVICE = {
|
|
|
4756
4756
|
${cliCommand()} deploy ${error.available.map((id) => `-s ${id}`).join(" ")}
|
|
4757
4757
|
${cliCommand()} deploy --all`,
|
|
4758
4758
|
FR_AI_DOCS_MISSING: (error) => `${error.message}
|
|
4759
|
-
Upgrade the CLI in this project (\`npm install -D flowrunner
|
|
4759
|
+
Upgrade the CLI in this project (\`npm install -D @flowrunner/cli@latest\`) and try again.`,
|
|
4760
4760
|
// The operation states what it could not ask for; the flags that would have answered it are the CLI's
|
|
4761
4761
|
// own vocabulary, so they are added here rather than thrown from inside the operation.
|
|
4762
4762
|
FR_PROMPT_REQUIRED: (error) => {
|
|
@@ -10139,6 +10139,8 @@ function writeTestingFiles(projectRoot) {
|
|
|
10139
10139
|
|
|
10140
10140
|
// src/operations/init/index.ts
|
|
10141
10141
|
var GITIGNORE_ENTRIES = ["node_modules/", `${TOKEN_DIR}/`, ...TEST_GITIGNORE_ENTRIES];
|
|
10142
|
+
var CLI_PACKAGE = "@flowrunner/cli";
|
|
10143
|
+
var CLI_PACKAGE_NAMES = [CLI_PACKAGE, "flowrunner-cli"];
|
|
10142
10144
|
function cliVersion() {
|
|
10143
10145
|
return JSON.parse(import_fs14.default.readFileSync(import_path20.default.join(packageRoot(), "package.json"), "utf-8")).version;
|
|
10144
10146
|
}
|
|
@@ -10159,7 +10161,7 @@ function addMissing(section2, additions, placeholders = {}) {
|
|
|
10159
10161
|
function writePackageJson(projectRoot, tests) {
|
|
10160
10162
|
const fullPath = import_path20.default.join(projectRoot, "package.json");
|
|
10161
10163
|
const version2 = cliVersion();
|
|
10162
|
-
const devDependencies = {
|
|
10164
|
+
const devDependencies = { [CLI_PACKAGE]: version2, ...tests ? TEST_DEV_DEPENDENCIES : {} };
|
|
10163
10165
|
const scripts = { deploy: "flowrunner deploy --all", ...tests ? TEST_SCRIPTS : {} };
|
|
10164
10166
|
if (!import_fs14.default.existsSync(fullPath)) {
|
|
10165
10167
|
const manifest2 = {
|
|
@@ -10174,7 +10176,8 @@ function writePackageJson(projectRoot, tests) {
|
|
|
10174
10176
|
return "created";
|
|
10175
10177
|
}
|
|
10176
10178
|
const manifest = JSON.parse(import_fs14.default.readFileSync(fullPath, "utf-8"));
|
|
10177
|
-
const
|
|
10179
|
+
const alreadyDeclared = CLI_PACKAGE_NAMES.some((name) => manifest.dependencies?.[name] || manifest.devDependencies?.[name]);
|
|
10180
|
+
const additions = alreadyDeclared ? Object.fromEntries(Object.entries(devDependencies).filter(([name]) => name !== CLI_PACKAGE)) : devDependencies;
|
|
10178
10181
|
manifest.devDependencies ??= {};
|
|
10179
10182
|
manifest.scripts ??= {};
|
|
10180
10183
|
const changed = [
|
|
@@ -10223,7 +10226,7 @@ cd services/<id> && npm install # add a dependency to one service
|
|
|
10223
10226
|
npm test # run the unit suites in services/*/tests/
|
|
10224
10227
|
\`\`\`
|
|
10225
10228
|
|
|
10226
|
-
With \`npm i -g flowrunner
|
|
10229
|
+
With \`npm i -g @flowrunner/cli\` you can drop the \`npx\` and just write \`flowrunner cs\`. The global copy only
|
|
10227
10230
|
launches the one in this project's \`node_modules\`, so the version pinned in \`package.json\` is still the one
|
|
10228
10231
|
that runs.
|
|
10229
10232
|
|
|
@@ -10231,16 +10234,16 @@ To move this project to a newer CLI, upgrade the dependency and commit it \u2014
|
|
|
10231
10234
|
runs, for you and for CI:
|
|
10232
10235
|
|
|
10233
10236
|
\`\`\`bash
|
|
10234
|
-
npm i -D flowrunner
|
|
10237
|
+
npm i -D @flowrunner/cli@<version>
|
|
10235
10238
|
\`\`\`
|
|
10236
10239
|
|
|
10237
|
-
Updating the global copy (\`npm i -g flowrunner
|
|
10240
|
+
Updating the global copy (\`npm i -g @flowrunner/cli@latest\`) is rarely needed and changes nothing here.
|
|
10238
10241
|
|
|
10239
10242
|
Tests run each service the way the platform does, with HTTP intercepted at the socket \u2014 see
|
|
10240
10243
|
\`sandbox/index.js\`, which \`${PORTABLE_CLI_COMMAND} init\` copied here for you to edit.
|
|
10241
10244
|
|
|
10242
10245
|
The authoring reference the CLI ships lives in
|
|
10243
|
-
\`node_modules/
|
|
10246
|
+
\`node_modules/@flowrunner/cli/ai-docs/instructions/service-code-format/\`. Point your AI agent at it \u2014 or run
|
|
10244
10247
|
\`${PORTABLE_CLI_COMMAND} init-claude\` and Claude Code is wired up for you.
|
|
10245
10248
|
|
|
10246
10249
|
\`flowrunner.json\` names the server and the workspace and belongs in git.
|
|
@@ -10415,12 +10418,12 @@ async function offerGlobalInstall() {
|
|
|
10415
10418
|
const version2 = runningVersion();
|
|
10416
10419
|
say("");
|
|
10417
10420
|
try {
|
|
10418
|
-
(0, import_child_process2.execFileSync)(npm, ["install", "--global",
|
|
10421
|
+
(0, import_child_process2.execFileSync)(npm, ["install", "--global", `@flowrunner/cli@${version2}`], { stdio: "inherit" });
|
|
10419
10422
|
resetCliCommandCache();
|
|
10420
10423
|
return true;
|
|
10421
10424
|
} catch {
|
|
10422
10425
|
sayWarning(`Could not install globally \u2014 carry on with \`npx flowrunner\`, or run this yourself:
|
|
10423
|
-
npm install --global flowrunner
|
|
10426
|
+
npm install --global @flowrunner/cli@${version2}`);
|
|
10424
10427
|
return false;
|
|
10425
10428
|
}
|
|
10426
10429
|
}
|
|
@@ -10626,7 +10629,7 @@ async function initClaudeCommand(options = {}) {
|
|
|
10626
10629
|
section("Next steps:");
|
|
10627
10630
|
say(` 1. open ${instructionsFile} and check the FlowRunner block reads the way you want`);
|
|
10628
10631
|
say(` 2. ask ${label} to build a service \u2014 it will pick up the ${agents} FlowRunner ${agents === 1 ? "agent" : "agents"}`);
|
|
10629
|
-
say(` 3. the authoring reference lives in node_modules/
|
|
10632
|
+
say(` 3. the authoring reference lives in node_modules/@flowrunner/cli/${AI_INSTRUCTIONS_DIRECTORY}/`);
|
|
10630
10633
|
say("");
|
|
10631
10634
|
} catch (error) {
|
|
10632
10635
|
fail(error);
|