@lumenflow/cli 3.17.6 → 3.18.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.
Files changed (62) hide show
  1. package/dist/init-detection.js +5 -3
  2. package/dist/init-detection.js.map +1 -1
  3. package/dist/init-docs-scaffolder.js +96 -0
  4. package/dist/init-docs-scaffolder.js.map +1 -0
  5. package/dist/init-package-config.js +135 -0
  6. package/dist/init-package-config.js.map +1 -0
  7. package/dist/init-safety-scripts.js +129 -0
  8. package/dist/init-safety-scripts.js.map +1 -0
  9. package/dist/init-templates.js +4 -4
  10. package/dist/init-templates.js.map +1 -1
  11. package/dist/init.js +13 -302
  12. package/dist/init.js.map +1 -1
  13. package/dist/initiative-plan.js +1 -1
  14. package/dist/initiative-plan.js.map +1 -1
  15. package/dist/onboarding-template-paths.js +0 -1
  16. package/dist/onboarding-template-paths.js.map +1 -1
  17. package/dist/pre-commit-check.js +1 -1
  18. package/dist/pre-commit-check.js.map +1 -1
  19. package/dist/wu-done.js +389 -423
  20. package/dist/wu-done.js.map +1 -1
  21. package/dist/wu-edit-operations.js +4 -0
  22. package/dist/wu-edit-operations.js.map +1 -1
  23. package/dist/wu-edit-validators.js +4 -0
  24. package/dist/wu-edit-validators.js.map +1 -1
  25. package/dist/wu-edit.js +11 -0
  26. package/dist/wu-edit.js.map +1 -1
  27. package/dist/wu-spawn-strategy-resolver.js +13 -1
  28. package/dist/wu-spawn-strategy-resolver.js.map +1 -1
  29. package/package.json +8 -8
  30. package/packs/agent-runtime/.turbo/turbo-build.log +4 -0
  31. package/packs/agent-runtime/README.md +147 -0
  32. package/packs/agent-runtime/capability-factory.ts +104 -0
  33. package/packs/agent-runtime/config.schema.json +87 -0
  34. package/packs/agent-runtime/constants.ts +21 -0
  35. package/packs/agent-runtime/index.ts +11 -0
  36. package/packs/agent-runtime/manifest.ts +207 -0
  37. package/packs/agent-runtime/manifest.yaml +193 -0
  38. package/packs/agent-runtime/orchestration.ts +1787 -0
  39. package/packs/agent-runtime/pack-registration.ts +110 -0
  40. package/packs/agent-runtime/package.json +57 -0
  41. package/packs/agent-runtime/policy-factory.ts +165 -0
  42. package/packs/agent-runtime/tool-impl/agent-turn-tools.ts +793 -0
  43. package/packs/agent-runtime/tool-impl/index.ts +5 -0
  44. package/packs/agent-runtime/tool-impl/provider-adapters.ts +1245 -0
  45. package/packs/agent-runtime/tools/index.ts +4 -0
  46. package/packs/agent-runtime/tools/types.ts +47 -0
  47. package/packs/agent-runtime/tsconfig.json +20 -0
  48. package/packs/agent-runtime/types.ts +128 -0
  49. package/packs/agent-runtime/vitest.config.ts +11 -0
  50. package/packs/sidekick/.turbo/turbo-build.log +1 -1
  51. package/packs/sidekick/package.json +1 -1
  52. package/packs/sidekick/vitest.config.ts +11 -0
  53. package/packs/software-delivery/.turbo/turbo-build.log +1 -1
  54. package/packs/software-delivery/package.json +1 -1
  55. package/packs/software-delivery/vitest.config.ts +11 -0
  56. package/templates/core/.lumenflow/rules/wu-workflow.md.template +1 -1
  57. package/templates/core/LUMENFLOW.md.template +2 -2
  58. package/templates/core/ai/onboarding/first-wu-mistakes.md.template +2 -2
  59. package/templates/core/ai/onboarding/quick-ref-commands.md.template +1 -1
  60. package/templates/core/ai/onboarding/starting-prompt.md.template +1 -1
  61. package/templates/vendors/claude/.claude/skills/frontend-design/SKILL.md.template +1 -1
  62. package/templates/core/ai/onboarding/wu-sizing-guide.md.template +0 -84
