@levu/snap 0.1.0 → 0.1.1
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 +7 -0
- package/dist/cli/cli-runner.d.ts +37 -0
- package/dist/cli/cli-runner.js +161 -0
- package/dist/cli-entry.js +6 -64
- package/dist/core/contracts/action-contract.d.ts +1 -3
- package/dist/core/contracts/tui-contract.d.ts +47 -0
- package/dist/core/contracts/tui-contract.js +1 -0
- package/dist/core/registry/action-registry.js +3 -1
- package/dist/dx/args/env.d.ts +6 -0
- package/dist/dx/args/env.js +15 -0
- package/dist/dx/args/index.d.ts +4 -0
- package/dist/dx/args/index.js +3 -0
- package/dist/dx/args/readers.d.ts +5 -0
- package/dist/dx/args/readers.js +36 -0
- package/dist/dx/args/types.d.ts +5 -0
- package/dist/dx/args/types.js +1 -0
- package/dist/dx/help/builder.d.ts +10 -0
- package/dist/dx/help/builder.js +11 -0
- package/dist/dx/help/index.d.ts +4 -0
- package/dist/dx/help/index.js +2 -0
- package/dist/dx/help/schema.d.ts +14 -0
- package/dist/dx/help/schema.js +33 -0
- package/dist/dx/runtime/action-result.d.ts +12 -0
- package/dist/dx/runtime/action-result.js +35 -0
- package/dist/dx/runtime/flow.d.ts +9 -0
- package/dist/dx/runtime/flow.js +19 -0
- package/dist/dx/runtime/index.d.ts +4 -0
- package/dist/dx/runtime/index.js +2 -0
- package/dist/dx/terminal/index.d.ts +2 -0
- package/dist/dx/terminal/index.js +1 -0
- package/dist/dx/terminal/output.d.ts +7 -0
- package/dist/dx/terminal/output.js +18 -0
- package/dist/dx/tui/components.d.ts +6 -0
- package/dist/dx/tui/components.js +40 -0
- package/dist/dx/tui/flow.d.ts +2 -0
- package/dist/dx/tui/flow.js +14 -0
- package/dist/dx/tui/index.d.ts +4 -0
- package/dist/dx/tui/index.js +3 -0
- package/dist/dx/tui/no-result.d.ts +13 -0
- package/dist/dx/tui/no-result.js +18 -0
- package/dist/help/help-renderer.js +5 -1
- package/dist/help/hierarchy-resolver.js +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.js +9 -0
- package/dist/runtime/dispatch.d.ts +2 -1
- package/dist/runtime/engine.d.ts +2 -1
- package/dist/runtime/engine.js +22 -1
- package/dist/runtime/mode-resolver.d.ts +3 -2
- package/dist/runtime/runtime-context.d.ts +8 -1
- package/dist/tui/component-adapters/cancel.d.ts +6 -0
- package/dist/tui/component-adapters/cancel.js +20 -0
- package/dist/tui/component-adapters/confirm.d.ts +2 -0
- package/dist/tui/component-adapters/confirm.js +13 -1
- package/dist/tui/component-adapters/multiselect.d.ts +4 -0
- package/dist/tui/component-adapters/multiselect.js +23 -3
- package/dist/tui/component-adapters/readline-utils.d.ts +1 -0
- package/dist/tui/component-adapters/readline-utils.js +2 -0
- package/dist/tui/component-adapters/select.d.ts +2 -0
- package/dist/tui/component-adapters/select.js +25 -3
- package/dist/tui/component-adapters/text.d.ts +2 -0
- package/dist/tui/component-adapters/text.js +21 -4
- package/dist/tui/custom/custom-prompt.d.ts +16 -0
- package/dist/tui/custom/custom-prompt.js +72 -0
- package/dist/tui/custom/index.d.ts +2 -0
- package/dist/tui/custom/index.js +1 -0
- package/dist/tui/prompt-toolkit.d.ts +15 -0
- package/dist/tui/prompt-toolkit.js +17 -0
- package/package.json +13 -2
- package/.github/workflows/ci.yml +0 -26
- package/docs/help-contract-spec.md +0 -29
- package/docs/module-authoring-guide.md +0 -52
- package/plans/260209-1547-hub-dual-runtime-framework/phase-01-foundation-and-contracts.md +0 -71
- package/plans/260209-1547-hub-dual-runtime-framework/phase-02-runtime-and-state-machine.md +0 -76
- package/plans/260209-1547-hub-dual-runtime-framework/phase-03-tui-components-and-policies.md +0 -71
- package/plans/260209-1547-hub-dual-runtime-framework/phase-04-help-system-and-ai-readability.md +0 -69
- package/plans/260209-1547-hub-dual-runtime-framework/phase-05-testing-and-quality-gates.md +0 -79
- package/plans/260209-1547-hub-dual-runtime-framework/phase-06-sample-modules-and-adoption.md +0 -75
- package/plans/260209-1547-hub-dual-runtime-framework/plan.md +0 -105
- package/plans/260209-1547-hub-dual-runtime-framework/reports/planner-report.md +0 -27
- package/plans/260209-1547-hub-dual-runtime-framework/research/researcher-01-report.md +0 -166
- package/plans/260209-1547-hub-dual-runtime-framework/research/researcher-02-report.md +0 -87
- package/plans/260209-1547-hub-dual-runtime-framework/scout/scout-01-report.md +0 -24
- package/src/cli/help-command.ts +0 -1
- package/src/cli-entry.ts +0 -83
- package/src/core/contracts/action-contract.ts +0 -30
- package/src/core/contracts/help-contract.ts +0 -20
- package/src/core/contracts/module-contract.ts +0 -7
- package/src/core/errors/framework-errors.ts +0 -26
- package/src/core/registry/action-registry.ts +0 -94
- package/src/help/help-command.ts +0 -32
- package/src/help/help-model.ts +0 -10
- package/src/help/help-renderer.ts +0 -21
- package/src/help/hierarchy-resolver.ts +0 -54
- package/src/index.ts +0 -10
- package/src/modules/sample-content/module.ts +0 -66
- package/src/modules/sample-system/module.ts +0 -74
- package/src/runtime/dispatch.ts +0 -64
- package/src/runtime/engine.ts +0 -59
- package/src/runtime/mode-resolver.ts +0 -18
- package/src/runtime/resume-store.ts +0 -53
- package/src/runtime/runtime-context.ts +0 -10
- package/src/runtime/state-machine.ts +0 -77
- package/src/tui/accessibility-footer.ts +0 -11
- package/src/tui/component-adapters/confirm.ts +0 -8
- package/src/tui/component-adapters/group.ts +0 -12
- package/src/tui/component-adapters/multiselect.ts +0 -22
- package/src/tui/component-adapters/select.ts +0 -18
- package/src/tui/component-adapters/text.ts +0 -13
- package/src/tui/interrupt-handlers.ts +0 -15
- package/tests/e2e/cli-smoke.e2e.test.ts +0 -19
- package/tests/integration/runtime-dispatch.integration.test.ts +0 -23
- package/tests/transcript/help.transcript.test.ts +0 -20
- package/tests/unit/state-machine.test.ts +0 -22
- package/tsconfig.build.json +0 -9
- package/tsconfig.json +0 -17
- package/vitest.config.ts +0 -8
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import { StateMachine } from '../../src/runtime/state-machine.js';
|
|
3
|
-
|
|
4
|
-
describe('state-machine', () => {
|
|
5
|
-
it('supports next/back/jump/exit transitions', () => {
|
|
6
|
-
const machine = new StateMachine('wf', [
|
|
7
|
-
{ id: 'a', label: 'A' },
|
|
8
|
-
{ id: 'b', label: 'B' },
|
|
9
|
-
{ id: 'c', label: 'C' }
|
|
10
|
-
]);
|
|
11
|
-
|
|
12
|
-
expect(machine.currentNode().id).toBe('a');
|
|
13
|
-
machine.transition({ type: 'next' });
|
|
14
|
-
expect(machine.currentNode().id).toBe('b');
|
|
15
|
-
machine.transition({ type: 'jump', targetNodeId: 'c' });
|
|
16
|
-
expect(machine.currentNode().id).toBe('c');
|
|
17
|
-
machine.transition({ type: 'back' });
|
|
18
|
-
expect(machine.currentNode().id).toBe('b');
|
|
19
|
-
machine.transition({ type: 'exit' });
|
|
20
|
-
expect(machine.snapshot().exited).toBe(true);
|
|
21
|
-
});
|
|
22
|
-
});
|
package/tsconfig.build.json
DELETED
package/tsconfig.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "NodeNext",
|
|
5
|
-
"moduleResolution": "NodeNext",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
"forceConsistentCasingInFileNames": true,
|
|
10
|
-
"declaration": true,
|
|
11
|
-
"outDir": "dist",
|
|
12
|
-
"rootDir": ".",
|
|
13
|
-
"types": ["node", "vitest/globals"]
|
|
14
|
-
},
|
|
15
|
-
"include": ["src/**/*.ts", "tests/**/*.ts", "vitest.config.ts"],
|
|
16
|
-
"exclude": ["dist", "node_modules"]
|
|
17
|
-
}
|