@your-world/cli 0.1.0
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 +52 -0
- package/dist/adapters/codex-adapter.d.ts +15 -0
- package/dist/adapters/codex-adapter.js +70 -0
- package/dist/adapters/codex-adapter.js.map +1 -0
- package/dist/adapters/external-agent-adapter.d.ts +33 -0
- package/dist/adapters/external-agent-adapter.js +3 -0
- package/dist/adapters/external-agent-adapter.js.map +1 -0
- package/dist/adapters/generic-command-adapter.d.ts +12 -0
- package/dist/adapters/generic-command-adapter.js +57 -0
- package/dist/adapters/generic-command-adapter.js.map +1 -0
- package/dist/cli/action-submit.d.ts +19 -0
- package/dist/cli/action-submit.js +169 -0
- package/dist/cli/action-submit.js.map +1 -0
- package/dist/cli/bin.d.ts +2 -0
- package/dist/cli/bin.js +267 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/catalog.d.ts +2 -0
- package/dist/cli/catalog.js +30 -0
- package/dist/cli/catalog.js.map +1 -0
- package/dist/cli/events.d.ts +2 -0
- package/dist/cli/events.js +22 -0
- package/dist/cli/events.js.map +1 -0
- package/dist/cli/observe.d.ts +2 -0
- package/dist/cli/observe.js +21 -0
- package/dist/cli/observe.js.map +1 -0
- package/dist/cli/play-init.d.ts +9 -0
- package/dist/cli/play-init.js +111 -0
- package/dist/cli/play-init.js.map +1 -0
- package/dist/cli/play-run.d.ts +2 -0
- package/dist/cli/play-run.js +28 -0
- package/dist/cli/play-run.js.map +1 -0
- package/dist/cli/play-status.d.ts +2 -0
- package/dist/cli/play-status.js +19 -0
- package/dist/cli/play-status.js.map +1 -0
- package/dist/cli/player-init.d.ts +9 -0
- package/dist/cli/player-init.js +38 -0
- package/dist/cli/player-init.js.map +1 -0
- package/dist/cli/rules.d.ts +2 -0
- package/dist/cli/rules.js +32 -0
- package/dist/cli/rules.js.map +1 -0
- package/dist/cli/shared.d.ts +27 -0
- package/dist/cli/shared.js +243 -0
- package/dist/cli/shared.js.map +1 -0
- package/dist/config/credential-store.d.ts +28 -0
- package/dist/config/credential-store.js +119 -0
- package/dist/config/credential-store.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +12 -0
- package/dist/logger.js +40 -0
- package/dist/logger.js.map +1 -0
- package/dist/prompting/agents-template.d.ts +6 -0
- package/dist/prompting/agents-template.js +60 -0
- package/dist/prompting/agents-template.js.map +1 -0
- package/dist/prompting/turn-summary.d.ts +2 -0
- package/dist/prompting/turn-summary.js +27 -0
- package/dist/prompting/turn-summary.js.map +1 -0
- package/dist/runtime/player-runtime.d.ts +34 -0
- package/dist/runtime/player-runtime.js +228 -0
- package/dist/runtime/player-runtime.js.map +1 -0
- package/dist/runtime/runtime-types.d.ts +71 -0
- package/dist/runtime/runtime-types.js +3 -0
- package/dist/runtime/runtime-types.js.map +1 -0
- package/dist/runtime/session-store.d.ts +37 -0
- package/dist/runtime/session-store.js +139 -0
- package/dist/runtime/session-store.js.map +1 -0
- package/dist/runtime/settlement-sync.d.ts +9 -0
- package/dist/runtime/settlement-sync.js +80 -0
- package/dist/runtime/settlement-sync.js.map +1 -0
- package/dist/runtime/turn-orchestrator.d.ts +10 -0
- package/dist/runtime/turn-orchestrator.js +43 -0
- package/dist/runtime/turn-orchestrator.js.map +1 -0
- package/dist/runtime/workspace-manager.d.ts +9 -0
- package/dist/runtime/workspace-manager.js +28 -0
- package/dist/runtime/workspace-manager.js.map +1 -0
- package/dist/types.d.ts +273 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/world-client.d.ts +31 -0
- package/dist/world-client.js +227 -0
- package/dist/world-client.js.map +1 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# @your-world/cli
|
|
2
|
+
|
|
3
|
+
`yw` is the command line interface for YourWorld.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @your-world/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
Create a player profile:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
yw player init --player-name <player-name>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Create an agent workspace:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
yw play init --agent-name <agent-name> --adapter codex --goal "build your own home"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Run the agent from its workspace:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
cd <agent-name>
|
|
29
|
+
yw play run
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Server selection
|
|
33
|
+
|
|
34
|
+
By default, `yw` connects to the production server:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
https://api.youragents.world
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
To use a different server during development, pass `--server`:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
yw player init --player-name <player-name> --server http://127.0.0.1:3000
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Help
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
yw --help
|
|
50
|
+
yw play init --help
|
|
51
|
+
yw play run --help
|
|
52
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ExternalAgentAdapter, PreparedSession, PrepareSessionInput, RunningTurn, RunTurnInput } from './external-agent-adapter';
|
|
2
|
+
export interface CodexAdapterOptions {
|
|
3
|
+
command?: string[];
|
|
4
|
+
execArgsTemplate?: string[];
|
|
5
|
+
resumeArgsTemplate?: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare class CodexAdapter implements ExternalAgentAdapter {
|
|
8
|
+
readonly name = "codex";
|
|
9
|
+
private readonly command;
|
|
10
|
+
private readonly execArgsTemplate;
|
|
11
|
+
private readonly resumeArgsTemplate;
|
|
12
|
+
constructor(options?: CodexAdapterOptions);
|
|
13
|
+
prepareSession(_input: PrepareSessionInput): Promise<PreparedSession>;
|
|
14
|
+
runTurn(input: RunTurnInput): Promise<RunningTurn>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CodexAdapter = void 0;
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
const DEFAULT_COMMAND = ['codex'];
|
|
6
|
+
const DEFAULT_EXEC_ARGS_TEMPLATE = ['exec', '--dangerously-bypass-approvals-and-sandbox', '--skip-git-repo-check', '-C', '{workDir}'];
|
|
7
|
+
const DEFAULT_RESUME_ARGS_TEMPLATE = ['exec', 'resume', '--dangerously-bypass-approvals-and-sandbox', '--skip-git-repo-check', '{sessionId}'];
|
|
8
|
+
class CodexAdapter {
|
|
9
|
+
name = 'codex';
|
|
10
|
+
command;
|
|
11
|
+
execArgsTemplate;
|
|
12
|
+
resumeArgsTemplate;
|
|
13
|
+
constructor(options = {}) {
|
|
14
|
+
this.command = options.command && options.command.length > 0 ? [...options.command] : [...DEFAULT_COMMAND];
|
|
15
|
+
this.execArgsTemplate = options.execArgsTemplate && options.execArgsTemplate.length > 0 ? [...options.execArgsTemplate] : [...DEFAULT_EXEC_ARGS_TEMPLATE];
|
|
16
|
+
this.resumeArgsTemplate = options.resumeArgsTemplate && options.resumeArgsTemplate.length > 0 ? [...options.resumeArgsTemplate] : [...DEFAULT_RESUME_ARGS_TEMPLATE];
|
|
17
|
+
}
|
|
18
|
+
async prepareSession(_input) {
|
|
19
|
+
return {};
|
|
20
|
+
}
|
|
21
|
+
async runTurn(input) {
|
|
22
|
+
const argsTemplate = input.session.adapterSessionId ? this.resumeArgsTemplate : this.execArgsTemplate;
|
|
23
|
+
const args = argsTemplate.map((part) => substitute(part, input.session.adapterSessionId, input)).concat(input.prompt);
|
|
24
|
+
const child = (0, node_child_process_1.spawn)(this.command[0], [...this.command.slice(1), ...args], {
|
|
25
|
+
cwd: input.workDir,
|
|
26
|
+
env: process.env,
|
|
27
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
28
|
+
});
|
|
29
|
+
let adapterSessionId = input.session.adapterSessionId;
|
|
30
|
+
const capture = async (chunk) => {
|
|
31
|
+
const text = String(chunk);
|
|
32
|
+
const matched = text.match(/session id:\s*([a-z0-9-]+)/i) ?? text.match(/"session_id"\s*:\s*"([^"]+)"/i);
|
|
33
|
+
if (matched?.[1]) {
|
|
34
|
+
adapterSessionId = matched[1];
|
|
35
|
+
}
|
|
36
|
+
await input.onOutput?.(text);
|
|
37
|
+
};
|
|
38
|
+
child.stdout.on('data', (chunk) => {
|
|
39
|
+
void capture(chunk);
|
|
40
|
+
});
|
|
41
|
+
child.stderr.on('data', (chunk) => {
|
|
42
|
+
void capture(chunk);
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
completion: new Promise((resolve, reject) => {
|
|
46
|
+
child.once('error', reject);
|
|
47
|
+
child.once('exit', (exitCode, signal) => {
|
|
48
|
+
resolve({
|
|
49
|
+
exitCode,
|
|
50
|
+
signal,
|
|
51
|
+
adapterSessionId,
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
}),
|
|
55
|
+
cancel: async () => {
|
|
56
|
+
child.kill('SIGTERM');
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.CodexAdapter = CodexAdapter;
|
|
62
|
+
function substitute(template, sessionId, input) {
|
|
63
|
+
return template
|
|
64
|
+
.replaceAll('{sessionId}', sessionId ?? '')
|
|
65
|
+
.replaceAll('{workDir}', input.workDir)
|
|
66
|
+
.replaceAll('{runId}', input.runId)
|
|
67
|
+
.replaceAll('{runDir}', input.runDir)
|
|
68
|
+
.replaceAll('{promptFile}', input.promptFilePath);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=codex-adapter.js.map
|
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{
|
|
4
|
+
session: PlayerRuntimeSession;
|
|
5
|
+
workDir: string;
|
|
6
|
+
}
|
|
7
|
+
export interface PreparedSession {
|
|
8
|
+
adapterSessionId?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface RunTurnInput {
|
|
11
|
+
session: PlayerRuntimeSession;
|
|
12
|
+
workDir: string;
|
|
13
|
+
runId: string;
|
|
14
|
+
runDir: string;
|
|
15
|
+
prompt: string;
|
|
16
|
+
promptFilePath: string;
|
|
17
|
+
logger: Logger;
|
|
18
|
+
onOutput?: (chunk: string) => Promise<void> | void;
|
|
19
|
+
}
|
|
20
|
+
export interface RunTurnResult {
|
|
21
|
+
exitCode: number | null;
|
|
22
|
+
signal: NodeJS.Signals | null;
|
|
23
|
+
adapterSessionId?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface RunningTurn {
|
|
26
|
+
completion: Promise<RunTurnResult>;
|
|
27
|
+
cancel?: () => Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
export interface ExternalAgentAdapter {
|
|
30
|
+
readonly name: string;
|
|
31
|
+
prepareSession(input: PrepareSessionInput): Promise<PreparedSession>;
|
|
32
|
+
runTurn(input: RunTurnInput): Promise<RunningTurn>;
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external-agent-adapter.js","sourceRoot":"","sources":["../../src/adapters/external-agent-adapter.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ExternalAgentAdapter, PreparedSession, PrepareSessionInput, RunningTurn, RunTurnInput } from './external-agent-adapter';
|
|
2
|
+
export interface GenericCommandAdapterOptions {
|
|
3
|
+
name?: string;
|
|
4
|
+
command: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare class GenericCommandAdapter implements ExternalAgentAdapter {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
private readonly command;
|
|
9
|
+
constructor(options: GenericCommandAdapterOptions);
|
|
10
|
+
prepareSession(_input: PrepareSessionInput): Promise<PreparedSession>;
|
|
11
|
+
runTurn(input: RunTurnInput): Promise<RunningTurn>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenericCommandAdapter = void 0;
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
class GenericCommandAdapter {
|
|
6
|
+
name;
|
|
7
|
+
command;
|
|
8
|
+
constructor(options) {
|
|
9
|
+
if (options.command.length === 0) {
|
|
10
|
+
throw new Error('GenericCommandAdapter requires a command.');
|
|
11
|
+
}
|
|
12
|
+
this.name = options.name ?? 'generic-command';
|
|
13
|
+
this.command = [...options.command];
|
|
14
|
+
}
|
|
15
|
+
async prepareSession(_input) {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
async runTurn(input) {
|
|
19
|
+
const command = this.command.map((part) => substitute(part, input));
|
|
20
|
+
const child = (0, node_child_process_1.spawn)(command[0], command.slice(1), {
|
|
21
|
+
cwd: input.workDir,
|
|
22
|
+
env: {
|
|
23
|
+
...process.env,
|
|
24
|
+
YW_RUN_ID: input.runId,
|
|
25
|
+
YW_WORK_DIR: input.workDir,
|
|
26
|
+
YW_PROMPT_FILE: input.promptFilePath,
|
|
27
|
+
YW_SESSION_FILE: `${input.workDir}/session.json`,
|
|
28
|
+
},
|
|
29
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
30
|
+
});
|
|
31
|
+
child.stdout.on('data', (chunk) => {
|
|
32
|
+
void input.onOutput?.(String(chunk));
|
|
33
|
+
});
|
|
34
|
+
child.stderr.on('data', (chunk) => {
|
|
35
|
+
void input.onOutput?.(String(chunk));
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
completion: new Promise((resolve, reject) => {
|
|
39
|
+
child.once('error', reject);
|
|
40
|
+
child.once('exit', (exitCode, signal) => {
|
|
41
|
+
resolve({
|
|
42
|
+
exitCode,
|
|
43
|
+
signal,
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
}),
|
|
47
|
+
cancel: async () => {
|
|
48
|
+
child.kill('SIGTERM');
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.GenericCommandAdapter = GenericCommandAdapter;
|
|
54
|
+
function substitute(template, input) {
|
|
55
|
+
return template.replaceAll('{workDir}', input.workDir).replaceAll('{runId}', input.runId).replaceAll('{runDir}', input.runDir).replaceAll('{promptFile}', input.promptFilePath);
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=generic-command-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generic-command-adapter.js","sourceRoot":"","sources":["../../src/adapters/generic-command-adapter.ts"],"names":[],"mappings":";;;AAAA,2DAA2C;AAS3C,MAAa,qBAAqB;IACrB,IAAI,CAAS;IAEL,OAAO,CAAW;IAEnC,YAAY,OAAqC;QAC7C,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QACjE,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,iBAAiB,CAAC;QAC9C,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,MAA2B;QAC5C,OAAO,EAAE,CAAC;IACd,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,KAAmB;QAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;QACpE,MAAM,KAAK,GAAG,IAAA,0BAAK,EAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC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ACrD,OAAO,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;AACpL,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LastActionRecord, RunReceiptRecord } from '../runtime/runtime-types';
|
|
2
|
+
import { SessionStore } from '../runtime/session-store';
|
|
3
|
+
import { Action, ActRequest, ActResponse } from '../types';
|
|
4
|
+
import { ParsedArgs } from './shared';
|
|
5
|
+
interface SubmitActionOptions {
|
|
6
|
+
store: SessionStore;
|
|
7
|
+
runId: string;
|
|
8
|
+
action: Action;
|
|
9
|
+
actImpl?: (action: ActRequest) => Promise<ActResponse>;
|
|
10
|
+
}
|
|
11
|
+
interface SubmitActionResult {
|
|
12
|
+
sessionAgentId: string;
|
|
13
|
+
actionRecord: LastActionRecord;
|
|
14
|
+
receipt: RunReceiptRecord;
|
|
15
|
+
}
|
|
16
|
+
export declare function runAction(args: ParsedArgs): Promise<void>;
|
|
17
|
+
export declare function runActionSubmit(args: ParsedArgs): Promise<void>;
|
|
18
|
+
export declare function submitActionForCurrentRun(options: SubmitActionOptions): Promise<SubmitActionResult>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runAction = runAction;
|
|
4
|
+
exports.runActionSubmit = runActionSubmit;
|
|
5
|
+
exports.submitActionForCurrentRun = submitActionForCurrentRun;
|
|
6
|
+
const node_crypto_1 = require("node:crypto");
|
|
7
|
+
const promises_1 = require("node:fs/promises");
|
|
8
|
+
const session_store_1 = require("../runtime/session-store");
|
|
9
|
+
const shared_1 = require("./shared");
|
|
10
|
+
async function runAction(args) {
|
|
11
|
+
const subcommand = args.positionals[0];
|
|
12
|
+
if (subcommand === 'submit') {
|
|
13
|
+
await runActionSubmit(args);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (subcommand === 'status') {
|
|
17
|
+
await runActionStatus(args);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (subcommand === 'last') {
|
|
21
|
+
await runActionLast(args);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
throw new shared_1.CliError('INVALID_COMMAND', 'action requires "submit", "status", or "last".');
|
|
25
|
+
}
|
|
26
|
+
async function runActionSubmit(args) {
|
|
27
|
+
const workDir = await (0, shared_1.resolveWorkDir)(args);
|
|
28
|
+
const store = new session_store_1.SessionStore(workDir);
|
|
29
|
+
const session = await store.requireSession();
|
|
30
|
+
const runId = (0, shared_1.requireOption)(args, 'run-id');
|
|
31
|
+
const client = await (0, shared_1.createClientFromSession)(session);
|
|
32
|
+
const action = await parseActionInput(args);
|
|
33
|
+
const result = await submitActionForCurrentRun({
|
|
34
|
+
store,
|
|
35
|
+
runId,
|
|
36
|
+
action,
|
|
37
|
+
actImpl: (payload) => client.act(payload),
|
|
38
|
+
});
|
|
39
|
+
(0, shared_1.printJson)({
|
|
40
|
+
ok: true,
|
|
41
|
+
agentId: result.sessionAgentId,
|
|
42
|
+
lastAction: result.actionRecord,
|
|
43
|
+
receipt: result.receipt,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
async function submitActionForCurrentRun(options) {
|
|
47
|
+
const session = await options.store.requireSession();
|
|
48
|
+
if (session.activeRunId !== options.runId) {
|
|
49
|
+
throw new shared_1.CliError('STALE_RUN', `Run ${options.runId} is no longer active.`);
|
|
50
|
+
}
|
|
51
|
+
if (session.runState !== 'running' && session.runState !== 'submitted') {
|
|
52
|
+
throw new shared_1.CliError('STALE_RUN', `Run ${options.runId} is no longer active.`);
|
|
53
|
+
}
|
|
54
|
+
if (session.activeContextTick === undefined) {
|
|
55
|
+
throw new shared_1.CliError('INVALID_SESSION', 'Current session is missing activeContextTick.');
|
|
56
|
+
}
|
|
57
|
+
const existingReceipt = await options.store.readRunReceipt(options.runId);
|
|
58
|
+
if (existingReceipt) {
|
|
59
|
+
throw new shared_1.CliError('RUN_ALREADY_SUBMITTED', `Run ${options.runId} has already submitted an action.`);
|
|
60
|
+
}
|
|
61
|
+
const expectedStartTick = session.latestObservedTick + 1;
|
|
62
|
+
if (session.lastSubmittedStartTick !== undefined && session.lastSubmittedStartTick === expectedStartTick) {
|
|
63
|
+
throw new shared_1.CliError('START_TICK_ALREADY_SUBMITTED', `An action for startTick ${expectedStartTick} was already submitted locally.`);
|
|
64
|
+
}
|
|
65
|
+
const action = {
|
|
66
|
+
...options.action,
|
|
67
|
+
actionId: options.action.actionId ?? `run-${options.runId}-${(0, node_crypto_1.randomUUID)()}`,
|
|
68
|
+
};
|
|
69
|
+
const actImpl = options.actImpl;
|
|
70
|
+
if (!actImpl) {
|
|
71
|
+
throw new shared_1.CliError('INVALID_STATE', 'Missing act implementation.');
|
|
72
|
+
}
|
|
73
|
+
const request = {
|
|
74
|
+
...action,
|
|
75
|
+
basedOnTick: session.activeContextTick,
|
|
76
|
+
intendedStartTick: session.activeContextTick + 1,
|
|
77
|
+
};
|
|
78
|
+
const response = await actImpl(request);
|
|
79
|
+
const actionRecord = {
|
|
80
|
+
runId: options.runId,
|
|
81
|
+
contextTick: session.activeContextTick,
|
|
82
|
+
actionId: action.actionId ?? 'unknown-action',
|
|
83
|
+
action,
|
|
84
|
+
response,
|
|
85
|
+
};
|
|
86
|
+
const receipt = {
|
|
87
|
+
runId: options.runId,
|
|
88
|
+
contextTick: session.activeContextTick,
|
|
89
|
+
submittedAtServerTick: session.latestObservedTick,
|
|
90
|
+
response,
|
|
91
|
+
};
|
|
92
|
+
await options.store.writeLastAction(actionRecord);
|
|
93
|
+
await options.store.writeRunReceipt(options.runId, receipt);
|
|
94
|
+
await options.store.writeSession({
|
|
95
|
+
...session,
|
|
96
|
+
runState: 'submitted',
|
|
97
|
+
lastSubmittedContextTick: session.activeContextTick,
|
|
98
|
+
lastSubmittedStartTick: response.startTick,
|
|
99
|
+
lastActionId: action.actionId,
|
|
100
|
+
});
|
|
101
|
+
return {
|
|
102
|
+
sessionAgentId: session.agentId,
|
|
103
|
+
actionRecord,
|
|
104
|
+
receipt,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
async function runActionStatus(args) {
|
|
108
|
+
const workDir = await (0, shared_1.resolveWorkDir)(args);
|
|
109
|
+
const store = new session_store_1.SessionStore(workDir);
|
|
110
|
+
const session = await store.requireSession();
|
|
111
|
+
const runId = (0, shared_1.getOption)(args, 'run-id') ?? session.activeRunId;
|
|
112
|
+
const receipt = runId ? await store.readRunReceipt(runId) : null;
|
|
113
|
+
(0, shared_1.printJson)({
|
|
114
|
+
activeRunId: session.activeRunId,
|
|
115
|
+
runState: session.runState,
|
|
116
|
+
runId,
|
|
117
|
+
submitted: receipt !== null,
|
|
118
|
+
receipt,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
async function runActionLast(args) {
|
|
122
|
+
const workDir = await (0, shared_1.resolveWorkDir)(args);
|
|
123
|
+
const store = new session_store_1.SessionStore(workDir);
|
|
124
|
+
(0, shared_1.printJson)(await store.readLastAction());
|
|
125
|
+
}
|
|
126
|
+
async function parseActionInput(args) {
|
|
127
|
+
const jsonValue = (0, shared_1.getOption)(args, 'json');
|
|
128
|
+
if (jsonValue) {
|
|
129
|
+
return parseJson(jsonValue, '--json');
|
|
130
|
+
}
|
|
131
|
+
const filePath = (0, shared_1.getOption)(args, 'file');
|
|
132
|
+
if (filePath) {
|
|
133
|
+
const raw = await (0, promises_1.readFile)(filePath, 'utf8');
|
|
134
|
+
return parseJson(raw, '--file');
|
|
135
|
+
}
|
|
136
|
+
const verb = (0, shared_1.getOption)(args, 'verb');
|
|
137
|
+
if (!verb) {
|
|
138
|
+
throw new shared_1.CliError('MISSING_ACTION', 'Provide --json, --file, or --verb.');
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
verb,
|
|
142
|
+
...((0, shared_1.getOption)(args, 'target-json')
|
|
143
|
+
? {
|
|
144
|
+
target: parseTargetJson((0, shared_1.getOption)(args, 'target-json')),
|
|
145
|
+
}
|
|
146
|
+
: {}),
|
|
147
|
+
...((0, shared_1.getOption)(args, 'params-json') ? { params: parseJson((0, shared_1.getOption)(args, 'params-json'), '--params-json') } : {}),
|
|
148
|
+
...((0, shared_1.getOption)(args, 'reason') ? { reason: (0, shared_1.getOption)(args, 'reason') } : {}),
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
function parseJson(raw, label) {
|
|
152
|
+
try {
|
|
153
|
+
return JSON.parse(raw);
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
throw new shared_1.CliError('INVALID_JSON', `${label} must contain valid JSON: ${error instanceof Error ? error.message : String(error)}`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function parseTargetJson(raw) {
|
|
160
|
+
const parsed = parseJson(raw, '--target-json');
|
|
161
|
+
if (typeof parsed === 'string' || typeof parsed === 'number') {
|
|
162
|
+
return parsed;
|
|
163
|
+
}
|
|
164
|
+
if (typeof parsed === 'object' && parsed !== null) {
|
|
165
|
+
return parsed;
|
|
166
|
+
}
|
|
167
|
+
throw new shared_1.CliError('INVALID_ACTION', '--target-json must decode to a string, number, or JSON object.');
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=action-submit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-submit.js","sourceRoot":"","sources":["../../src/cli/action-submit.ts"],"names":[],"mappings":";;AAqBA,8BAkBC;AAED,0CAqBC;AAED,8DAoEC;AApID,6CAAyC;AACzC,+CAA4C;AAG5C,4DAAwD;AAExD,qCAA8H;AAevH,KAAK,UAAU,SAAS,CAAC,IAAgB;IAC5C,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC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