@@ -0,0 +1,4 @@
1
+ // Copyright (c) 2026 Hellmai Ltd
2
+ // SPDX-License-Identifier: AGPL-3.0-only
3
+
4
+ export * from './types.js';
@@ -0,0 +1,47 @@
1
+ // Copyright (c) 2026 Hellmai Ltd
2
+ // SPDX-License-Identifier: AGPL-3.0-only
3
+
4
+ import type { ToolScope } from '@lumenflow/kernel';
5
+ import {
6
+ AGENT_RUNTIME_DOMAIN,
7
+ AGENT_RUNTIME_PACK_ID,
8
+ AGENT_RUNTIME_PACK_VERSION,
9
+ } from '../constants.js';
10
+ import type { AgentRuntimeToolName } from '../types.js';
11
+
12
+ export const AGENT_RUNTIME_TOOL_PERMISSIONS = {
13
+ READ: 'read',
14
+ WRITE: 'write',
15
+ ADMIN: 'admin',
16
+ } as const;
17
+
18
+ export type AgentRuntimeToolPermission =
19
+ (typeof AGENT_RUNTIME_TOOL_PERMISSIONS)[keyof typeof AGENT_RUNTIME_TOOL_PERMISSIONS];
20
+
21
+ export interface AgentRuntimeToolDescriptor {
22
+ name: AgentRuntimeToolName;
23
+ domain: typeof AGENT_RUNTIME_DOMAIN;
24
+ pack: typeof AGENT_RUNTIME_PACK_ID;
25
+ version: typeof AGENT_RUNTIME_PACK_VERSION;
26
+ permission: AgentRuntimeToolPermission;
27
+ required_scopes: ToolScope[];
28
+ entry: string;
29
+ }
30
+
31
+ export interface AgentRuntimeToolDescriptorInput {
32
+ name: AgentRuntimeToolDescriptor['name'];
33
+ permission: AgentRuntimeToolDescriptor['permission'];
34
+ required_scopes: AgentRuntimeToolDescriptor['required_scopes'];
35
+ entry: AgentRuntimeToolDescriptor['entry'];
36
+ }
37
+
38
+ export function createAgentRuntimeToolDescriptor(
39
+ input: AgentRuntimeToolDescriptorInput,
40
+ ): AgentRuntimeToolDescriptor {
41
+ return {
42
+ ...input,
43
+ domain: AGENT_RUNTIME_DOMAIN,
44
+ pack: AGENT_RUNTIME_PACK_ID,
45
+ version: AGENT_RUNTIME_PACK_VERSION,
46
+ };
47
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "extends": "../../../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "target": "ES2023",
5
+ "lib": ["ES2023"],
6
+ "outDir": "./dist",
7
+ "rootDir": ".",
8
+ "noEmit": false,
9
+ "declaration": true,
10
+ "strict": true,
11
+ "useUnknownInCatchVariables": false,
12
+ "noUnusedLocals": false,
13
+ "noUnusedParameters": false,
14
+ "allowJs": false,
15
+ "checkJs": false,
16
+ "noEmitOnError": true
17
+ },
18
+ "include": ["*.ts", "tools/**/*.ts", "tool-impl/**/*.ts"],
19
+ "exclude": ["node_modules", "dist", "__tests__"]
20
+ }
@@ -0,0 +1,128 @@
1
+ // Copyright (c) 2026 Hellmai Ltd
2
+ // SPDX-License-Identifier: AGPL-3.0-only
3
+
4
+ import {
5
+ AGENT_RUNTIME_API_KEY_ENV,
6
+ AGENT_RUNTIME_BASE_URL_ENV,
7
+ AGENT_RUNTIME_PACK_ID,
8
+ } from './constants.js';
9
+
10
+ export const AGENT_RUNTIME_PROVIDER_KINDS = {
11
+ OPENAI_COMPATIBLE: 'openai_compatible',
12
+ MESSAGES_COMPATIBLE: 'messages_compatible',
13
+ } as const;
14
+
15
+ export const AGENT_RUNTIME_TURN_STATUSES = {
16
+ REPLY: 'reply',
17
+ TOOL_REQUEST: 'tool_request',
18
+ COMPLETE: 'complete',
19
+ ESCALATE: 'escalate',
20
+ } as const;
21
+
22
+ export const AGENT_RUNTIME_TOOL_NAMES = {
23
+ EXECUTE_TURN: 'agent:execute-turn',
24
+ } as const;
25
+
26
+ export type AgentRuntimePackId = typeof AGENT_RUNTIME_PACK_ID;
27
+ export type AgentRuntimeProviderKind =
28
+ (typeof AGENT_RUNTIME_PROVIDER_KINDS)[keyof typeof AGENT_RUNTIME_PROVIDER_KINDS];
29
+ export type AgentRuntimeTurnStatus =
30
+ (typeof AGENT_RUNTIME_TURN_STATUSES)[keyof typeof AGENT_RUNTIME_TURN_STATUSES];
31
+ export type AgentRuntimeToolName =
32
+ (typeof AGENT_RUNTIME_TOOL_NAMES)[keyof typeof AGENT_RUNTIME_TOOL_NAMES];
33
+
34
+ export interface AgentRuntimeModelProfileConfig {
35
+ provider: AgentRuntimeProviderKind;
36
+ model: string;
37
+ api_key_env: string;
38
+ base_url?: string;
39
+ base_url_env?: string;
40
+ }
41
+
42
+ export interface AgentRuntimeIntentConfig {
43
+ description: string;
44
+ allow_tools: string[];
45
+ approval_required_tools?: string[];
46
+ }
47
+
48
+ export interface AgentRuntimeLimitsConfig {
49
+ max_turns_per_session?: number;
50
+ max_tool_calls_per_session?: number;
51
+ max_input_bytes?: number;
52
+ }
53
+
54
+ export interface AgentRuntimePackConfig {
55
+ default_model: string;
56
+ models: Record<string, AgentRuntimeModelProfileConfig>;
57
+ intents?: Record<string, AgentRuntimeIntentConfig>;
58
+ limits?: AgentRuntimeLimitsConfig;
59
+ }
60
+
61
+ export interface AgentRuntimeMessage {
62
+ role: 'system' | 'user' | 'assistant' | 'tool';
63
+ content: string;
64
+ tool_name?: string;
65
+ tool_call_id?: string;
66
+ }
67
+
68
+ export interface AgentRuntimeToolCatalogEntry {
69
+ name: string;
70
+ description: string;
71
+ input_schema?: Record<string, unknown>;
72
+ }
73
+
74
+ export interface AgentRuntimeIntentCatalogEntry {
75
+ id: string;
76
+ description: string;
77
+ }
78
+
79
+ export interface AgentRuntimeExecuteTurnInput {
80
+ session_id: string;
81
+ messages: AgentRuntimeMessage[];
82
+ model_profile: string;
83
+ url: string;
84
+ stream?: boolean;
85
+ tool_catalog?: AgentRuntimeToolCatalogEntry[];
86
+ intent_catalog?: AgentRuntimeIntentCatalogEntry[];
87
+ limits?: AgentRuntimeLimitsConfig;
88
+ }
89
+
90
+ export interface AgentRuntimeStreamSnapshot {
91
+ sequence: number;
92
+ state: 'partial' | 'final';
93
+ data: Record<string, unknown>;
94
+ }
95
+
96
+ export interface AgentRuntimeRequestedTool {
97
+ name: string;
98
+ input: Record<string, unknown>;
99
+ }
100
+
101
+ export interface AgentRuntimeUsage {
102
+ input_tokens?: number;
103
+ output_tokens?: number;
104
+ total_tokens?: number;
105
+ }
106
+
107
+ export interface AgentRuntimeProviderDescriptor {
108
+ kind: AgentRuntimeProviderKind;
109
+ model: string;
110
+ }
111
+
112
+ export interface AgentRuntimeExecuteTurnOutput {
113
+ status: AgentRuntimeTurnStatus;
114
+ intent: string;
115
+ assistant_message: string;
116
+ requested_tool?: AgentRuntimeRequestedTool;
117
+ provider: AgentRuntimeProviderDescriptor;
118
+ usage?: AgentRuntimeUsage;
119
+ finish_reason: string;
120
+ }
121
+
122
+ export const AGENT_RUNTIME_DECLARED_ENVIRONMENT_VARIABLES = [
123
+ AGENT_RUNTIME_API_KEY_ENV,
124
+ AGENT_RUNTIME_BASE_URL_ENV,
125
+ ] as const;
126
+
127
+ export type AgentRuntimeDeclaredEnvironmentVariable =
128
+ (typeof AGENT_RUNTIME_DECLARED_ENVIRONMENT_VARIABLES)[number];
@@ -0,0 +1,11 @@
1
+ import { defineConfig } from 'vitest/config';
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ globals: true,
6
+ environment: 'node',
7
+ include: ['__tests__/**/*.test.ts', '**/*.spec.ts'],
8
+ exclude: ['**/node_modules/**', '**/dist/**'],
9
+ passWithNoTests: false,
10
+ },
11
+ });
@@ -1,4 +1,4 @@
1
1
 
