@lumenflow/cli 3.17.7 → 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.
- package/dist/init-detection.js +5 -3
- package/dist/init-detection.js.map +1 -1
- package/dist/init-templates.js +4 -4
- package/dist/init-templates.js.map +1 -1
- package/dist/initiative-plan.js +1 -1
- package/dist/initiative-plan.js.map +1 -1
- package/dist/pre-commit-check.js +1 -1
- package/dist/pre-commit-check.js.map +1 -1
- package/dist/wu-edit-operations.js +4 -0
- package/dist/wu-edit-operations.js.map +1 -1
- package/dist/wu-edit-validators.js +4 -0
- package/dist/wu-edit-validators.js.map +1 -1
- package/dist/wu-edit.js +11 -0
- package/dist/wu-edit.js.map +1 -1
- package/dist/wu-spawn-strategy-resolver.js +13 -1
- package/dist/wu-spawn-strategy-resolver.js.map +1 -1
- package/package.json +8 -8
- package/packs/agent-runtime/.turbo/turbo-build.log +4 -0
- package/packs/agent-runtime/README.md +147 -0
- package/packs/agent-runtime/capability-factory.ts +104 -0
- package/packs/agent-runtime/config.schema.json +87 -0
- package/packs/agent-runtime/constants.ts +21 -0
- package/packs/agent-runtime/index.ts +11 -0
- package/packs/agent-runtime/manifest.ts +207 -0
- package/packs/agent-runtime/manifest.yaml +193 -0
- package/packs/agent-runtime/orchestration.ts +1787 -0
- package/packs/agent-runtime/pack-registration.ts +110 -0
- package/packs/agent-runtime/package.json +57 -0
- package/packs/agent-runtime/policy-factory.ts +165 -0
- package/packs/agent-runtime/tool-impl/agent-turn-tools.ts +793 -0
- package/packs/agent-runtime/tool-impl/index.ts +5 -0
- package/packs/agent-runtime/tool-impl/provider-adapters.ts +1245 -0
- package/packs/agent-runtime/tools/index.ts +4 -0
- package/packs/agent-runtime/tools/types.ts +47 -0
- package/packs/agent-runtime/tsconfig.json +20 -0
- package/packs/agent-runtime/types.ts +128 -0
- package/packs/agent-runtime/vitest.config.ts +11 -0
- package/packs/sidekick/.turbo/turbo-build.log +1 -1
- package/packs/sidekick/package.json +1 -1
- package/packs/software-delivery/.turbo/turbo-build.log +1 -1
- package/packs/software-delivery/package.json +1 -1
- package/templates/core/.lumenflow/rules/wu-workflow.md.template +1 -1
- package/templates/core/ai/onboarding/first-wu-mistakes.md.template +2 -2
- package/templates/core/ai/onboarding/quick-ref-commands.md.template +1 -1
- package/templates/core/ai/onboarding/starting-prompt.md.template +1 -1
- package/templates/vendors/claude/.claude/skills/frontend-design/SKILL.md.template +1 -1
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
// Copyright (c) 2026 Hellmai Ltd
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
DomainPackManifestSchema,
|
|
6
|
+
POLICY_TRIGGERS,
|
|
7
|
+
type DomainPackManifest,
|
|
8
|
+
} from '@lumenflow/kernel';
|
|
9
|
+
import {
|
|
10
|
+
AGENT_RUNTIME_API_KEY_ENV,
|
|
11
|
+
AGENT_RUNTIME_BASE_URL_ENV,
|
|
12
|
+
AGENT_RUNTIME_CONFIG_KEY,
|
|
13
|
+
AGENT_RUNTIME_CONFIG_SCHEMA_FILE,
|
|
14
|
+
AGENT_RUNTIME_PACK_ID,
|
|
15
|
+
AGENT_RUNTIME_PACK_VERSION,
|
|
16
|
+
AGENT_RUNTIME_POLICY_ID_PREFIX,
|
|
17
|
+
AGENT_RUNTIME_STATIC_PROVIDER_ALLOWLIST,
|
|
18
|
+
AGENT_RUNTIME_STATIC_PROVIDER_URLS,
|
|
19
|
+
AGENT_RUNTIME_STORAGE_PATTERN,
|
|
20
|
+
} from './constants.js';
|
|
21
|
+
import {
|
|
22
|
+
AGENT_RUNTIME_PROVIDER_KINDS,
|
|
23
|
+
AGENT_RUNTIME_TOOL_NAMES,
|
|
24
|
+
AGENT_RUNTIME_TURN_STATUSES,
|
|
25
|
+
type AgentRuntimeToolName,
|
|
26
|
+
} from './types.js';
|
|
27
|
+
|
|
28
|
+
const EXECUTE_TURN_TOOL_ENTRY = 'tool-impl/agent-turn-tools.ts#agentExecuteTurnTool';
|
|
29
|
+
const CAPABILITY_FACTORY_ENTRY = 'capability-factory.ts#createAgentRuntimeCapabilityFactory';
|
|
30
|
+
const POLICY_FACTORY_ENTRY = 'policy-factory.ts#createAgentRuntimePolicyFactory';
|
|
31
|
+
|
|
32
|
+
const EXECUTE_TURN_INPUT_SCHEMA: Record<string, unknown> = {
|
|
33
|
+
type: 'object',
|
|
34
|
+
properties: {
|
|
35
|
+
session_id: { type: 'string', minLength: 1 },
|
|
36
|
+
model_profile: { type: 'string', minLength: 1 },
|
|
37
|
+
url: {
|
|
38
|
+
type: 'string',
|
|
39
|
+
enum: [...AGENT_RUNTIME_STATIC_PROVIDER_URLS],
|
|
40
|
+
},
|
|
41
|
+
stream: {
|
|
42
|
+
type: 'boolean',
|
|
43
|
+
},
|
|
44
|
+
messages: {
|
|
45
|
+
type: 'array',
|
|
46
|
+
minItems: 1,
|
|
47
|
+
items: {
|
|
48
|
+
type: 'object',
|
|
49
|
+
properties: {
|
|
50
|
+
role: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
enum: ['system', 'user', 'assistant', 'tool'],
|
|
53
|
+
},
|
|
54
|
+
content: { type: 'string' },
|
|
55
|
+
tool_name: { type: 'string' },
|
|
56
|
+
tool_call_id: { type: 'string' },
|
|
57
|
+
},
|
|
58
|
+
required: ['role', 'content'],
|
|
59
|
+
additionalProperties: false,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
tool_catalog: {
|
|
63
|
+
type: 'array',
|
|
64
|
+
items: {
|
|
65
|
+
type: 'object',
|
|
66
|
+
properties: {
|
|
67
|
+
name: { type: 'string', minLength: 1 },
|
|
68
|
+
description: { type: 'string', minLength: 1 },
|
|
69
|
+
input_schema: {
|
|
70
|
+
type: 'object',
|
|
71
|
+
additionalProperties: true,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
required: ['name', 'description'],
|
|
75
|
+
additionalProperties: false,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
intent_catalog: {
|
|
79
|
+
type: 'array',
|
|
80
|
+
items: {
|
|
81
|
+
type: 'object',
|
|
82
|
+
properties: {
|
|
83
|
+
id: { type: 'string', minLength: 1 },
|
|
84
|
+
description: { type: 'string', minLength: 1 },
|
|
85
|
+
},
|
|
86
|
+
required: ['id', 'description'],
|
|
87
|
+
additionalProperties: false,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
limits: {
|
|
91
|
+
type: 'object',
|
|
92
|
+
properties: {
|
|
93
|
+
max_turns_per_session: { type: 'integer', minimum: 1 },
|
|
94
|
+
max_tool_calls_per_session: { type: 'integer', minimum: 1 },
|
|
95
|
+
max_input_bytes: { type: 'integer', minimum: 1 },
|
|
96
|
+
},
|
|
97
|
+
additionalProperties: false,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
required: ['session_id', 'model_profile', 'url', 'messages'],
|
|
101
|
+
additionalProperties: false,
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const EXECUTE_TURN_OUTPUT_SCHEMA: Record<string, unknown> = {
|
|
105
|
+
type: 'object',
|
|
106
|
+
properties: {
|
|
107
|
+
status: {
|
|
108
|
+
type: 'string',
|
|
109
|
+
enum: Object.values(AGENT_RUNTIME_TURN_STATUSES),
|
|
110
|
+
},
|
|
111
|
+
intent: { type: 'string', minLength: 1 },
|
|
112
|
+
assistant_message: { type: 'string' },
|
|
113
|
+
requested_tool: {
|
|
114
|
+
type: 'object',
|
|
115
|
+
properties: {
|
|
116
|
+
name: { type: 'string', minLength: 1 },
|
|
117
|
+
input: {
|
|
118
|
+
type: 'object',
|
|
119
|
+
additionalProperties: true,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
required: ['name', 'input'],
|
|
123
|
+
additionalProperties: false,
|
|
124
|
+
},
|
|
125
|
+
provider: {
|
|
126
|
+
type: 'object',
|
|
127
|
+
properties: {
|
|
128
|
+
kind: {
|
|
129
|
+
type: 'string',
|
|
130
|
+
enum: Object.values(AGENT_RUNTIME_PROVIDER_KINDS),
|
|
131
|
+
},
|
|
132
|
+
model: { type: 'string', minLength: 1 },
|
|
133
|
+
},
|
|
134
|
+
required: ['kind', 'model'],
|
|
135
|
+
additionalProperties: false,
|
|
136
|
+
},
|
|
137
|
+
usage: {
|
|
138
|
+
type: 'object',
|
|
139
|
+
properties: {
|
|
140
|
+
input_tokens: { type: 'integer', minimum: 0 },
|
|
141
|
+
output_tokens: { type: 'integer', minimum: 0 },
|
|
142
|
+
total_tokens: { type: 'integer', minimum: 0 },
|
|
143
|
+
},
|
|
144
|
+
additionalProperties: false,
|
|
145
|
+
},
|
|
146
|
+
finish_reason: { type: 'string', minLength: 1 },
|
|
147
|
+
},
|
|
148
|
+
required: ['status', 'intent', 'assistant_message', 'provider', 'finish_reason'],
|
|
149
|
+
additionalProperties: false,
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
const MANIFEST_TOOL_DEFINITIONS = [
|
|
153
|
+
{
|
|
154
|
+
name: AGENT_RUNTIME_TOOL_NAMES.EXECUTE_TURN,
|
|
155
|
+
entry: EXECUTE_TURN_TOOL_ENTRY,
|
|
156
|
+
permission: 'write',
|
|
157
|
+
required_scopes: [
|
|
158
|
+
{ type: 'path', pattern: AGENT_RUNTIME_STORAGE_PATTERN, access: 'read' },
|
|
159
|
+
{ type: 'path', pattern: AGENT_RUNTIME_STORAGE_PATTERN, access: 'write' },
|
|
160
|
+
{
|
|
161
|
+
type: 'network',
|
|
162
|
+
posture: 'allowlist',
|
|
163
|
+
allowlist_entries: [...AGENT_RUNTIME_STATIC_PROVIDER_ALLOWLIST],
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
required_env: [AGENT_RUNTIME_API_KEY_ENV, AGENT_RUNTIME_BASE_URL_ENV],
|
|
167
|
+
input_schema: EXECUTE_TURN_INPUT_SCHEMA,
|
|
168
|
+
output_schema: EXECUTE_TURN_OUTPUT_SCHEMA,
|
|
169
|
+
},
|
|
170
|
+
] as const;
|
|
171
|
+
|
|
172
|
+
export const AGENT_RUNTIME_MANIFEST = DomainPackManifestSchema.parse({
|
|
173
|
+
id: AGENT_RUNTIME_PACK_ID,
|
|
174
|
+
version: AGENT_RUNTIME_PACK_VERSION,
|
|
175
|
+
config_key: AGENT_RUNTIME_CONFIG_KEY,
|
|
176
|
+
config_schema: AGENT_RUNTIME_CONFIG_SCHEMA_FILE,
|
|
177
|
+
capability_factory: CAPABILITY_FACTORY_ENTRY,
|
|
178
|
+
policy_factory: POLICY_FACTORY_ENTRY,
|
|
179
|
+
task_types: ['agent-session'],
|
|
180
|
+
tools: MANIFEST_TOOL_DEFINITIONS,
|
|
181
|
+
policies: [
|
|
182
|
+
{
|
|
183
|
+
id: `${AGENT_RUNTIME_POLICY_ID_PREFIX}.default`,
|
|
184
|
+
trigger: POLICY_TRIGGERS.ON_TOOL_REQUEST,
|
|
185
|
+
decision: 'allow',
|
|
186
|
+
reason: 'Pack baseline allow; dynamic intent gating is applied by the pack policy factory.',
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
evidence_types: ['agent-runtime.turn', 'agent-runtime.provider-call'],
|
|
190
|
+
state_aliases: {
|
|
191
|
+
paused: 'waiting',
|
|
192
|
+
},
|
|
193
|
+
lane_templates: [],
|
|
194
|
+
}) satisfies DomainPackManifest;
|
|
195
|
+
|
|
196
|
+
export type AgentRuntimePackManifest = typeof AGENT_RUNTIME_MANIFEST;
|
|
197
|
+
export type AgentRuntimeManifestTool = AgentRuntimePackManifest['tools'][number];
|
|
198
|
+
|
|
199
|
+
export const AGENT_RUNTIME_MANIFEST_TOOL_NAMES = AGENT_RUNTIME_MANIFEST.tools.map(
|
|
200
|
+
(tool) => tool.name,
|
|
201
|
+
) as readonly AgentRuntimeToolName[];
|
|
202
|
+
|
|
203
|
+
export function getAgentRuntimeManifestToolByName(
|
|
204
|
+
name: string,
|
|
205
|
+
): AgentRuntimeManifestTool | undefined {
|
|
206
|
+
return AGENT_RUNTIME_MANIFEST.tools.find((tool) => tool.name === name);
|
|
207
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
id: agent-runtime
|
|
2
|
+
version: 0.1.0
|
|
3
|
+
config_key: agent_runtime
|
|
4
|
+
config_schema: config.schema.json
|
|
5
|
+
capability_factory: capability-factory.ts#createAgentRuntimeCapabilityFactory
|
|
6
|
+
policy_factory: policy-factory.ts#createAgentRuntimePolicyFactory
|
|
7
|
+
task_types:
|
|
8
|
+
- agent-session
|
|
9
|
+
tools:
|
|
10
|
+
- name: agent:execute-turn
|
|
11
|
+
entry: tool-impl/agent-turn-tools.ts#agentExecuteTurnTool
|
|
12
|
+
permission: write
|
|
13
|
+
required_scopes:
|
|
14
|
+
- type: path
|
|
15
|
+
pattern: .agent-runtime/**
|
|
16
|
+
access: read
|
|
17
|
+
- type: path
|
|
18
|
+
pattern: .agent-runtime/**
|
|
19
|
+
access: write
|
|
20
|
+
- type: network
|
|
21
|
+
posture: allowlist
|
|
22
|
+
allowlist_entries:
|
|
23
|
+
- model-provider.invalid:443
|
|
24
|
+
required_env:
|
|
25
|
+
- AGENT_RUNTIME_API_KEY
|
|
26
|
+
- AGENT_RUNTIME_BASE_URL
|
|
27
|
+
input_schema:
|
|
28
|
+
type: object
|
|
29
|
+
properties:
|
|
30
|
+
session_id:
|
|
31
|
+
type: string
|
|
32
|
+
minLength: 1
|
|
33
|
+
model_profile:
|
|
34
|
+
type: string
|
|
35
|
+
minLength: 1
|
|
36
|
+
url:
|
|
37
|
+
type: string
|
|
38
|
+
enum:
|
|
39
|
+
- https://model-provider.invalid/
|
|
40
|
+
stream:
|
|
41
|
+
type: boolean
|
|
42
|
+
messages:
|
|
43
|
+
type: array
|
|
44
|
+
minItems: 1
|
|
45
|
+
items:
|
|
46
|
+
type: object
|
|
47
|
+
properties:
|
|
48
|
+
role:
|
|
49
|
+
type: string
|
|
50
|
+
enum:
|
|
51
|
+
- system
|
|
52
|
+
- user
|
|
53
|
+
- assistant
|
|
54
|
+
- tool
|
|
55
|
+
content:
|
|
56
|
+
type: string
|
|
57
|
+
tool_name:
|
|
58
|
+
type: string
|
|
59
|
+
tool_call_id:
|
|
60
|
+
type: string
|
|
61
|
+
required:
|
|
62
|
+
- role
|
|
63
|
+
- content
|
|
64
|
+
additionalProperties: false
|
|
65
|
+
tool_catalog:
|
|
66
|
+
type: array
|
|
67
|
+
items:
|
|
68
|
+
type: object
|
|
69
|
+
properties:
|
|
70
|
+
name:
|
|
71
|
+
type: string
|
|
72
|
+
minLength: 1
|
|
73
|
+
description:
|
|
74
|
+
type: string
|
|
75
|
+
minLength: 1
|
|
76
|
+
input_schema:
|
|
77
|
+
type: object
|
|
78
|
+
additionalProperties: true
|
|
79
|
+
required:
|
|
80
|
+
- name
|
|
81
|
+
- description
|
|
82
|
+
additionalProperties: false
|
|
83
|
+
intent_catalog:
|
|
84
|
+
type: array
|
|
85
|
+
items:
|
|
86
|
+
type: object
|
|
87
|
+
properties:
|
|
88
|
+
id:
|
|
89
|
+
type: string
|
|
90
|
+
minLength: 1
|
|
91
|
+
description:
|
|
92
|
+
type: string
|
|
93
|
+
minLength: 1
|
|
94
|
+
required:
|
|
95
|
+
- id
|
|
96
|
+
- description
|
|
97
|
+
additionalProperties: false
|
|
98
|
+
limits:
|
|
99
|
+
type: object
|
|
100
|
+
properties:
|
|
101
|
+
max_turns_per_session:
|
|
102
|
+
type: integer
|
|
103
|
+
minimum: 1
|
|
104
|
+
max_tool_calls_per_session:
|
|
105
|
+
type: integer
|
|
106
|
+
minimum: 1
|
|
107
|
+
max_input_bytes:
|
|
108
|
+
type: integer
|
|
109
|
+
minimum: 1
|
|
110
|
+
additionalProperties: false
|
|
111
|
+
required:
|
|
112
|
+
- session_id
|
|
113
|
+
- model_profile
|
|
114
|
+
- url
|
|
115
|
+
- messages
|
|
116
|
+
additionalProperties: false
|
|
117
|
+
output_schema:
|
|
118
|
+
type: object
|
|
119
|
+
properties:
|
|
120
|
+
status:
|
|
121
|
+
type: string
|
|
122
|
+
enum:
|
|
123
|
+
- reply
|
|
124
|
+
- tool_request
|
|
125
|
+
- complete
|
|
126
|
+
- escalate
|
|
127
|
+
intent:
|
|
128
|
+
type: string
|
|
129
|
+
minLength: 1
|
|
130
|
+
assistant_message:
|
|
131
|
+
type: string
|
|
132
|
+
requested_tool:
|
|
133
|
+
type: object
|
|
134
|
+
properties:
|
|
135
|
+
name:
|
|
136
|
+
type: string
|
|
137
|
+
minLength: 1
|
|
138
|
+
input:
|
|
139
|
+
type: object
|
|
140
|
+
additionalProperties: true
|
|
141
|
+
required:
|
|
142
|
+
- name
|
|
143
|
+
- input
|
|
144
|
+
additionalProperties: false
|
|
145
|
+
provider:
|
|
146
|
+
type: object
|
|
147
|
+
properties:
|
|
148
|
+
kind:
|
|
149
|
+
type: string
|
|
150
|
+
enum:
|
|
151
|
+
- openai_compatible
|
|
152
|
+
- messages_compatible
|
|
153
|
+
model:
|
|
154
|
+
type: string
|
|
155
|
+
minLength: 1
|
|
156
|
+
required:
|
|
157
|
+
- kind
|
|
158
|
+
- model
|
|
159
|
+
additionalProperties: false
|
|
160
|
+
usage:
|
|
161
|
+
type: object
|
|
162
|
+
properties:
|
|
163
|
+
input_tokens:
|
|
164
|
+
type: integer
|
|
165
|
+
minimum: 0
|
|
166
|
+
output_tokens:
|
|
167
|
+
type: integer
|
|
168
|
+
minimum: 0
|
|
169
|
+
total_tokens:
|
|
170
|
+
type: integer
|
|
171
|
+
minimum: 0
|
|
172
|
+
additionalProperties: false
|
|
173
|
+
finish_reason:
|
|
174
|
+
type: string
|
|
175
|
+
minLength: 1
|
|
176
|
+
required:
|
|
177
|
+
- status
|
|
178
|
+
- intent
|
|
179
|
+
- assistant_message
|
|
180
|
+
- provider
|
|
181
|
+
- finish_reason
|
|
182
|
+
additionalProperties: false
|
|
183
|
+
policies:
|
|
184
|
+
- id: agent-runtime.policy.default
|
|
185
|
+
trigger: on_tool_request
|
|
186
|
+
decision: allow
|
|
187
|
+
reason: Pack baseline allow; dynamic intent gating is applied by the pack policy factory.
|
|
188
|
+
evidence_types:
|
|
189
|
+
- agent-runtime.turn
|
|
190
|
+
- agent-runtime.provider-call
|
|
191
|
+
state_aliases:
|
|
192
|
+
paused: waiting
|
|
193
|
+
lane_templates: []
|