@adhamalkhaja/seyola-runtime 0.11.4
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/LICENSE +56 -0
- package/README.md +87 -0
- package/dist/adapters/claude-code-local/index.d.ts +60 -0
- package/dist/adapters/claude-code-local/index.d.ts.map +1 -0
- package/dist/adapters/claude-code-local/index.js +270 -0
- package/dist/adapters/claude-code-local/index.js.map +1 -0
- package/dist/bundle/index.d.ts +60 -0
- package/dist/bundle/index.d.ts.map +1 -0
- package/dist/bundle/index.js +989 -0
- package/dist/bundle/index.js.map +1 -0
- package/dist/cli/index.d.ts +12 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +207 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/compile-plan/budgets.d.ts +23 -0
- package/dist/compile-plan/budgets.d.ts.map +1 -0
- package/dist/compile-plan/budgets.js +55 -0
- package/dist/compile-plan/budgets.js.map +1 -0
- package/dist/compile-plan/graph.d.ts +40 -0
- package/dist/compile-plan/graph.d.ts.map +1 -0
- package/dist/compile-plan/graph.js +114 -0
- package/dist/compile-plan/graph.js.map +1 -0
- package/dist/compile-plan/index.d.ts +28 -0
- package/dist/compile-plan/index.d.ts.map +1 -0
- package/dist/compile-plan/index.js +423 -0
- package/dist/compile-plan/index.js.map +1 -0
- package/dist/compile-plan/registries.d.ts +35 -0
- package/dist/compile-plan/registries.d.ts.map +1 -0
- package/dist/compile-plan/registries.js +81 -0
- package/dist/compile-plan/registries.js.map +1 -0
- package/dist/compile-plan/resolver.d.ts +24 -0
- package/dist/compile-plan/resolver.d.ts.map +1 -0
- package/dist/compile-plan/resolver.js +57 -0
- package/dist/compile-plan/resolver.js.map +1 -0
- package/dist/compile-plan/types.d.ts +192 -0
- package/dist/compile-plan/types.d.ts.map +1 -0
- package/dist/compile-plan/types.js +7 -0
- package/dist/compile-plan/types.js.map +1 -0
- package/dist/doctor/index.d.ts +43 -0
- package/dist/doctor/index.d.ts.map +1 -0
- package/dist/doctor/index.js +224 -0
- package/dist/doctor/index.js.map +1 -0
- package/dist/init/index.d.ts +53 -0
- package/dist/init/index.d.ts.map +1 -0
- package/dist/init/index.js +414 -0
- package/dist/init/index.js.map +1 -0
- package/dist/lib/ajvSetup.d.ts +30 -0
- package/dist/lib/ajvSetup.d.ts.map +1 -0
- package/dist/lib/ajvSetup.js +44 -0
- package/dist/lib/ajvSetup.js.map +1 -0
- package/dist/lib/loadJson.d.ts +21 -0
- package/dist/lib/loadJson.d.ts.map +1 -0
- package/dist/lib/loadJson.js +43 -0
- package/dist/lib/loadJson.js.map +1 -0
- package/dist/lib/loadYaml.d.ts +18 -0
- package/dist/lib/loadYaml.d.ts.map +1 -0
- package/dist/lib/loadYaml.js +41 -0
- package/dist/lib/loadYaml.js.map +1 -0
- package/dist/lib/paths.d.ts +22 -0
- package/dist/lib/paths.d.ts.map +1 -0
- package/dist/lib/paths.js +61 -0
- package/dist/lib/paths.js.map +1 -0
- package/dist/run-plan/index.d.ts +17 -0
- package/dist/run-plan/index.d.ts.map +1 -0
- package/dist/run-plan/index.js +235 -0
- package/dist/run-plan/index.js.map +1 -0
- package/dist/run-plan/types.d.ts +53 -0
- package/dist/run-plan/types.d.ts.map +1 -0
- package/dist/run-plan/types.js +6 -0
- package/dist/run-plan/types.js.map +1 -0
- package/dist/run-step/contextPacket.d.ts +39 -0
- package/dist/run-step/contextPacket.d.ts.map +1 -0
- package/dist/run-step/contextPacket.js +213 -0
- package/dist/run-step/contextPacket.js.map +1 -0
- package/dist/run-step/derivation.d.ts +41 -0
- package/dist/run-step/derivation.d.ts.map +1 -0
- package/dist/run-step/derivation.js +61 -0
- package/dist/run-step/derivation.js.map +1 -0
- package/dist/run-step/effectExecutor.d.ts +42 -0
- package/dist/run-step/effectExecutor.d.ts.map +1 -0
- package/dist/run-step/effectExecutor.js +297 -0
- package/dist/run-step/effectExecutor.js.map +1 -0
- package/dist/run-step/formatExecutor.d.ts +34 -0
- package/dist/run-step/formatExecutor.d.ts.map +1 -0
- package/dist/run-step/formatExecutor.js +329 -0
- package/dist/run-step/formatExecutor.js.map +1 -0
- package/dist/run-step/index.d.ts +23 -0
- package/dist/run-step/index.d.ts.map +1 -0
- package/dist/run-step/index.js +627 -0
- package/dist/run-step/index.js.map +1 -0
- package/dist/run-step/inputResolver.d.ts +48 -0
- package/dist/run-step/inputResolver.d.ts.map +1 -0
- package/dist/run-step/inputResolver.js +268 -0
- package/dist/run-step/inputResolver.js.map +1 -0
- package/dist/run-step/types.d.ts +123 -0
- package/dist/run-step/types.d.ts.map +1 -0
- package/dist/run-step/types.js +6 -0
- package/dist/run-step/types.js.map +1 -0
- package/dist/validate-pack/checks/capabilitiesRegistry.d.ts +3 -0
- package/dist/validate-pack/checks/capabilitiesRegistry.d.ts.map +1 -0
- package/dist/validate-pack/checks/capabilitiesRegistry.js +83 -0
- package/dist/validate-pack/checks/capabilitiesRegistry.js.map +1 -0
- package/dist/validate-pack/checks/contextPolicies.d.ts +3 -0
- package/dist/validate-pack/checks/contextPolicies.d.ts.map +1 -0
- package/dist/validate-pack/checks/contextPolicies.js +40 -0
- package/dist/validate-pack/checks/contextPolicies.js.map +1 -0
- package/dist/validate-pack/checks/mvkExamples.d.ts +10 -0
- package/dist/validate-pack/checks/mvkExamples.d.ts.map +1 -0
- package/dist/validate-pack/checks/mvkExamples.js +77 -0
- package/dist/validate-pack/checks/mvkExamples.js.map +1 -0
- package/dist/validate-pack/checks/requiredFiles.d.ts +3 -0
- package/dist/validate-pack/checks/requiredFiles.d.ts.map +1 -0
- package/dist/validate-pack/checks/requiredFiles.js +35 -0
- package/dist/validate-pack/checks/requiredFiles.js.map +1 -0
- package/dist/validate-pack/checks/resolutionPolicy.d.ts +3 -0
- package/dist/validate-pack/checks/resolutionPolicy.d.ts.map +1 -0
- package/dist/validate-pack/checks/resolutionPolicy.js +88 -0
- package/dist/validate-pack/checks/resolutionPolicy.js.map +1 -0
- package/dist/validate-pack/checks/schemas.d.ts +16 -0
- package/dist/validate-pack/checks/schemas.d.ts.map +1 -0
- package/dist/validate-pack/checks/schemas.js +70 -0
- package/dist/validate-pack/checks/schemas.js.map +1 -0
- package/dist/validate-pack/index.d.ts +25 -0
- package/dist/validate-pack/index.d.ts.map +1 -0
- package/dist/validate-pack/index.js +95 -0
- package/dist/validate-pack/index.js.map +1 -0
- package/dist/validate-pack/reporting.d.ts +6 -0
- package/dist/validate-pack/reporting.d.ts.map +1 -0
- package/dist/validate-pack/reporting.js +40 -0
- package/dist/validate-pack/reporting.js.map +1 -0
- package/dist/validate-pack/types.d.ts +34 -0
- package/dist/validate-pack/types.d.ts.map +1 -0
- package/dist/validate-pack/types.js +8 -0
- package/dist/validate-pack/types.js.map +1 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
Proprietary License — seyola-runtime
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Adham Alkhaja. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This software (the "Runtime") is published on the npm registry to make
|
|
6
|
+
installation convenient for Seyola members and integrators. Publication on
|
|
7
|
+
npm does not grant any rights of use, copy, modification, distribution, or
|
|
8
|
+
derivation beyond what is explicitly stated below.
|
|
9
|
+
|
|
10
|
+
PERMITTED USES
|
|
11
|
+
|
|
12
|
+
You may install and run the Runtime locally on machines you own or operate,
|
|
13
|
+
solely for the purpose of executing official Seyola packs (such as the one
|
|
14
|
+
distributed at https://github.com/seyola-community/seyola-paid) on your own
|
|
15
|
+
behalf or on behalf of a Seyola member account in good standing.
|
|
16
|
+
|
|
17
|
+
PROHIBITED USES
|
|
18
|
+
|
|
19
|
+
Without prior written permission from the copyright holder, you may not:
|
|
20
|
+
|
|
21
|
+
1. Copy, modify, fork, or redistribute the Runtime source or compiled
|
|
22
|
+
output, in whole or in part.
|
|
23
|
+
|
|
24
|
+
2. Use the Runtime to execute non-Seyola packs, third-party packs, or
|
|
25
|
+
derivative packs.
|
|
26
|
+
|
|
27
|
+
3. Use the Runtime, or any technique it embodies, to build, sell, or
|
|
28
|
+
distribute a competing product.
|
|
29
|
+
|
|
30
|
+
4. Remove, alter, or obscure copyright notices, license notices, or
|
|
31
|
+
attribution.
|
|
32
|
+
|
|
33
|
+
5. Reverse-engineer, decompile, or otherwise attempt to derive the source
|
|
34
|
+
of any non-source files distributed with this package, except as
|
|
35
|
+
permitted by applicable law.
|
|
36
|
+
|
|
37
|
+
6. Sub-license, rent, lease, or otherwise transfer rights to the Runtime
|
|
38
|
+
to any third party.
|
|
39
|
+
|
|
40
|
+
NO WARRANTY
|
|
41
|
+
|
|
42
|
+
THE RUNTIME IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
43
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
44
|
+
FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
45
|
+
THE AUTHOR OR COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
|
|
46
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING
|
|
47
|
+
FROM, OUT OF, OR IN CONNECTION WITH THE RUNTIME OR THE USE OR OTHER
|
|
48
|
+
DEALINGS IN THE RUNTIME.
|
|
49
|
+
|
|
50
|
+
CONTACT
|
|
51
|
+
|
|
52
|
+
For licensing inquiries, partnership requests, or written permission to
|
|
53
|
+
exceed the permitted uses above, contact the copyright holder.
|
|
54
|
+
|
|
55
|
+
This license may be updated in future versions. The license file shipped
|
|
56
|
+
with each version of the Runtime governs that specific version.
|
package/README.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# seyola-runtime
|
|
2
|
+
|
|
3
|
+
Local CLI runtime for the Seyola business operating system. Reads contracts and registries from a Seyola pack and executes them against a runtime backend (Claude Code local subprocess).
|
|
4
|
+
|
|
5
|
+
This is the engine. The product (Seyola pack + workspace) is at https://github.com/seyola-community/seyola-paid for members.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npm install -g @adhamalkhaja/seyola-runtime
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Requires Node 20 or higher.
|
|
14
|
+
|
|
15
|
+
Verify:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
seyola-runtime --version
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
The runtime is invoked via subcommands. The most common flow for a Seyola member:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
# Get a workspace (clone the client bundle).
|
|
27
|
+
git clone https://github.com/seyola-community/seyola-paid.git my-seyola
|
|
28
|
+
cd my-seyola
|
|
29
|
+
|
|
30
|
+
# Initialize.
|
|
31
|
+
seyola-runtime init --workspace . --pack ./.seyola/pack
|
|
32
|
+
|
|
33
|
+
# Health check.
|
|
34
|
+
seyola-runtime doctor --workspace .
|
|
35
|
+
|
|
36
|
+
# Then open Claude Code and use the workflows.
|
|
37
|
+
claude
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
In Claude Code: `/linkedin-writer`, `/brand-voice`, `/audience-profile-builder`, `/story-bank-builder`.
|
|
41
|
+
|
|
42
|
+
## Subcommands
|
|
43
|
+
|
|
44
|
+
| Command | Purpose |
|
|
45
|
+
|---|---|
|
|
46
|
+
| `seyola-runtime --version` | Print the runtime version. |
|
|
47
|
+
| `seyola-runtime --help` | List all subcommands. |
|
|
48
|
+
| `seyola-runtime validate-pack --pack <path>` | Validate a Seyola pack against its registries and schemas. |
|
|
49
|
+
| `seyola-runtime compile-plan --task <path> --pack <path>` | Compile a TaskSpec into a deterministic WorkPlan. |
|
|
50
|
+
| `seyola-runtime run-step --plan <path> --step <id> --backend claude-code-local` | Execute one WorkPlan step. |
|
|
51
|
+
| `seyola-runtime run-plan --task <path> --backend claude-code-local --output-dir <path>` | Execute a full plan as a DAG. |
|
|
52
|
+
| `seyola-runtime init --workspace <path> --pack <path>` | Initialize a Seyola workspace from a pack. |
|
|
53
|
+
| `seyola-runtime doctor --workspace <path>` | Health-check a workspace. |
|
|
54
|
+
| `seyola-runtime bundle --pack <path> --runtime <path> --out <path>` | Generate a Client Alpha distribution bundle. |
|
|
55
|
+
|
|
56
|
+
Run `seyola-runtime <command> --help` for command-specific options.
|
|
57
|
+
|
|
58
|
+
## How it works
|
|
59
|
+
|
|
60
|
+
The runtime reads a Seyola pack (typed registries + skills + schemas), compiles a member's intent (a TaskSpec) into a deterministic WorkPlan, then executes each step against a backend. Today the only supported backend is `claude-code-local`, which spawns the official Claude Code CLI as a subprocess.
|
|
61
|
+
|
|
62
|
+
The runtime does NOT:
|
|
63
|
+
|
|
64
|
+
- Host or proxy any AI service.
|
|
65
|
+
- Store, collect, or transmit Claude credentials.
|
|
66
|
+
- Own member substrate (voice profiles, audience profiles, runs).
|
|
67
|
+
- Ship contracts or skill content (those live in the pack).
|
|
68
|
+
|
|
69
|
+
The pack is the product. The runtime is the executor.
|
|
70
|
+
|
|
71
|
+
## Requirements
|
|
72
|
+
|
|
73
|
+
- **Node.js 20+** — https://nodejs.org/
|
|
74
|
+
- **Claude Code** — https://claude.com/claude-code (installed and authenticated). Required for `run-step` and `run-plan`.
|
|
75
|
+
- **A Seyola pack** — typically the workspace cloned from https://github.com/seyola-community/seyola-paid (members only).
|
|
76
|
+
|
|
77
|
+
The runtime alone, without a pack, has no workflows to execute. Get the pack from the Seyola community.
|
|
78
|
+
|
|
79
|
+
## License
|
|
80
|
+
|
|
81
|
+
Proprietary. See LICENSE. Use of this package is subject to the terms in the LICENSE file. The runtime is freely installable; the pack and methodology library are restricted to active Seyola members.
|
|
82
|
+
|
|
83
|
+
## Support
|
|
84
|
+
|
|
85
|
+
For installation issues with this runtime: open an issue on the source repository.
|
|
86
|
+
|
|
87
|
+
For Seyola product questions, methodology, or member access: contact the Seyola community.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code local adapter.
|
|
3
|
+
*
|
|
4
|
+
* Spawns Claude Code on the member's machine in non-interactive mode. The
|
|
5
|
+
* member's Claude Code authentication is used directly. This adapter does
|
|
6
|
+
* NOT store, collect, or proxy Claude credentials.
|
|
7
|
+
*
|
|
8
|
+
* The contract: pass a prompt + an output-schema requirement. Receive a
|
|
9
|
+
* JSON object the runtime can validate against the schema.
|
|
10
|
+
*
|
|
11
|
+
* Implementation strategy for v0.4.x:
|
|
12
|
+
* 1. Write the assembled prompt to a temp file.
|
|
13
|
+
* 2. Spawn the configured Claude Code binary with -p (print mode).
|
|
14
|
+
* 3. Capture stdout.
|
|
15
|
+
* 4. Extract the first JSON object from the response.
|
|
16
|
+
* 5. Return raw + parsed.
|
|
17
|
+
*
|
|
18
|
+
* The exact Claude Code CLI flag set may differ across releases. The
|
|
19
|
+
* adapter accepts overrides via:
|
|
20
|
+
* - SEYOLA_CLAUDE_BIN env var (default: "claude")
|
|
21
|
+
* - SEYOLA_CLAUDE_PRINT_FLAG env var (default: "-p")
|
|
22
|
+
*
|
|
23
|
+
* If SEYOLA_RUNTIME_MOCK_CLAUDE=1 is set, the adapter returns a canned
|
|
24
|
+
* response from the prompt's content for tests.
|
|
25
|
+
*/
|
|
26
|
+
export interface ExecuteArgs {
|
|
27
|
+
prompt: string;
|
|
28
|
+
outputSchema: unknown;
|
|
29
|
+
timeoutSeconds?: number;
|
|
30
|
+
modelHint?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ExecuteResult {
|
|
33
|
+
ok: boolean;
|
|
34
|
+
raw: string;
|
|
35
|
+
parsed?: unknown;
|
|
36
|
+
errors: Array<{
|
|
37
|
+
code: string;
|
|
38
|
+
message: string;
|
|
39
|
+
}>;
|
|
40
|
+
costEstimate?: {
|
|
41
|
+
wallClockSeconds: number;
|
|
42
|
+
modelId?: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export declare function executeStep(args: ExecuteArgs): Promise<ExecuteResult>;
|
|
46
|
+
interface ExtractSuccess {
|
|
47
|
+
ok: true;
|
|
48
|
+
data: unknown;
|
|
49
|
+
}
|
|
50
|
+
interface ExtractFailure {
|
|
51
|
+
ok: false;
|
|
52
|
+
message: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Extracts the first JSON object from a string. Tolerates leading/trailing
|
|
56
|
+
* prose and markdown code fences.
|
|
57
|
+
*/
|
|
58
|
+
export declare function extractJson(raw: string): ExtractSuccess | ExtractFailure;
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/claude-code-local/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AASH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,OAAO,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjD,YAAY,CAAC,EAAE;QACb,gBAAgB,EAAE,MAAM,CAAC;QACzB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAID,wBAAsB,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAiF3E;AAED,UAAU,cAAc;IAAG,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;CAAE;AACrD,UAAU,cAAc;IAAG,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;CAAE;AAExD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,cAAc,CA2CxE"}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code local adapter.
|
|
3
|
+
*
|
|
4
|
+
* Spawns Claude Code on the member's machine in non-interactive mode. The
|
|
5
|
+
* member's Claude Code authentication is used directly. This adapter does
|
|
6
|
+
* NOT store, collect, or proxy Claude credentials.
|
|
7
|
+
*
|
|
8
|
+
* The contract: pass a prompt + an output-schema requirement. Receive a
|
|
9
|
+
* JSON object the runtime can validate against the schema.
|
|
10
|
+
*
|
|
11
|
+
* Implementation strategy for v0.4.x:
|
|
12
|
+
* 1. Write the assembled prompt to a temp file.
|
|
13
|
+
* 2. Spawn the configured Claude Code binary with -p (print mode).
|
|
14
|
+
* 3. Capture stdout.
|
|
15
|
+
* 4. Extract the first JSON object from the response.
|
|
16
|
+
* 5. Return raw + parsed.
|
|
17
|
+
*
|
|
18
|
+
* The exact Claude Code CLI flag set may differ across releases. The
|
|
19
|
+
* adapter accepts overrides via:
|
|
20
|
+
* - SEYOLA_CLAUDE_BIN env var (default: "claude")
|
|
21
|
+
* - SEYOLA_CLAUDE_PRINT_FLAG env var (default: "-p")
|
|
22
|
+
*
|
|
23
|
+
* If SEYOLA_RUNTIME_MOCK_CLAUDE=1 is set, the adapter returns a canned
|
|
24
|
+
* response from the prompt's content for tests.
|
|
25
|
+
*/
|
|
26
|
+
import { execa } from "execa";
|
|
27
|
+
import { writeFileSync, mkdtempSync, rmSync } from "node:fs";
|
|
28
|
+
import { tmpdir } from "node:os";
|
|
29
|
+
import { join } from "node:path";
|
|
30
|
+
const DEFAULT_TIMEOUT_SECONDS = 600;
|
|
31
|
+
export async function executeStep(args) {
|
|
32
|
+
if (process.env.SEYOLA_RUNTIME_MOCK_CLAUDE === "1") {
|
|
33
|
+
return mockExecute(args);
|
|
34
|
+
}
|
|
35
|
+
const claudeBin = process.env.SEYOLA_CLAUDE_BIN ?? "claude";
|
|
36
|
+
const printFlag = process.env.SEYOLA_CLAUDE_PRINT_FLAG ?? "-p";
|
|
37
|
+
const timeout = (args.timeoutSeconds ?? DEFAULT_TIMEOUT_SECONDS) * 1000;
|
|
38
|
+
// Stage prompt to a temp file. Avoids argv-length and quoting hazards
|
|
39
|
+
// across platforms.
|
|
40
|
+
const tempBase = mkdtempSync(join(tmpdir(), "seyola-runtime-"));
|
|
41
|
+
const promptFile = join(tempBase, "prompt.txt");
|
|
42
|
+
writeFileSync(promptFile, args.prompt);
|
|
43
|
+
const start = Date.now();
|
|
44
|
+
let result;
|
|
45
|
+
try {
|
|
46
|
+
result = await execa(claudeBin, [printFlag], {
|
|
47
|
+
input: args.prompt,
|
|
48
|
+
timeout,
|
|
49
|
+
reject: false,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
rmSync(tempBase, { recursive: true, force: true });
|
|
54
|
+
const e = err;
|
|
55
|
+
const rawStdout = typeof e.stdout === "string" ? e.stdout : "";
|
|
56
|
+
return {
|
|
57
|
+
ok: false,
|
|
58
|
+
raw: rawStdout,
|
|
59
|
+
errors: [
|
|
60
|
+
{
|
|
61
|
+
code: "claude_code_spawn_failed",
|
|
62
|
+
message: `Failed to invoke '${claudeBin} ${printFlag}': ${e.message}. Set SEYOLA_CLAUDE_BIN and SEYOLA_CLAUDE_PRINT_FLAG if your install differs.`,
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
rmSync(tempBase, { recursive: true, force: true });
|
|
68
|
+
const wallClockSeconds = (Date.now() - start) / 1000;
|
|
69
|
+
const stdoutString = typeof result.stdout === "string" ? result.stdout : "";
|
|
70
|
+
const stderrString = typeof result.stderr === "string" ? result.stderr : "";
|
|
71
|
+
if (result.exitCode !== 0) {
|
|
72
|
+
return {
|
|
73
|
+
ok: false,
|
|
74
|
+
raw: stdoutString,
|
|
75
|
+
errors: [
|
|
76
|
+
{
|
|
77
|
+
code: "claude_code_nonzero_exit",
|
|
78
|
+
message: `Claude Code exited with code ${result.exitCode}. stderr: ${stderrString.slice(0, 500)}`,
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
costEstimate: { wallClockSeconds },
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const parsed = extractJson(stdoutString);
|
|
85
|
+
if (!parsed.ok) {
|
|
86
|
+
return {
|
|
87
|
+
ok: false,
|
|
88
|
+
raw: stdoutString,
|
|
89
|
+
errors: [
|
|
90
|
+
{
|
|
91
|
+
code: "no_json_in_response",
|
|
92
|
+
message: parsed.message,
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
costEstimate: { wallClockSeconds },
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
void args.outputSchema;
|
|
99
|
+
return {
|
|
100
|
+
ok: true,
|
|
101
|
+
raw: stdoutString,
|
|
102
|
+
parsed: parsed.data,
|
|
103
|
+
errors: [],
|
|
104
|
+
costEstimate: { wallClockSeconds },
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Extracts the first JSON object from a string. Tolerates leading/trailing
|
|
109
|
+
* prose and markdown code fences.
|
|
110
|
+
*/
|
|
111
|
+
export function extractJson(raw) {
|
|
112
|
+
if (!raw || raw.length === 0) {
|
|
113
|
+
return { ok: false, message: "Response was empty." };
|
|
114
|
+
}
|
|
115
|
+
// Strip markdown code fences if present.
|
|
116
|
+
const fenceMatch = raw.match(/```(?:json)?\s*\n([\s\S]*?)\n```/);
|
|
117
|
+
const candidate = fenceMatch ? fenceMatch[1] : raw;
|
|
118
|
+
// Find the first { and the last matching }.
|
|
119
|
+
const firstBrace = candidate.indexOf("{");
|
|
120
|
+
if (firstBrace < 0) {
|
|
121
|
+
return { ok: false, message: "No JSON object found in response (no opening brace)." };
|
|
122
|
+
}
|
|
123
|
+
// Walk forward tracking brace depth. Honors strings.
|
|
124
|
+
let depth = 0;
|
|
125
|
+
let inString = false;
|
|
126
|
+
let escape = false;
|
|
127
|
+
let endIndex = -1;
|
|
128
|
+
for (let i = firstBrace; i < candidate.length; i++) {
|
|
129
|
+
const ch = candidate[i];
|
|
130
|
+
if (escape) {
|
|
131
|
+
escape = false;
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
if (ch === "\\") {
|
|
135
|
+
escape = true;
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
if (ch === '"') {
|
|
139
|
+
inString = !inString;
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
if (inString)
|
|
143
|
+
continue;
|
|
144
|
+
if (ch === "{")
|
|
145
|
+
depth++;
|
|
146
|
+
else if (ch === "}") {
|
|
147
|
+
depth--;
|
|
148
|
+
if (depth === 0) {
|
|
149
|
+
endIndex = i;
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (endIndex < 0) {
|
|
155
|
+
return { ok: false, message: "JSON object in response was not balanced (no matching closing brace)." };
|
|
156
|
+
}
|
|
157
|
+
const slice = candidate.slice(firstBrace, endIndex + 1);
|
|
158
|
+
try {
|
|
159
|
+
const data = JSON.parse(slice);
|
|
160
|
+
return { ok: true, data };
|
|
161
|
+
}
|
|
162
|
+
catch (err) {
|
|
163
|
+
return { ok: false, message: `JSON.parse failed: ${err instanceof Error ? err.message : String(err)}` };
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Test/dev helper. Returns a canned requirements-set when
|
|
168
|
+
* SEYOLA_RUNTIME_MOCK_CLAUDE=1. Detects which output schema is requested by
|
|
169
|
+
* looking for $type/title hints in the prompt.
|
|
170
|
+
*/
|
|
171
|
+
function mockExecute(args) {
|
|
172
|
+
// Identify requested output artifact type from the Step Contract block.
|
|
173
|
+
// The prompt assembled in src/run-step/contextPacket.ts includes a line:
|
|
174
|
+
// "output_artifact_type: <name>"
|
|
175
|
+
const match = /output_artifact_type:\s*([\w-]+)/.exec(args.prompt);
|
|
176
|
+
const outputType = match ? match[1] : "";
|
|
177
|
+
if (outputType === "government-technical-proposal") {
|
|
178
|
+
const proposal = mockGovernmentProposal();
|
|
179
|
+
return {
|
|
180
|
+
ok: true,
|
|
181
|
+
raw: JSON.stringify(proposal, null, 2),
|
|
182
|
+
parsed: proposal,
|
|
183
|
+
errors: [],
|
|
184
|
+
costEstimate: { wallClockSeconds: 0 },
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
if (outputType !== "requirements-set") {
|
|
188
|
+
return {
|
|
189
|
+
ok: false,
|
|
190
|
+
raw: "",
|
|
191
|
+
errors: [{
|
|
192
|
+
code: "mock_unsupported",
|
|
193
|
+
message: `Mock adapter has no canned response for output_artifact_type='${outputType}'. Supported: requirements-set, government-technical-proposal.`,
|
|
194
|
+
}],
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
const canned = {
|
|
198
|
+
$type: "requirements-set",
|
|
199
|
+
$schema_version: "1.0.0",
|
|
200
|
+
source: {
|
|
201
|
+
artifact_type: "transcript",
|
|
202
|
+
ref: "mocked",
|
|
203
|
+
extracted_at: new Date().toISOString(),
|
|
204
|
+
extracted_by: "skills/layer-3/transcript-to-requirements/SKILL.md",
|
|
205
|
+
},
|
|
206
|
+
summary: "Mocked extraction from a hypothetical transcript. Two requirements captured for test purposes.",
|
|
207
|
+
requirements: [
|
|
208
|
+
{
|
|
209
|
+
id: "REQ-001",
|
|
210
|
+
statement: "The system must launch before fiscal year end.",
|
|
211
|
+
must_or_should: "must",
|
|
212
|
+
category: "timeline",
|
|
213
|
+
source_evidence: [
|
|
214
|
+
{ quote: "We have to have something running before fiscal year end.", speaker: "Deputy Minister", confidence: "explicit" },
|
|
215
|
+
],
|
|
216
|
+
open_questions: [],
|
|
217
|
+
depends_on: [],
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
id: "REQ-002",
|
|
221
|
+
statement: "All client data must remain in the GCC region.",
|
|
222
|
+
must_or_should: "must",
|
|
223
|
+
category: "compliance",
|
|
224
|
+
source_evidence: [
|
|
225
|
+
{ quote: "Data residency is non-negotiable.", speaker: "IT Director", confidence: "explicit" },
|
|
226
|
+
],
|
|
227
|
+
open_questions: [],
|
|
228
|
+
depends_on: [],
|
|
229
|
+
},
|
|
230
|
+
],
|
|
231
|
+
gaps: ["No specific budget number named.", "No security audit requirements stated."],
|
|
232
|
+
completeness_assessment: "ready_for_drafting",
|
|
233
|
+
};
|
|
234
|
+
return {
|
|
235
|
+
ok: true,
|
|
236
|
+
raw: JSON.stringify(canned, null, 2),
|
|
237
|
+
parsed: canned,
|
|
238
|
+
errors: [],
|
|
239
|
+
costEstimate: { wallClockSeconds: 0 },
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
function mockGovernmentProposal() {
|
|
243
|
+
return {
|
|
244
|
+
$type: "government-technical-proposal",
|
|
245
|
+
$schema_version: "1.0.0",
|
|
246
|
+
metadata: {
|
|
247
|
+
title: "Mocked Pilot Proposal",
|
|
248
|
+
client: "Ministry of Public Sector",
|
|
249
|
+
date: "2026-05-12",
|
|
250
|
+
version: "v1",
|
|
251
|
+
proposing_entity: "Mock Proposer",
|
|
252
|
+
principal_proposer: "Mock Proposer",
|
|
253
|
+
rfp_reference: null,
|
|
254
|
+
},
|
|
255
|
+
sections: {
|
|
256
|
+
executive_summary: "This is a mock executive summary that exists to satisfy the shape contract during testing. It exceeds the 100-character minimum length required by the schema.",
|
|
257
|
+
problem_statement: "The Ministry needs faster legal document triage. This is a mock problem statement padded to exceed the 100-character minimum length required by the schema for testing.",
|
|
258
|
+
technical_solution: "The mock proposed system reads the document queue, classifies items by risk, and surfaces urgent items. This is mock content that exists to satisfy the 200-character minimum length required by the shape contract for testing purposes.",
|
|
259
|
+
implementation_plan: "Phased over six months. Discovery, build, pilot, cutover. This is mock content padded to satisfy the 100-character minimum length.",
|
|
260
|
+
risks_and_mitigations: "Five risks named with mitigations. Mock content padded to satisfy the 100-character minimum length required by the shape contract.",
|
|
261
|
+
pricing_or_commercials: "Fixed-fee engagement; mock pricing details for testing purposes only.",
|
|
262
|
+
compliance_appendix: "Data residency, NDA, indemnity, past performance. Mock content for testing.",
|
|
263
|
+
},
|
|
264
|
+
requirements_addressed: [
|
|
265
|
+
{ requirement_id: "REQ-001", addressed_in_sections: ["executive_summary"], treatment: "addressed" },
|
|
266
|
+
],
|
|
267
|
+
draft_state: "draft_v1",
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/claude-code-local/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,KAAK,EAAc,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAsBjC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAEpC,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,IAAiB;IACjD,IAAI,OAAO,CAAC,GAAG,CAAC,0BAA0B,KAAK,GAAG,EAAE,CAAC;QACnD,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,QAAQ,CAAC;IAC5D,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,IAAI,CAAC;IAC/D,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC,cAAc,IAAI,uBAAuB,CAAC,GAAG,IAAI,CAAC;IA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AC;QACpF,uBAAuB,EAAE,oBAAoB;KAC9C,CAAC;IACF,OAAO;QACL,EAAE,EAAE,IAAI;QACR,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QACpC,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,EAAE,gBAAgB,EAAE,CAAC,EAAE;KACtC,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB;IAC7B,OAAO;QACL,KAAK,EAAE,+BAA+B;QACtC,eAAe,EAAE,OAAO;QACxB,QAAQ,EAAE;YACR,KAAK,EAAE,uBAAuB;YAC9B,MAAM,EAAE,2BAA2B;YACnC,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE,IAAI;YACb,gBAAgB,EAAE,eAAe;YACjC,kBAAkB,EAAE,eAAe;YACnC,aAAa,EAAE,IAAI;SACpB;QACD,QAAQ,EAAE;YACR,iBAAiB,EAAE,gKAAgK;YACnL,iBAAiB,EAAE,yKAAyK;YAC5L,kBAAkB,EAAE,2OAA2O;YAC/P,mBAAmB,EAAE,oIAAoI;YACzJ,qBAAqB,EAAE,oIAAoI;YAC3J,sBAAsB,EAAE,uEAAuE;YAC/F,mBAAmB,EAAE,6EAA6E;SACnG;QACD,sBAAsB,EAAE;YACtB,EAAE,cAAc,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC,mBAAmB,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE;SACpG;QACD,WAAW,EAAE,UAAU;KACxB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* seyola-runtime bundle — generate a Client Alpha distribution folder.
|
|
3
|
+
*
|
|
4
|
+
* The bundle is meant to be zipped/copied to a friendly tester. The tester
|
|
5
|
+
* unzips, runs setup.ps1 (or setup.sh), and gets a working workspace.
|
|
6
|
+
*
|
|
7
|
+
* What bundle does:
|
|
8
|
+
* 1. Validate the pack (refuse to bundle from a broken pack).
|
|
9
|
+
* 2. Create the output directory if missing.
|
|
10
|
+
* 3. Create empty member-owned folders if missing (preserve if exist).
|
|
11
|
+
* 4. Copy the pack into <out>/.seyola/pack/.
|
|
12
|
+
* 5. Drop a runtime-info note at <out>/.seyola/runtime/.
|
|
13
|
+
* 6. Write <out>/.seyola/version.json with bundle metadata.
|
|
14
|
+
* 7. Write setup.ps1 (Windows) and setup.sh (mac/linux).
|
|
15
|
+
* 8. Write README.md and GETTING-STARTED.md only if missing.
|
|
16
|
+
*
|
|
17
|
+
* What bundle does NOT do:
|
|
18
|
+
* - Run init. Init runs on the tester's machine, via setup script.
|
|
19
|
+
* - Touch .claude/ — init creates .claude/skills + .claude/settings.json
|
|
20
|
+
* using the TESTER's workspace path.
|
|
21
|
+
* - Bundle Node.js or seyola-runtime itself. Setup script checks them
|
|
22
|
+
* and fails loudly with install instructions if missing.
|
|
23
|
+
*
|
|
24
|
+
* Exposed skills (set when init runs on the tester's side):
|
|
25
|
+
* linkedin-writer, brand-voice, audience-profile-builder, story-bank-builder.
|
|
26
|
+
*/
|
|
27
|
+
export interface BundleInputs {
|
|
28
|
+
packPath: string;
|
|
29
|
+
outPath: string;
|
|
30
|
+
bundleName?: string;
|
|
31
|
+
/** Path to a built seyola-runtime checkout. If omitted, the bundle ships a
|
|
32
|
+
* placeholder note and the tester must install the runtime separately.
|
|
33
|
+
* When provided, the runtime's package.json + dist/ + package-lock.json are
|
|
34
|
+
* copied into <out>/.seyola/runtime/ and the setup script will install
|
|
35
|
+
* production deps from there with `npm install --omit=dev`. */
|
|
36
|
+
runtimePath?: string;
|
|
37
|
+
json?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface BundleResult {
|
|
40
|
+
exitCode: number;
|
|
41
|
+
status: "success" | "failed";
|
|
42
|
+
out_path: string;
|
|
43
|
+
pack_path: string;
|
|
44
|
+
pack_version: string;
|
|
45
|
+
runtime_version: string;
|
|
46
|
+
bundle_name: string;
|
|
47
|
+
files_written: string[];
|
|
48
|
+
runtime_bundled: boolean;
|
|
49
|
+
warnings: Array<{
|
|
50
|
+
code: string;
|
|
51
|
+
message: string;
|
|
52
|
+
}>;
|
|
53
|
+
errors: Array<{
|
|
54
|
+
code: string;
|
|
55
|
+
message: string;
|
|
56
|
+
}>;
|
|
57
|
+
duration_ms: number;
|
|
58
|
+
}
|
|
59
|
+
export declare function runBundle(args: BundleInputs): Promise<BundleResult>;
|
|
60
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundle/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAMH,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;oEAIgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnD,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjD,WAAW,EAAE,MAAM,CAAC;CACrB;AAMD,wBAAsB,SAAS,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAmKzE"}
|