2
- > @lumenflow/packs-sidekick@3.17.6 build /home/runner/work/lumenflow-dev/lumenflow-dev/packages/@lumenflow/packs/sidekick
2
+ > @lumenflow/packs-sidekick@3.18.0 build /home/runner/work/lumenflow-dev/lumenflow-dev/packages/@lumenflow/packs/sidekick
3
3
  > tsc
4
4
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumenflow/packs-sidekick",
3
- "version": "3.17.6",
3
+ "version": "3.18.0",
4
4
  "description": "Sidekick personal assistant pack for LumenFlow — 16 tools for task management, typed memory, channels, routines, and audit",
5
5
  "keywords": [
6
6
  "lumenflow",
@@ -0,0 +1,11 @@
1
+ import { defineConfig } from 'vitest/config';
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ globals: true,
6
+ environment: 'node',
7
+ include: ['__tests__/**/*.test.ts', '**/*.spec.ts'],
8
+ exclude: ['**/node_modules/**', '**/dist/**'],
9
+ passWithNoTests: false,
10
+ },
11
+ });
@@ -1,4 +1,4 @@
1
1
 
2
- > @lumenflow/packs-software-delivery@3.17.6 build /home/runner/work/lumenflow-dev/lumenflow-dev/packages/@lumenflow/packs/software-delivery
2
+ > @lumenflow/packs-software-delivery@3.18.0 build /home/runner/work/lumenflow-dev/lumenflow-dev/packages/@lumenflow/packs/software-delivery
3
3
  > tsc
