@lumenflow/cli 5.4.0 → 5.7.12
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 +42 -40
- package/dist/db-journal-recover.js +400 -0
- package/dist/db-journal-recover.js.map +1 -0
- package/dist/docs-sync.js +8 -3
- package/dist/docs-sync.js.map +1 -1
- package/dist/gate-defaults.js +191 -9
- package/dist/gate-defaults.js.map +1 -1
- package/dist/gate-registry.js.map +1 -1
- package/dist/gates/monolithic-file-contention-guard.js +167 -0
- package/dist/gates/monolithic-file-contention-guard.js.map +1 -0
- package/dist/gates/prod-migration-drift.js +207 -0
- package/dist/gates/prod-migration-drift.js.map +1 -0
- package/dist/gates/test-over-deletion-guard.js +255 -0
- package/dist/gates/test-over-deletion-guard.js.map +1 -0
- package/dist/gates-runners.js +401 -2
- package/dist/gates-runners.js.map +1 -1
- package/dist/gates.js +349 -4
- package/dist/gates.js.map +1 -1
- package/dist/lumenflow-setup.js +144 -0
- package/dist/lumenflow-setup.js.map +1 -0
- package/dist/lumenflow-upgrade.js +2 -1
- package/dist/lumenflow-upgrade.js.map +1 -1
- package/dist/mem-create.js +10 -1
- package/dist/mem-create.js.map +1 -1
- package/dist/mem-signal.js +21 -4
- package/dist/mem-signal.js.map +1 -1
- package/dist/metrics-cli.js +19 -2
- package/dist/metrics-cli.js.map +1 -1
- package/dist/metrics-snapshot.js +25 -2
- package/dist/metrics-snapshot.js.map +1 -1
- package/dist/orchestrate-initiative.js +28 -3
- package/dist/orchestrate-initiative.js.map +1 -1
- package/dist/public-manifest.js +17 -0
- package/dist/public-manifest.js.map +1 -1
- package/dist/release.js +53 -18
- package/dist/release.js.map +1 -1
- package/dist/wu-done-gates.js +121 -8
- package/dist/wu-done-gates.js.map +1 -1
- package/dist/wu-done.js +30 -6
- package/dist/wu-done.js.map +1 -1
- package/dist/wu-edit-operations.js +74 -0
- package/dist/wu-edit-operations.js.map +1 -1
- package/dist/wu-edit-validators.js +58 -0
- package/dist/wu-edit-validators.js.map +1 -1
- package/dist/wu-edit.js +106 -4
- package/dist/wu-edit.js.map +1 -1
- package/dist/wu-prep.js +132 -8
- package/dist/wu-prep.js.map +1 -1
- package/dist/wu-recover.js +6 -0
- package/dist/wu-recover.js.map +1 -1
- package/dist/wu-release.js +120 -2
- package/dist/wu-release.js.map +1 -1
- package/dist/wu-sizing-validation.js +47 -17
- package/dist/wu-sizing-validation.js.map +1 -1
- package/dist/wu-status.js +33 -0
- package/dist/wu-status.js.map +1 -1
- package/package.json +13 -11
- package/packs/agent-runtime/package.json +1 -1
- package/packs/sidekick/package.json +1 -1
- package/packs/software-delivery/package.json +1 -1
- package/templates/core/AGENTS.md.template +162 -26
- package/templates/core/LUMENFLOW.md.template +381 -70
- package/templates/core/ai/onboarding/agent-invocation-guide.md.template +0 -5
- package/templates/core/ai/onboarding/agent-safety-card.md.template +63 -17
- package/templates/core/ai/onboarding/initiative-orchestration.md.template +4 -0
- package/templates/core/ai/onboarding/release-process.md.template +7 -7
- package/templates/core/ai/onboarding/vendor-support.md.template +74 -10
- package/templates/vendors/claude/.claude/skills/frontend-design/SKILL.md.template +1 -1
- package/templates/vendors/claude/.claude/skills/wu-lifecycle/SKILL.md.template +28 -0
- package/packs/agent-runtime/agent-heartbeat.ts +0 -163
- package/packs/agent-runtime/auto-session-integration.ts +0 -888
- package/packs/agent-runtime/capability-factory.ts +0 -104
- package/packs/agent-runtime/constants.ts +0 -21
- package/packs/agent-runtime/delegation-registry-schema.ts +0 -220
- package/packs/agent-runtime/delegation-registry-store.ts +0 -269
- package/packs/agent-runtime/delegation-tree.ts +0 -328
- package/packs/agent-runtime/index.ts +0 -20
- package/packs/agent-runtime/manifest.ts +0 -348
- package/packs/agent-runtime/memory-coordination-contract.ts +0 -86
- package/packs/agent-runtime/orchestration.ts +0 -2027
- package/packs/agent-runtime/pack-registration.ts +0 -110
- package/packs/agent-runtime/policy-factory.ts +0 -165
- package/packs/agent-runtime/remote-controls/index.ts +0 -7
- package/packs/agent-runtime/remote-controls/operations.ts +0 -405
- package/packs/agent-runtime/remote-controls/port.ts +0 -48
- package/packs/agent-runtime/remote-controls/state-store.ts +0 -258
- package/packs/agent-runtime/remote-controls/types.ts +0 -105
- package/packs/agent-runtime/session-schema.ts +0 -467
- package/packs/agent-runtime/tool-impl/agent-turn-tools.ts +0 -793
- package/packs/agent-runtime/tool-impl/index.ts +0 -6
- package/packs/agent-runtime/tool-impl/provider-adapters.ts +0 -1245
- package/packs/agent-runtime/tool-impl/remote-controls.mock.ts +0 -256
- package/packs/agent-runtime/tool-impl/remote-controls.ts +0 -273
- package/packs/agent-runtime/tools/index.ts +0 -4
- package/packs/agent-runtime/tools/types.ts +0 -47
- package/packs/agent-runtime/turn-lifecycle-events.ts +0 -590
- package/packs/agent-runtime/types.ts +0 -128
- package/packs/agent-runtime/vitest.config.ts +0 -11
- package/packs/sidekick/channel-ingress.ts +0 -137
- package/packs/sidekick/constants.ts +0 -10
- package/packs/sidekick/index.ts +0 -8
- package/packs/sidekick/manifest-schema.ts +0 -49
- package/packs/sidekick/manifest.ts +0 -512
- package/packs/sidekick/pack-registration.ts +0 -110
- package/packs/sidekick/policy-factory.ts +0 -38
- package/packs/sidekick/sidekick-events.ts +0 -694
- package/packs/sidekick/src/adapters/cloud-queue.ts +0 -101
- package/packs/sidekick/src/adapters/control-plane-bridge.adapter.ts +0 -386
- package/packs/sidekick/src/adapters/filesystem-bridge.adapter.ts +0 -228
- package/packs/sidekick/src/domain/channel.types.ts +0 -64
- package/packs/sidekick/src/ports/channel-bridge.port.ts +0 -92
- package/packs/sidekick/src/routines/commit.ts +0 -74
- package/packs/sidekick/tool-impl/channel-tools.ts +0 -577
- package/packs/sidekick/tool-impl/channel-transports.ts +0 -75
- package/packs/sidekick/tool-impl/index.ts +0 -29
- package/packs/sidekick/tool-impl/memory-tools.ts +0 -290
- package/packs/sidekick/tool-impl/routine-commit.ts +0 -102
- package/packs/sidekick/tool-impl/routine-tools.ts +0 -440
- package/packs/sidekick/tool-impl/runtime-context.ts +0 -28
- package/packs/sidekick/tool-impl/shared.ts +0 -125
- package/packs/sidekick/tool-impl/storage.ts +0 -325
- package/packs/sidekick/tool-impl/system-tools.ts +0 -160
- package/packs/sidekick/tool-impl/task-tools.ts +0 -506
- package/packs/sidekick/tools/channel-tools.ts +0 -53
- package/packs/sidekick/tools/index.ts +0 -9
- package/packs/sidekick/tools/memory-tools.ts +0 -53
- package/packs/sidekick/tools/routine-tools.ts +0 -53
- package/packs/sidekick/tools/system-tools.ts +0 -47
- package/packs/sidekick/tools/task-tools.ts +0 -61
- package/packs/sidekick/tools/types.ts +0 -57
- package/packs/sidekick/vitest.config.ts +0 -11
- package/packs/software-delivery/constants.ts +0 -10
- package/packs/software-delivery/extensions.ts +0 -140
- package/packs/software-delivery/gate-policies.ts +0 -134
- package/packs/software-delivery/index.ts +0 -8
- package/packs/software-delivery/manifest-schema.ts +0 -268
- package/packs/software-delivery/manifest.ts +0 -657
- package/packs/software-delivery/pack-registration.ts +0 -113
- package/packs/software-delivery/src/commands/index.ts +0 -5
- package/packs/software-delivery/src/config/delivery-review-contract.ts +0 -256
- package/packs/software-delivery/src/config/env-accessors.ts +0 -66
- package/packs/software-delivery/src/config/index.ts +0 -8
- package/packs/software-delivery/src/config/normalize-config-keys.ts +0 -9
- package/packs/software-delivery/src/config/schemas/lumenflow-config-schema-types.ts +0 -460
- package/packs/software-delivery/src/config/workspace-reader.ts +0 -375
- package/packs/software-delivery/src/constants/backlog-patterns.ts +0 -31
- package/packs/software-delivery/src/constants/client-ids.ts +0 -19
- package/packs/software-delivery/src/constants/config-contract.ts +0 -7
- package/packs/software-delivery/src/constants/docs-layout-presets.ts +0 -50
- package/packs/software-delivery/src/constants/duration-constants.ts +0 -20
- package/packs/software-delivery/src/constants/gate-constants.ts +0 -32
- package/packs/software-delivery/src/constants/index.ts +0 -29
- package/packs/software-delivery/src/constants/lock-constants.ts +0 -35
- package/packs/software-delivery/src/constants/object-guards.ts +0 -12
- package/packs/software-delivery/src/constants/section-headings.ts +0 -107
- package/packs/software-delivery/src/constants/wu-cli-constants.ts +0 -488
- package/packs/software-delivery/src/constants/wu-domain-constants.ts +0 -466
- package/packs/software-delivery/src/constants/wu-git-constants.ts +0 -7
- package/packs/software-delivery/src/constants/wu-id-format.ts +0 -327
- package/packs/software-delivery/src/constants/wu-paths-constants.ts +0 -384
- package/packs/software-delivery/src/constants/wu-statuses.ts +0 -287
- package/packs/software-delivery/src/constants/wu-type-helpers.ts +0 -67
- package/packs/software-delivery/src/constants/wu-ui-constants.ts +0 -267
- package/packs/software-delivery/src/constants/wu-validation-constants.ts +0 -73
- package/packs/software-delivery/src/domain/index.ts +0 -5
- package/packs/software-delivery/src/domain/orchestration.constants.ts +0 -166
- package/packs/software-delivery/src/domain/orchestration.schemas.ts +0 -238
- package/packs/software-delivery/src/domain/orchestration.types.ts +0 -176
- package/packs/software-delivery/src/methodology/incremental-test.ts +0 -122
- package/packs/software-delivery/src/methodology/index.ts +0 -6
- package/packs/software-delivery/src/methodology/manual-test-validator.ts +0 -292
- package/packs/software-delivery/src/policy/coverage-gate.ts +0 -270
- package/packs/software-delivery/src/policy/gates-agent-mode.ts +0 -223
- package/packs/software-delivery/src/policy/gates-config-internal.ts +0 -121
- package/packs/software-delivery/src/policy/gates-config.ts +0 -300
- package/packs/software-delivery/src/policy/gates-coverage.ts +0 -356
- package/packs/software-delivery/src/policy/gates-presets.ts +0 -134
- package/packs/software-delivery/src/policy/gates-schemas.ts +0 -173
- package/packs/software-delivery/src/policy/index.ts +0 -22
- package/packs/software-delivery/src/policy/package-manager-resolver.ts +0 -319
- package/packs/software-delivery/src/policy/resolve-policy.ts +0 -601
- package/packs/software-delivery/src/ports/config.ports.ts +0 -90
- package/packs/software-delivery/src/ports/dashboard-renderer.port.ts +0 -125
- package/packs/software-delivery/src/ports/index.ts +0 -10
- package/packs/software-delivery/src/ports/sync-validator.ports.ts +0 -59
- package/packs/software-delivery/src/ports/wu-helpers.ports.ts +0 -168
- package/packs/software-delivery/src/ports/wu-state.ports.ts +0 -241
- package/packs/software-delivery/src/primitives/index.ts +0 -5
- package/packs/software-delivery/src/runtime/index.ts +0 -6
- package/packs/software-delivery/src/runtime/work-classifier.ts +0 -561
- package/packs/software-delivery/src/sandbox/index.ts +0 -10
- package/packs/software-delivery/src/sandbox/sandbox-allowlist.ts +0 -118
- package/packs/software-delivery/src/sandbox/sandbox-backend-linux.ts +0 -88
- package/packs/software-delivery/src/sandbox/sandbox-backend-macos.ts +0 -154
- package/packs/software-delivery/src/sandbox/sandbox-backend-windows.ts +0 -47
- package/packs/software-delivery/src/sandbox/sandbox-profile.ts +0 -153
- package/packs/software-delivery/src/schemas/index.ts +0 -5
- package/packs/software-delivery/src/state/date-utils.ts +0 -158
- package/packs/software-delivery/src/state/index.ts +0 -15
- package/packs/software-delivery/src/state/state-machine.ts +0 -119
- package/packs/software-delivery/src/state/wu-doc-types.ts +0 -51
- package/packs/software-delivery/src/state/wu-paths.ts +0 -381
- package/packs/software-delivery/src/state/wu-schema.ts +0 -1139
- package/packs/software-delivery/src/state/wu-state-schema.ts +0 -255
- package/packs/software-delivery/src/state/wu-yaml.ts +0 -338
- package/packs/software-delivery/tool-impl/agent-tools.ts +0 -263
- package/packs/software-delivery/tool-impl/delegation-tools.ts +0 -66
- package/packs/software-delivery/tool-impl/flow-metrics-tools.ts +0 -219
- package/packs/software-delivery/tool-impl/git-runner.ts +0 -113
- package/packs/software-delivery/tool-impl/git-tools.ts +0 -316
- package/packs/software-delivery/tool-impl/index.ts +0 -15
- package/packs/software-delivery/tool-impl/initiative-orchestration-tools.ts +0 -720
- package/packs/software-delivery/tool-impl/lane-lock.ts +0 -246
- package/packs/software-delivery/tool-impl/memory-tools.ts +0 -470
- package/packs/software-delivery/tool-impl/pending-runtime-tools.ts +0 -21
- package/packs/software-delivery/tool-impl/runtime-cli-adapter.ts +0 -329
- package/packs/software-delivery/tool-impl/runtime-native-tools.ts +0 -687
- package/packs/software-delivery/tool-impl/worker-loader.ts +0 -52
- package/packs/software-delivery/tool-impl/worktree-tools.ts +0 -46
- package/packs/software-delivery/tool-impl/wu-lifecycle-tools.ts +0 -807
- package/packs/software-delivery/tools/delegation-tools.ts +0 -23
- package/packs/software-delivery/tools/git-tools.ts +0 -55
- package/packs/software-delivery/tools/index.ts +0 -8
- package/packs/software-delivery/tools/lane-lock-tool.ts +0 -37
- package/packs/software-delivery/tools/types.ts +0 -71
- package/packs/software-delivery/tools/worktree-tools.ts +0 -49
- package/packs/software-delivery/vitest.config.ts +0 -11
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2026 Hellmai Ltd
|
|
2
|
-
// SPDX-License-Identifier: LicenseRef-LumenFlow-Proprietary
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
TOOL_PERMISSIONS,
|
|
6
|
-
TOOL_SCOPE_ACCESS,
|
|
7
|
-
TOOL_SCOPE_TYPES,
|
|
8
|
-
createToolDescriptor,
|
|
9
|
-
} from './types.js';
|
|
10
|
-
|
|
11
|
-
const SIDEKICK_READ_SCOPE = {
|
|
12
|
-
type: TOOL_SCOPE_TYPES.PATH,
|
|
13
|
-
pattern: '.sidekick/**',
|
|
14
|
-
access: TOOL_SCOPE_ACCESS.READ,
|
|
15
|
-
} as const;
|
|
16
|
-
|
|
17
|
-
const SIDEKICK_WRITE_SCOPE = {
|
|
18
|
-
type: TOOL_SCOPE_TYPES.PATH,
|
|
19
|
-
pattern: '.sidekick/**',
|
|
20
|
-
access: TOOL_SCOPE_ACCESS.WRITE,
|
|
21
|
-
} as const;
|
|
22
|
-
|
|
23
|
-
const SYSTEM_TOOLS_ENTRY = 'tool-impl/system-tools.ts';
|
|
24
|
-
|
|
25
|
-
export const sidekickInitDescriptor = createToolDescriptor({
|
|
26
|
-
name: 'sidekick:init',
|
|
27
|
-
permission: TOOL_PERMISSIONS.WRITE,
|
|
28
|
-
required_scopes: [SIDEKICK_READ_SCOPE, SIDEKICK_WRITE_SCOPE],
|
|
29
|
-
entry: SYSTEM_TOOLS_ENTRY,
|
|
30
|
-
description: 'Initialize .sidekick/ directory structure. Idempotent.',
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
export const sidekickStatusDescriptor = createToolDescriptor({
|
|
34
|
-
name: 'sidekick:status',
|
|
35
|
-
permission: TOOL_PERMISSIONS.READ,
|
|
36
|
-
required_scopes: [SIDEKICK_READ_SCOPE],
|
|
37
|
-
entry: SYSTEM_TOOLS_ENTRY,
|
|
38
|
-
description: 'Show sidekick status: store counts, initialized state, version.',
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
export const sidekickExportDescriptor = createToolDescriptor({
|
|
42
|
-
name: 'sidekick:export',
|
|
43
|
-
permission: TOOL_PERMISSIONS.READ,
|
|
44
|
-
required_scopes: [SIDEKICK_READ_SCOPE],
|
|
45
|
-
entry: SYSTEM_TOOLS_ENTRY,
|
|
46
|
-
description: 'Export all sidekick data as a JSON bundle (read-only, no file write).',
|
|
47
|
-
});
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2026 Hellmai Ltd
|
|
2
|
-
// SPDX-License-Identifier: LicenseRef-LumenFlow-Proprietary
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
TOOL_PERMISSIONS,
|
|
6
|
-
TOOL_SCOPE_ACCESS,
|
|
7
|
-
TOOL_SCOPE_TYPES,
|
|
8
|
-
createToolDescriptor,
|
|
9
|
-
} from './types.js';
|
|
10
|
-
|
|
11
|
-
const SIDEKICK_READ_SCOPE = {
|
|
12
|
-
type: TOOL_SCOPE_TYPES.PATH,
|
|
13
|
-
pattern: '.sidekick/tasks/**',
|
|
14
|
-
access: TOOL_SCOPE_ACCESS.READ,
|
|
15
|
-
} as const;
|
|
16
|
-
|
|
17
|
-
const SIDEKICK_WRITE_SCOPE = {
|
|
18
|
-
type: TOOL_SCOPE_TYPES.PATH,
|
|
19
|
-
pattern: '.sidekick/tasks/**',
|
|
20
|
-
access: TOOL_SCOPE_ACCESS.WRITE,
|
|
21
|
-
} as const;
|
|
22
|
-
|
|
23
|
-
const AUDIT_WRITE_SCOPE = {
|
|
24
|
-
type: TOOL_SCOPE_TYPES.PATH,
|
|
25
|
-
pattern: '.sidekick/audit/**',
|
|
26
|
-
access: TOOL_SCOPE_ACCESS.WRITE,
|
|
27
|
-
} as const;
|
|
28
|
-
|
|
29
|
-
const TASK_TOOLS_ENTRY = 'tool-impl/task-tools.ts';
|
|
30
|
-
|
|
31
|
-
export const taskCreateDescriptor = createToolDescriptor({
|
|
32
|
-
name: 'task:create',
|
|
33
|
-
permission: TOOL_PERMISSIONS.WRITE,
|
|
34
|
-
required_scopes: [SIDEKICK_READ_SCOPE, SIDEKICK_WRITE_SCOPE, AUDIT_WRITE_SCOPE],
|
|
35
|
-
entry: TASK_TOOLS_ENTRY,
|
|
36
|
-
description: 'Create a new task with title, priority, due date, and tags.',
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
export const taskListDescriptor = createToolDescriptor({
|
|
40
|
-
name: 'task:list',
|
|
41
|
-
permission: TOOL_PERMISSIONS.READ,
|
|
42
|
-
required_scopes: [SIDEKICK_READ_SCOPE],
|
|
43
|
-
entry: TASK_TOOLS_ENTRY,
|
|
44
|
-
description: 'List tasks with optional filters: status, priority, tag, due_before.',
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
export const taskCompleteDescriptor = createToolDescriptor({
|
|
48
|
-
name: 'task:complete',
|
|
49
|
-
permission: TOOL_PERMISSIONS.WRITE,
|
|
50
|
-
required_scopes: [SIDEKICK_READ_SCOPE, SIDEKICK_WRITE_SCOPE, AUDIT_WRITE_SCOPE],
|
|
51
|
-
entry: TASK_TOOLS_ENTRY,
|
|
52
|
-
description: 'Mark a task as complete. Supports dry_run.',
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
export const taskScheduleDescriptor = createToolDescriptor({
|
|
56
|
-
name: 'task:schedule',
|
|
57
|
-
permission: TOOL_PERMISSIONS.WRITE,
|
|
58
|
-
required_scopes: [SIDEKICK_READ_SCOPE, SIDEKICK_WRITE_SCOPE, AUDIT_WRITE_SCOPE],
|
|
59
|
-
entry: TASK_TOOLS_ENTRY,
|
|
60
|
-
description: 'Set or update a task due date or cron schedule.',
|
|
61
|
-
});
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2026 Hellmai Ltd
|
|
2
|
-
// SPDX-License-Identifier: LicenseRef-LumenFlow-Proprietary
|
|
3
|
-
|
|
4
|
-
import { SIDEKICK_DOMAIN, SIDEKICK_PACK_ID, SIDEKICK_PACK_VERSION } from '../constants.js';
|
|
5
|
-
|
|
6
|
-
export const TOOL_SCOPE_TYPES = {
|
|
7
|
-
PATH: 'path',
|
|
8
|
-
} as const;
|
|
9
|
-
|
|
10
|
-
export const TOOL_SCOPE_ACCESS = {
|
|
11
|
-
READ: 'read',
|
|
12
|
-
WRITE: 'write',
|
|
13
|
-
} as const;
|
|
14
|
-
|
|
15
|
-
export const TOOL_PERMISSIONS = {
|
|
16
|
-
READ: 'read',
|
|
17
|
-
WRITE: 'write',
|
|
18
|
-
ADMIN: 'admin',
|
|
19
|
-
} as const;
|
|
20
|
-
|
|
21
|
-
export type ToolScopeType = (typeof TOOL_SCOPE_TYPES)[keyof typeof TOOL_SCOPE_TYPES];
|
|
22
|
-
export type ToolScopeAccess = (typeof TOOL_SCOPE_ACCESS)[keyof typeof TOOL_SCOPE_ACCESS];
|
|
23
|
-
export type ToolPermission = (typeof TOOL_PERMISSIONS)[keyof typeof TOOL_PERMISSIONS];
|
|
24
|
-
|
|
25
|
-
export interface PathScope {
|
|
26
|
-
type: ToolScopeType;
|
|
27
|
-
pattern: string;
|
|
28
|
-
access: ToolScopeAccess;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface ToolDescriptor {
|
|
32
|
-
name: string;
|
|
33
|
-
domain: typeof SIDEKICK_DOMAIN;
|
|
34
|
-
version: typeof SIDEKICK_PACK_VERSION;
|
|
35
|
-
permission: ToolPermission;
|
|
36
|
-
required_scopes: PathScope[];
|
|
37
|
-
entry: string;
|
|
38
|
-
description: string;
|
|
39
|
-
pack: typeof SIDEKICK_PACK_ID;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface ToolDescriptorInput {
|
|
43
|
-
name: ToolDescriptor['name'];
|
|
44
|
-
permission: ToolDescriptor['permission'];
|
|
45
|
-
required_scopes: ToolDescriptor['required_scopes'];
|
|
46
|
-
entry: ToolDescriptor['entry'];
|
|
47
|
-
description: ToolDescriptor['description'];
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function createToolDescriptor(input: ToolDescriptorInput): ToolDescriptor {
|
|
51
|
-
return {
|
|
52
|
-
...input,
|
|
53
|
-
domain: SIDEKICK_DOMAIN,
|
|
54
|
-
version: SIDEKICK_PACK_VERSION,
|
|
55
|
-
pack: SIDEKICK_PACK_ID,
|
|
56
|
-
};
|
|
57
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
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,10 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2026 Hellmai Ltd
|
|
2
|
-
// SPDX-License-Identifier: LicenseRef-LumenFlow-Proprietary
|
|
3
|
-
|
|
4
|
-
export const SOFTWARE_DELIVERY_PACK_ID = 'software-delivery' as const;
|
|
5
|
-
export const SOFTWARE_DELIVERY_PACK_VERSION = '0.1.0' as const;
|
|
6
|
-
export const SOFTWARE_DELIVERY_DOMAIN = SOFTWARE_DELIVERY_PACK_ID;
|
|
7
|
-
export const SOFTWARE_DELIVERY_POLICY_ID_PREFIX = `${SOFTWARE_DELIVERY_PACK_ID}.gate` as const;
|
|
8
|
-
export const SOFTWARE_DELIVERY_MANIFEST_FILE_NAME = 'manifest.yaml' as const;
|
|
9
|
-
export const SHA256_ALGORITHM = 'sha256' as const;
|
|
10
|
-
export const UTF8_ENCODING = 'utf8' as const;
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2026 Hellmai Ltd
|
|
2
|
-
// SPDX-License-Identifier: LicenseRef-LumenFlow-Proprietary
|
|
3
|
-
|
|
4
|
-
import { SOFTWARE_DELIVERY_DOMAIN } from './constants.js';
|
|
5
|
-
|
|
6
|
-
export const SOFTWARE_DELIVERY_EXTENSION_KEY = 'software_delivery';
|
|
7
|
-
export const SOFTWARE_DELIVERY_EXPOSURES = ['ui', 'api', 'backend-only', 'documentation'] as const;
|
|
8
|
-
|
|
9
|
-
interface Parser<T> {
|
|
10
|
-
parse(input: unknown): T;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface SoftwareDeliveryTests {
|
|
14
|
-
unit: string[];
|
|
15
|
-
e2e: string[];
|
|
16
|
-
manual: string[];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface SoftwareDeliveryTaskExtensions {
|
|
20
|
-
code_paths: string[];
|
|
21
|
-
tests: SoftwareDeliveryTests;
|
|
22
|
-
exposure: (typeof SOFTWARE_DELIVERY_EXPOSURES)[number];
|
|
23
|
-
worktree: string;
|
|
24
|
-
branch: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface SoftwareDeliveryTask {
|
|
28
|
-
domain: typeof SOFTWARE_DELIVERY_DOMAIN;
|
|
29
|
-
extensions: Record<string, unknown> & {
|
|
30
|
-
[SOFTWARE_DELIVERY_EXTENSION_KEY]: SoftwareDeliveryTaskExtensions;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function asRecord(input: unknown, label: string): Record<string, unknown> {
|
|
35
|
-
if (!input || typeof input !== 'object' || Array.isArray(input)) {
|
|
36
|
-
throw new Error(`${label} must be an object.`);
|
|
37
|
-
}
|
|
38
|
-
return input as Record<string, unknown>;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function assertOnlyKeys(
|
|
42
|
-
record: Record<string, unknown>,
|
|
43
|
-
allowedKeys: readonly string[],
|
|
44
|
-
label: string,
|
|
45
|
-
): void {
|
|
46
|
-
const allowed = new Set(allowedKeys);
|
|
47
|
-
for (const key of Object.keys(record)) {
|
|
48
|
-
if (!allowed.has(key)) {
|
|
49
|
-
throw new Error(`${label} has unrecognized key "${key}".`);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function parseNonEmptyString(value: unknown, label: string): string {
|
|
55
|
-
if (typeof value !== 'string' || value.trim().length === 0) {
|
|
56
|
-
throw new Error(`${label} must be a non-empty string.`);
|
|
57
|
-
}
|
|
58
|
-
return value;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function parseStringArray(value: unknown, label: string): string[] {
|
|
62
|
-
if (!Array.isArray(value)) {
|
|
63
|
-
throw new Error(`${label} must be an array.`);
|
|
64
|
-
}
|
|
65
|
-
return value.map((entry, index) => parseNonEmptyString(entry, `${label}[${index}]`));
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function parseTests(input: unknown): SoftwareDeliveryTests {
|
|
69
|
-
const tests = asRecord(input, 'tests');
|
|
70
|
-
assertOnlyKeys(tests, ['unit', 'e2e', 'manual'], 'tests');
|
|
71
|
-
return {
|
|
72
|
-
unit: parseStringArray(tests.unit ?? [], 'tests.unit'),
|
|
73
|
-
e2e: parseStringArray(tests.e2e ?? [], 'tests.e2e'),
|
|
74
|
-
manual: parseStringArray(tests.manual ?? [], 'tests.manual'),
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const ExposureSet = new Set<string>(SOFTWARE_DELIVERY_EXPOSURES);
|
|
79
|
-
|
|
80
|
-
export const SoftwareDeliveryTaskExtensionsSchema: Parser<SoftwareDeliveryTaskExtensions> = {
|
|
81
|
-
parse(input: unknown): SoftwareDeliveryTaskExtensions {
|
|
82
|
-
const extension = asRecord(input, 'software delivery extension');
|
|
83
|
-
assertOnlyKeys(
|
|
84
|
-
extension,
|
|
85
|
-
['code_paths', 'tests', 'exposure', 'worktree', 'branch'],
|
|
86
|
-
'software delivery extension',
|
|
87
|
-
);
|
|
88
|
-
|
|
89
|
-
const exposure = parseNonEmptyString(extension.exposure, 'exposure');
|
|
90
|
-
if (!ExposureSet.has(exposure)) {
|
|
91
|
-
throw new Error(`exposure must be one of: ${SOFTWARE_DELIVERY_EXPOSURES.join(', ')}`);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return {
|
|
95
|
-
code_paths: parseStringArray(extension.code_paths, 'code_paths'),
|
|
96
|
-
tests: parseTests(extension.tests),
|
|
97
|
-
exposure: exposure as (typeof SOFTWARE_DELIVERY_EXPOSURES)[number],
|
|
98
|
-
worktree: parseNonEmptyString(extension.worktree, 'worktree'),
|
|
99
|
-
branch: parseNonEmptyString(extension.branch, 'branch'),
|
|
100
|
-
};
|
|
101
|
-
},
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
export const TaskExtensionsOpaqueRecordSchema: Parser<Record<string, unknown>> = {
|
|
105
|
-
parse(input: unknown): Record<string, unknown> {
|
|
106
|
-
return asRecord(input, 'extensions');
|
|
107
|
-
},
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
export function extractSoftwareDeliveryExtensions(
|
|
111
|
-
extensions: Record<string, unknown> | undefined,
|
|
112
|
-
): SoftwareDeliveryTaskExtensions {
|
|
113
|
-
const parsedExtensions = TaskExtensionsOpaqueRecordSchema.parse(extensions ?? {});
|
|
114
|
-
return SoftwareDeliveryTaskExtensionsSchema.parse(
|
|
115
|
-
parsedExtensions[SOFTWARE_DELIVERY_EXTENSION_KEY],
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export const SoftwareDeliveryTaskSchema: Parser<SoftwareDeliveryTask> = {
|
|
120
|
-
parse(input: unknown): SoftwareDeliveryTask {
|
|
121
|
-
const task = asRecord(input, 'task');
|
|
122
|
-
|
|
123
|
-
if (task.domain !== SOFTWARE_DELIVERY_DOMAIN) {
|
|
124
|
-
throw new Error(`task.domain must be "${SOFTWARE_DELIVERY_DOMAIN}".`);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const parsedExtensions = TaskExtensionsOpaqueRecordSchema.parse(task.extensions);
|
|
128
|
-
const parsedSoftwareDeliveryExtensions = SoftwareDeliveryTaskExtensionsSchema.parse(
|
|
129
|
-
parsedExtensions[SOFTWARE_DELIVERY_EXTENSION_KEY],
|
|
130
|
-
);
|
|
131
|
-
|
|
132
|
-
return {
|
|
133
|
-
domain: SOFTWARE_DELIVERY_DOMAIN,
|
|
134
|
-
extensions: {
|
|
135
|
-
...parsedExtensions,
|
|
136
|
-
[SOFTWARE_DELIVERY_EXTENSION_KEY]: parsedSoftwareDeliveryExtensions,
|
|
137
|
-
},
|
|
138
|
-
};
|
|
139
|
-
},
|
|
140
|
-
};
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2026 Hellmai Ltd
|
|
2
|
-
// SPDX-License-Identifier: LicenseRef-LumenFlow-Proprietary
|
|
3
|
-
|
|
4
|
-
import { SOFTWARE_DELIVERY_PACK_ID, SOFTWARE_DELIVERY_POLICY_ID_PREFIX } from './constants.js';
|
|
5
|
-
|
|
6
|
-
export const SOFTWARE_DELIVERY_GATE_NAMES = [
|
|
7
|
-
'format',
|
|
8
|
-
'lint',
|
|
9
|
-
'typecheck',
|
|
10
|
-
'test',
|
|
11
|
-
'coverage',
|
|
12
|
-
] as const;
|
|
13
|
-
|
|
14
|
-
export type SoftwareDeliveryGateName = (typeof SOFTWARE_DELIVERY_GATE_NAMES)[number];
|
|
15
|
-
|
|
16
|
-
export interface PolicyProvider {
|
|
17
|
-
id: string;
|
|
18
|
-
gate: SoftwareDeliveryGateName;
|
|
19
|
-
trigger: 'on_completion';
|
|
20
|
-
command: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface CompletionPolicyContext {
|
|
24
|
-
trigger: 'on_completion';
|
|
25
|
-
run_id: string;
|
|
26
|
-
task_id: string;
|
|
27
|
-
gate: SoftwareDeliveryGateName;
|
|
28
|
-
pack_id: typeof SOFTWARE_DELIVERY_PACK_ID;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface CompletionPolicyEvaluation {
|
|
32
|
-
decision: 'allow' | 'deny';
|
|
33
|
-
decisions: Array<{
|
|
34
|
-
policy_id: string;
|
|
35
|
-
decision: 'allow' | 'deny';
|
|
36
|
-
reason?: string;
|
|
37
|
-
}>;
|
|
38
|
-
warnings: string[];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface CompletionPolicyEngine {
|
|
42
|
-
evaluate(context: CompletionPolicyContext): Promise<CompletionPolicyEvaluation>;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface CompletionPolicyExecution {
|
|
46
|
-
ok: boolean;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface CompletionPolicyRunResult {
|
|
50
|
-
gate: SoftwareDeliveryGateName;
|
|
51
|
-
policy_id: string;
|
|
52
|
-
decision: 'allow' | 'deny';
|
|
53
|
-
command: string;
|
|
54
|
-
executed: boolean;
|
|
55
|
-
ok: boolean;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const SOFTWARE_DELIVERY_GATE_COMMANDS: Record<SoftwareDeliveryGateName, string> = {
|
|
59
|
-
format: 'pnpm format:check',
|
|
60
|
-
lint: 'pnpm lint',
|
|
61
|
-
typecheck: 'pnpm typecheck',
|
|
62
|
-
test: 'pnpm turbo run test',
|
|
63
|
-
coverage: 'pnpm vitest run --coverage',
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const SOFTWARE_DELIVERY_GATE_POLICIES: readonly PolicyProvider[] =
|
|
67
|
-
SOFTWARE_DELIVERY_GATE_NAMES.map((gate) => ({
|
|
68
|
-
id: `${SOFTWARE_DELIVERY_POLICY_ID_PREFIX}.${gate}`,
|
|
69
|
-
gate,
|
|
70
|
-
trigger: 'on_completion',
|
|
71
|
-
command: SOFTWARE_DELIVERY_GATE_COMMANDS[gate],
|
|
72
|
-
}));
|
|
73
|
-
|
|
74
|
-
export const SOFTWARE_DELIVERY_STATE_ALIASES = {
|
|
75
|
-
active: 'in_progress',
|
|
76
|
-
} as const;
|
|
77
|
-
|
|
78
|
-
export function resolveSoftwareDeliveryStateAlias(
|
|
79
|
-
state: string,
|
|
80
|
-
aliases: Record<string, string> = SOFTWARE_DELIVERY_STATE_ALIASES,
|
|
81
|
-
): string {
|
|
82
|
-
return aliases[state] ?? state;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export async function runCompletionGatePolicies(options: {
|
|
86
|
-
engine: CompletionPolicyEngine;
|
|
87
|
-
runId: string;
|
|
88
|
-
taskId: string;
|
|
89
|
-
providers?: readonly PolicyProvider[];
|
|
90
|
-
executePolicy?: (provider: PolicyProvider) => Promise<CompletionPolicyExecution>;
|
|
91
|
-
}): Promise<CompletionPolicyRunResult[]> {
|
|
92
|
-
const providers = options.providers ?? SOFTWARE_DELIVERY_GATE_POLICIES;
|
|
93
|
-
const executePolicy =
|
|
94
|
-
options.executePolicy ??
|
|
95
|
-
(async () => ({
|
|
96
|
-
ok: true,
|
|
97
|
-
}));
|
|
98
|
-
|
|
99
|
-
const results: CompletionPolicyRunResult[] = [];
|
|
100
|
-
|
|
101
|
-
for (const provider of providers) {
|
|
102
|
-
const evaluation = await options.engine.evaluate({
|
|
103
|
-
trigger: provider.trigger,
|
|
104
|
-
run_id: options.runId,
|
|
105
|
-
task_id: options.taskId,
|
|
106
|
-
gate: provider.gate,
|
|
107
|
-
pack_id: SOFTWARE_DELIVERY_PACK_ID,
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
if (evaluation.decision === 'deny') {
|
|
111
|
-
results.push({
|
|
112
|
-
gate: provider.gate,
|
|
113
|
-
policy_id: provider.id,
|
|
114
|
-
decision: 'deny',
|
|
115
|
-
command: provider.command,
|
|
116
|
-
executed: false,
|
|
117
|
-
ok: false,
|
|
118
|
-
});
|
|
119
|
-
continue;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const execution = await executePolicy(provider);
|
|
123
|
-
results.push({
|
|
124
|
-
gate: provider.gate,
|
|
125
|
-
policy_id: provider.id,
|
|
126
|
-
decision: 'allow',
|
|
127
|
-
command: provider.command,
|
|
128
|
-
executed: true,
|
|
129
|
-
ok: execution.ok,
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return results;
|
|
134
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2026 Hellmai Ltd
|
|
2
|
-
// SPDX-License-Identifier: LicenseRef-LumenFlow-Proprietary
|
|
3
|
-
|
|
4
|
-
export * from './constants.js';
|
|
5
|
-
export * from './extensions.js';
|
|
6
|
-
export * from './gate-policies.js';
|
|
7
|
-
export * from './manifest.js';
|
|
8
|
-
export * from './pack-registration.js';
|