@paleo/alcode 0.1.0 → 0.2.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/dist/cli.d.ts CHANGED
@@ -15,6 +15,7 @@ export interface AlcodeArgs {
15
15
  protocol?: string;
16
16
  message?: string;
17
17
  model?: string;
18
+ meta?: string;
18
19
  guide: boolean;
19
20
  openclawGuide: boolean;
20
21
  help: boolean;
package/dist/cli.js CHANGED
@@ -64,6 +64,7 @@ function buildFrontmatter(parsed, now) {
64
64
  model: parsed.model ?? null,
65
65
  sessionId: null,
66
66
  command: formatCommand(parsed),
67
+ meta: parsed.meta ?? null,
67
68
  startedAt: now.toISOString(),
68
69
  endedAt: null,
69
70
  exitReason: null,
@@ -96,6 +97,8 @@ function formatCommand(parsed) {
96
97
  parts.push("--model", parsed.model);
97
98
  if (parsed.message)
98
99
  parts.push("--message", JSON.stringify(parsed.message));
100
+ if (parsed.meta)
101
+ parts.push("--meta", JSON.stringify(parsed.meta));
99
102
  return parts.join(" ");
100
103
  }
101
104
  export function parseAlcodeArgs(argv) {
@@ -108,6 +111,7 @@ export function parseAlcodeArgs(argv) {
108
111
  protocol: { type: "string" },
109
112
  message: { type: "string" },
110
113
  model: { type: "string" },
114
+ meta: { type: "string" },
111
115
  guide: { type: "boolean", default: false },
112
116
  "openclaw-guide": { type: "boolean", default: false },
113
117
  help: { type: "boolean", default: false },
@@ -121,6 +125,7 @@ export function parseAlcodeArgs(argv) {
121
125
  protocol: values.protocol,
122
126
  message: values.message,
123
127
  model: values.model,
128
+ meta: values.meta,
124
129
  guide: values.guide === true,
125
130
  openclawGuide: values["openclaw-guide"] === true,
126
131
  help: values.help === true,
@@ -179,6 +184,9 @@ Options:
179
184
  --ticket <id> Ticket ID. Required with --new + --protocol.
180
185
  --message "..." Message to send. Required for spec, aad, and when no --protocol.
181
186
  --model <model> Model override.
187
+ --meta "..." Opaque handoff string, stored verbatim in the session file frontmatter
188
+ (\`meta:\`). alcode never interprets it; a later reader of the session file
189
+ (e.g. the caller reporting the run's outcome) can use it.
182
190
 
183
191
  Env:
184
192
  ALIGNFIRST_CODE_SKIP_PERMISSIONS 1 to run the coding agent with permission prompts disabled.
@@ -5,6 +5,7 @@ export interface SessionFrontmatter {
5
5
  model: string | null;
6
6
  sessionId: string | null;
7
7
  command: string;
8
+ meta: string | null;
8
9
  startedAt: string;
9
10
  endedAt: string | null;
10
11
  exitReason: string | null;
@@ -94,6 +94,7 @@ export function parseFrontmatter(block) {
94
94
  model: map.model ?? null,
95
95
  sessionId: map.sessionId ?? null,
96
96
  command: map.command ?? "",
97
+ meta: map.meta ?? null,
97
98
  startedAt: map.startedAt ?? "",
98
99
  endedAt: map.endedAt ?? null,
99
100
  exitReason: map.exitReason ?? null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paleo/alcode",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "license": "CC0-1.0",
5
5
  "author": "Thomas MUR",
6
6
  "description": "Run a coding agent through AlignFirst protocols, with a durable session file per run.",
@@ -2,3 +2,4 @@ Under OpenClaw, background it through the `exec` tool:
2
2
 
3
3
  - Pass `background: true` and `timeout: 0` (no kill timer). Never rely on the auto-yield or a finite timeout.
4
4
  - Set the exec `workdir` to the project root as an **absolute** path (`~` is not expanded there), or `cd` into the project inside the command itself.
5
+ - If the outcome must be reported into a thread **you created yourself** via `message` `action: "thread-create"`, add `--meta "<THREAD_ID>"` with that thread's `chat_id`: the completion wake's plain reply goes to this session's default surface (the channel), and only the session file's `meta` can point your report back at the thread (via `message` `action: "thread-reply"`). In every other case omit `--meta` — platform-threaded replies and thread-bound sessions already report in the right place.
@@ -22,8 +22,8 @@ Every run writes a session file under `.plans/`: `.plans/<ticket>/coding-session
22
22
 
23
23
  {{WAKE}}
24
24
 
25
- 1. **Read the run's session file** (the path `alcode` printed on its first line, under `coding-sessions/`). Its frontmatter holds `status` (`succeeded` / `failed`) and the session id; the `---- Result ----` block holds the outcome.
26
- 2. **Report the outcome to the user** where the work was requested. Send one concise message: succeeded or failed, plus a one-line summary of the result for the audience.
25
+ 1. **Read the run's session file** (the path `alcode` printed on its first line, under `coding-sessions/`). Its frontmatter holds `status` (`succeeded` / `failed`) and the session id; the `---- Result ----` block holds the outcome. If you set `meta` at launch, it is there too.
26
+ 2. **Report the outcome to the user** where the work was requested. Send one concise message: succeeded or failed, plus a one-line summary of the result for the audience. If the frontmatter `meta` carries a destination (e.g. a thread target), route this report there — a plain reply from the wake turn goes to the session's default surface, which may not be where the work was requested.
27
27
  3. Do **not** re-verify the repo, re-run the coding agent, fetch/merge branches, or inspect `git`. The coding agent already did the work and the session file is authoritative. Relay its outcome, nothing more.
28
28
 
29
29
  If the session file says the run failed, report that plainly and propose the next step; don't silently retry.
@@ -44,6 +44,7 @@ alcode --resume <sessionId> [--protocol <protocol>] [--message "..."]
44
44
  | `--ticket <id>` | Ticket ID. Required with `--new` + `--protocol`. |
45
45
  | `--message "..."` | Message to send. Required for `spec`, `aad`, and when no `--protocol`. |
46
46
  | `--model <model>` | Model override. |
47
+ | `--meta "..."` | Opaque handoff string stored verbatim in the session file's `meta:` frontmatter. `alcode` never reads it — it's for you to stash context the run's later reader needs (e.g. where to report the outcome). |
47
48
 
48
49
  For `--new` runs, the `Session ID:` is printed to stdout and written to the session file frontmatter (the durable source of truth). Save it to resume the conversation later.
49
50