4
4
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumenflow/packs-software-delivery",
3
- "version": "3.17.6",
3
+ "version": "3.18.0",
4
4
  "description": "Software delivery pack for LumenFlow — work units, gates, lanes, initiatives, and agent coordination",
5
5
  "keywords": [
6
6
  "lumenflow",
@@ -0,0 +1,11 @@
1
+ import { defineConfig } from 'vitest/config';
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ globals: true,
6
+ environment: 'node',
7
+ include: ['__tests__/**/*.test.ts', '**/*.spec.ts'],
8
+ exclude: ['**/node_modules/**', '**/dist/**'],
9
+ passWithNoTests: false,
10
+ },
11
+ });
@@ -15,7 +15,7 @@ ready -> in_progress -> done
15
15
 
16
16
  ```bash
17
17
  # 1. Check lane is free
18
- cat docs/04-operations/tasks/status.md
18
+ cat docs/operations/tasks/status.md
19
19
 
20
20
  # 2. Claim the WU (creates worktree)
21
21
  pnpm wu:claim --id WU-XXX --lane <Lane>
@@ -8,7 +8,7 @@
8
8
 
9
9
  LumenFlow is a vendor-agnostic workflow framework for AI-native software development.
10
10
 
11
- > **Context Safety**: When approaching context limits (80% usage, 50+ tool calls), spawn a fresh agent instead of continuing after compaction. See [wu-sizing-guide.md]({{DOCS_ONBOARDING_PATH}}/wu-sizing-guide.md).
11
+ > **Context Safety**: When approaching context limits (80% usage, 50+ tool calls), spawn a fresh agent instead of continuing after compaction. See [wu-sizing-guide.md]({{DOCS_OPERATIONS_PATH}}/_frameworks/lumenflow/wu-sizing-guide.md).
12
12
 
13
13
  ---
14
14
 
@@ -358,6 +358,6 @@ Supported clients: `claude-code`, `codex-cli`, `cursor`, `gemini-cli`, `windsurf
358
358
  - [Quick Reference: Commands]({{QUICK_REF_LINK}}) -- Complete CLI reference (100+ commands)
