@justfortytwo/installer 1.0.5 → 1.0.6
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/README.md +17 -1
- package/dist/commands/start.d.ts +12 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +45 -2
- package/dist/commands/start.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ To remove it: delete the launcher (`init` prints its path) and, per project,
|
|
|
48
48
|
|
|
49
49
|
You only install **this** package — `init` installs the engine packages it needs
|
|
50
50
|
on demand (`@justfortytwo/gate`, `/memory`, `/persona`, `/telegram`, `/scheduler`, `/transcript`).
|
|
51
|
-
`/memory` is pinned to exact `1.0.0`, `/telegram` to exact `1.0.
|
|
51
|
+
`/memory` is pinned to exact `1.0.0`, `/telegram` to exact `1.0.2`, `/persona` to exact `1.0.2`, `/scheduler` to exact `1.0.4`,
|
|
52
52
|
and `/transcript` to `^1.0.0` (see `fortytwo.compat` in `package.json`); telegram
|
|
53
53
|
and scheduler pull in `@justfortytwo/runner` themselves, so the installer never
|
|
54
54
|
installs runner directly. Engine versions live only in `package.json`
|
|
@@ -116,6 +116,22 @@ Run `fortytwo <verb> --help` for verb-specific options.
|
|
|
116
116
|
> installs, rotates the rollback ledger, and post-verifies with `doctor`;
|
|
117
117
|
> `rollback` restores the recorded previous set. `enrich` is still a stub.
|
|
118
118
|
|
|
119
|
+
## Passing arguments to Claude Code
|
|
120
|
+
|
|
121
|
+
Everything after `--` on `fortytwo start` is handed to Claude Code on every chat
|
|
122
|
+
and scheduled run:
|
|
123
|
+
|
|
124
|
+
```sh
|
|
125
|
+
fortytwo start -- --chrome
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The arguments travel to the services as `FORTYTWO_CLAUDE_ARGS`, a JSON array of
|
|
129
|
+
strings. To make them permanent, set that variable in `.env` instead
|
|
130
|
+
(`FORTYTWO_CLAUDE_ARGS=["--chrome"]`); the command line wins over it, and a bare
|
|
131
|
+
`--` passes none. `--input-format` and `--output-format` are refused, because
|
|
132
|
+
fortytwo sets them itself. The memory-consolidation worker runs locked down and
|
|
133
|
+
never receives these arguments.
|
|
134
|
+
|
|
119
135
|
## Running as a service
|
|
120
136
|
|
|
121
137
|
`fortytwo start` stays in the foreground on purpose, so the thing that runs it
|
package/dist/commands/start.d.ts
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/** Read by @justfortytwo/runner's `claudeArgsFromEnv` in the bridge and the scheduler. */
|
|
2
|
+
export declare const CLAUDE_ARGS_ENV = "FORTYTWO_CLAUDE_ARGS";
|
|
3
|
+
export interface StartFlags {
|
|
4
|
+
help: boolean;
|
|
5
|
+
/** Arguments after `--`; null when `--` was not given (the env value stands). */
|
|
6
|
+
claudeArgs: string[] | null;
|
|
7
|
+
error?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function parseStartArgs(argv: string[]): StartFlags;
|
|
10
|
+
/** The service env with the command line's Claude arguments applied (input untouched). */
|
|
11
|
+
export declare function applyStartFlags(env: NodeJS.ProcessEnv, flags: StartFlags): NodeJS.ProcessEnv;
|
|
12
|
+
export declare function runStart(argv: string[]): Promise<number>;
|
|
2
13
|
//# sourceMappingURL=start.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAoBA,0FAA0F;AAC1F,eAAO,MAAM,eAAe,yBAAyB,CAAC;AAYtD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,iFAAiF;IACjF,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CASzD;AAED,0FAA0F;AAC1F,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,CAAC,UAAU,CAG5F;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAwB9D"}
|
package/dist/commands/start.js
CHANGED
|
@@ -7,11 +7,54 @@
|
|
|
7
7
|
// directly as the container/service command (`fortytwo start`) and let
|
|
8
8
|
// Docker/Podman/systemd own restarts. The services' own bins
|
|
9
9
|
// (fortytwo-telegram-bridge, fortytwo-scheduler) stay available for debugging.
|
|
10
|
+
//
|
|
11
|
+
// `fortytwo start -- <claude args>` hands everything after `--` to Claude Code for
|
|
12
|
+
// both chat and scheduled runs (e.g. `fortytwo start -- --chrome`). It travels as
|
|
13
|
+
// FORTYTWO_CLAUDE_ARGS, a JSON array each service validates at boot; the same
|
|
14
|
+
// variable can be set in .env instead, and the command line wins over it.
|
|
10
15
|
import { existsSync, readFileSync } from 'node:fs';
|
|
11
16
|
import { join } from 'node:path';
|
|
12
17
|
import { parseEnvContent } from './init.js';
|
|
13
18
|
import { buildServiceEnv, liveRuntime, planServices, supervise } from '../runtime.js';
|
|
14
|
-
|
|
19
|
+
/** Read by @justfortytwo/runner's `claudeArgsFromEnv` in the bridge and the scheduler. */
|
|
20
|
+
export const CLAUDE_ARGS_ENV = 'FORTYTWO_CLAUDE_ARGS';
|
|
21
|
+
const USAGE = `fortytwo start [-- <claude args>]
|
|
22
|
+
|
|
23
|
+
Run fortytwo in the foreground (Telegram bridge + scheduler), loading .env.
|
|
24
|
+
|
|
25
|
+
-- <claude args> Everything after -- is passed to Claude Code on every chat and
|
|
26
|
+
scheduled run, e.g. \`fortytwo start -- --chrome\`. Overrides
|
|
27
|
+
${CLAUDE_ARGS_ENV} (a JSON array, e.g. ["--chrome"]) from the
|
|
28
|
+
environment or .env. A bare -- passes none.
|
|
29
|
+
`;
|
|
30
|
+
export function parseStartArgs(argv) {
|
|
31
|
+
const split = argv.indexOf('--');
|
|
32
|
+
const own = split === -1 ? argv : argv.slice(0, split);
|
|
33
|
+
const flags = { help: false, claudeArgs: split === -1 ? null : argv.slice(split + 1) };
|
|
34
|
+
for (const arg of own) {
|
|
35
|
+
if (arg === '--help' || arg === '-h')
|
|
36
|
+
flags.help = true;
|
|
37
|
+
else
|
|
38
|
+
return { ...flags, error: `unknown option ${arg}. Claude Code arguments go after \`--\`: fortytwo start -- ${arg}` };
|
|
39
|
+
}
|
|
40
|
+
return flags;
|
|
41
|
+
}
|
|
42
|
+
/** The service env with the command line's Claude arguments applied (input untouched). */
|
|
43
|
+
export function applyStartFlags(env, flags) {
|
|
44
|
+
if (flags.claudeArgs === null)
|
|
45
|
+
return env;
|
|
46
|
+
return { ...env, [CLAUDE_ARGS_ENV]: JSON.stringify(flags.claudeArgs) };
|
|
47
|
+
}
|
|
48
|
+
export async function runStart(argv) {
|
|
49
|
+
const flags = parseStartArgs(argv);
|
|
50
|
+
if (flags.error) {
|
|
51
|
+
process.stderr.write(`start: ${flags.error}\n`);
|
|
52
|
+
return 2;
|
|
53
|
+
}
|
|
54
|
+
if (flags.help) {
|
|
55
|
+
process.stdout.write(USAGE);
|
|
56
|
+
return 0;
|
|
57
|
+
}
|
|
15
58
|
const root = process.cwd();
|
|
16
59
|
const running = liveRuntime(root);
|
|
17
60
|
if (running) {
|
|
@@ -20,7 +63,7 @@ export async function runStart(_argv) {
|
|
|
20
63
|
}
|
|
21
64
|
const envPath = join(root, '.env');
|
|
22
65
|
const fileEnv = existsSync(envPath) ? parseEnvContent(readFileSync(envPath, 'utf8')) : {};
|
|
23
|
-
const env = buildServiceEnv(process.env, fileEnv, root);
|
|
66
|
+
const env = applyStartFlags(buildServiceEnv(process.env, fileEnv, root), flags);
|
|
24
67
|
const { run, skipped } = planServices(root, env);
|
|
25
68
|
for (const s of skipped)
|
|
26
69
|
process.stdout.write(`[fortytwo] ${s.name}: not started (${s.reason})\n`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,8EAA8E;AAC9E,sEAAsE;AACtE,6EAA6E;AAC7E,iFAAiF;AACjF,uEAAuE;AACvE,6DAA6D;AAC7D,+EAA+E;
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,8EAA8E;AAC9E,sEAAsE;AACtE,6EAA6E;AAC7E,iFAAiF;AACjF,uEAAuE;AACvE,6DAA6D;AAC7D,+EAA+E;AAC/E,EAAE;AACF,mFAAmF;AACnF,kFAAkF;AAClF,8EAA8E;AAC9E,0EAA0E;AAE1E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEtF,0FAA0F;AAC1F,MAAM,CAAC,MAAM,eAAe,GAAG,sBAAsB,CAAC;AAEtD,MAAM,KAAK,GAAG;;;;;;uBAMS,eAAe;;CAErC,CAAC;AASF,MAAM,UAAU,cAAc,CAAC,IAAc;IAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,GAAG,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACvD,MAAM,KAAK,GAAe,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,KAAK,CA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.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "All-in-one installer and lifecycle CLI for fortytwo — scaffolds the persona surface and provisions the npm engine (memory MCP, safety gate, channel adapters, embedder).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"@justfortytwo/memory": "1.0.0",
|
|
51
51
|
"@justfortytwo/gate": "^0.1.0",
|
|
52
52
|
"@justfortytwo/persona": "1.0.2",
|
|
53
|
-
"@justfortytwo/telegram": "1.0.
|
|
54
|
-
"@justfortytwo/scheduler": "1.0.
|
|
53
|
+
"@justfortytwo/telegram": "1.0.2",
|
|
54
|
+
"@justfortytwo/scheduler": "1.0.4",
|
|
55
55
|
"@justfortytwo/transcript": "^1.0.0"
|
|
56
56
|
}
|
|
57
57
|
},
|