359
359
  - [Troubleshooting wu:done]({{DOCS_ONBOARDING_PATH}}/troubleshooting-wu-done.md) -- Most common completion mistakes
360
360
  - [.lumenflow/constraints.md](.lumenflow/constraints.md) -- Non-negotiable rules and forbidden commands
361
- - [WU Sizing Guide]({{DOCS_ONBOARDING_PATH}}/wu-sizing-guide.md) -- Scoping work without needless fragmentation
361
+ - [WU Sizing Guide]({{DOCS_OPERATIONS_PATH}}/_frameworks/lumenflow/wu-sizing-guide.md) -- Scoping work without needless fragmentation
362
362
  - [Skills Index](.claude/skills/INDEX.md)
363
363
  - [Agents README](.claude/agents/README.md)
@@ -330,7 +330,7 @@ sizing_estimate:
330
330
  strategy: checkpoint-resume
331
331
  ```
332
332
 
333
- 3. **Split the WU** only if the work is no longer atomic or should land independently (see [wu-sizing-guide.md](./wu-sizing-guide.md) section 3 for splitting patterns).
333
+ 3. **Split the WU** only if the work is no longer atomic or should land independently (see [wu-sizing-guide.md](../../wu-sizing-guide.md) section 3 for splitting patterns).
334
334
 
335
335
  **Strict mode:** Teams can enforce sizing compliance for delegated work with `--strict-sizing` on `wu:brief`. In strict mode, missing or non-compliant sizing metadata blocks the operation.
336
336
 
@@ -339,7 +339,7 @@ sizing_estimate:
339
339
  pnpm wu:brief --id WU-XXX --client claude-code --strict-sizing
340
340
  ```
341
341
 
342
- See the [WU Sizing Guide](./wu-sizing-guide.md) section 1.4 for the full contract specification.
342
+ See the [WU Sizing Guide](../../wu-sizing-guide.md) section 1.5 for the full contract specification.
343
343
 
344
344
  ---
345
345
 
@@ -835,4 +835,4 @@ For a complete picture of how all WU commands, memory tools, and orchestration t
835
835
  - **[Failure-Mode Runbook](../../lumenflow-agent-capsule.md)** -- Concrete remediation for main-behind-origin, partial-claim state, spawn-provenance enforcement, and wu:recover usage
836
836
  - **[Troubleshooting wu:done](./troubleshooting-wu-done.md)** -- Most common agent mistake (two-step wu:prep + wu:done workflow)
837
837
  - **[First WU Mistakes](./first-wu-mistakes.md)** -- Common first-time pitfalls and how to avoid them
838
- - **[WU Sizing Guide](./wu-sizing-guide.md)** -- Context safety triggers, complexity assessment, and session strategies
838
+ - **[WU Sizing Guide](../../wu-sizing-guide.md)** -- Context safety triggers, complexity assessment, and session strategies
@@ -733,5 +733,5 @@ rm -rf /tmp/nextjs-scaffold
733
733
  - [troubleshooting-wu-done.md](troubleshooting-wu-done.md) - Why agents forget wu:done
734
734
  - [first-wu-mistakes.md](first-wu-mistakes.md) - Common mistakes to avoid
735
735
  - [quick-ref-commands.md](quick-ref-commands.md) - Command reference
736
- - [wu-sizing-guide.md](wu-sizing-guide.md) - Context safety and WU sizing
736
+ - [wu-sizing-guide.md](../../wu-sizing-guide.md) - Context safety and WU sizing
737
737
  - [initiative-orchestration.md](initiative-orchestration.md) - Initiative orchestration, delegation, recovery
@@ -2,7 +2,7 @@
2
2
  name: frontend-design
3
3
  description: Create distinctive, production-grade frontend interfaces. Use when building React components, pages, UI features, or when user requests visual/design work.
4
4
  version: 1.0.0
5
- source: docs/04-operations/_frameworks/lumenflow/lumenflow-agent-capsule.md
5
+ source: docs/operations/_frameworks/lumenflow/lumenflow-agent-capsule.md
6
6
  last_updated: {{DATE}}
7
7
  allowed-tools: Read, Write, Edit, Bash
8
8
  ---
@@ -1,84 +0,0 @@
1
- # Work Unit Sizing Guide
2
-
3
- **Last updated:** {{DATE}}
4
-
5
- Use this summary to decide whether work should stay as one WU and what execution strategy it needs.
6
-
7
- ---
8
-
9
- ## Default Bias
10
-
11
- Bias toward **one coherent outcome = one WU**.
12
-
13
- Do not split a WU just because it has multiple implementation steps, tests, or docs, or because it may need another session. Split only when the work is no longer one coherent deliverable.
14
-
15
- Before splitting, ask: **Can these parts ship, review, and roll back independently?** If no, keep one WU and choose a better execution strategy.
16
-
17
- Keep one WU when:
18
-
19
- - The acceptance criteria describe one user-visible or operator-visible outcome
20
- - One agent can still complete it with `single-session`, `checkpoint-resume`, or `orchestrator-worker`
21
- - The touched files support the same change, even if there are several of them
22
- - Code, tests, and docs all support the same change
23
-
24
- Split when:
25
-
26
- - Parts can ship or be reviewed independently
27
- - Different lanes or owners should deliver different parts
28
- - Risk isolation matters, such as tracer-bullet, feature-flag, or adapter-first rollout
29
- - The work keeps widening and no longer has a clean stopping point
30
-
31
- Anti-patterns that should usually stay one WU:
32
-
33
- - One API endpoint split into backend, tests, and docs WUs
34
- - One shippable feature split into backend and frontend WUs even though neither stands alone
35
- - One refactor split into "step 1", "step 2", and "cleanup" WUs with no independent ship point
36
-
37
- ---
38
-
39
- ## Baseline Heuristics
40
-
41
- | Complexity | Files | Tool Calls | Suggested Strategy |
42
- | ---------- | ----- | ---------- | ------------------------------------------------------- |
43
- | Simple | <20 | <50 | Single session |
44
- | Medium | 20-50 | 50-100 | Checkpoint and resume |
45
- | Complex | 50+ | 100+ | Orchestrate or checkpoint first; split only if the WU is non-atomic |
46
- | Oversized | 100+ | 200+ | Re-check cohesion; split only if no exception applies and the work cannot land coherently |
47
-
48
- These are guardrails for session strategy, not a license to multiply WUs that still belong together.
49
-
50
- ---
51
-
52
- ## Context Safety Triggers
53
-
54
- Checkpoint and hand off when any of these happen:
55
-
56
- - Context usage approaches 50% and is still climbing
57
- - Tool calls exceed roughly 50 in one session
58
- - File churn keeps widening without clear closure
59
- - You have to repeatedly rediscover the same repo rules
60
-
61
- If a trigger fires, first ask whether the WU is still atomic. If yes, checkpoint or hand off. If no, split it.
62
-
63
- ---
64
-
65
- ## Recovery Pattern
66
-
67
- ```bash
68
- pnpm mem:checkpoint "state before handoff" --wu WU-XXX
69
- pnpm wu:brief --id WU-XXX --client codex-cli
70
- ```
71
-
72
- Use handoff when the WU is still coherent but the session is getting tired. Split only when the work itself is no longer coherent.
73
-
74
- ---
75
-
76
- ## Docs-Only Exception
77
-
78
- Documentation WUs can tolerate broader file counts when the change pattern is shallow and mechanical, but they still need to stay understandable in one session.
79
-
80
- If the docs work starts spilling into CLI, core, or packaging changes, treat it like a normal cross-code WU again.
81
-
82
- ## Shallow Multi-File Exception
83
-
84
- Code WUs may also stay as one WU when the change is mechanical across many files, such as a rename or import rewrite, and each file change stays shallow and uniform.