aos-harness 0.1.1 → 0.1.3
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/package.json +2 -2
- package/src/commands/list.ts +1 -1
- package/src/commands/run.ts +2 -2
- package/src/commands/validate.ts +5 -5
- package/src/utils.ts +20 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aos-harness",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Agentic Orchestration System — assemble AI agents into deliberation and execution teams",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"test": "bun run src/index.ts validate"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@aos-harness/runtime": "0.1.
|
|
38
|
+
"@aos-harness/runtime": "0.1.3",
|
|
39
39
|
"js-yaml": "^4.1.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
package/src/commands/list.ts
CHANGED
|
@@ -27,7 +27,7 @@ export async function listCommand(args: ParsedArgs): Promise<void> {
|
|
|
27
27
|
const root = getHarnessRoot();
|
|
28
28
|
const coreDir = join(root, "core");
|
|
29
29
|
|
|
30
|
-
const { loadAgent, loadProfile, loadDomain, loadSkill } = await import("
|
|
30
|
+
const { loadAgent, loadProfile, loadDomain, loadSkill } = await import("@aos-harness/runtime/config-loader");
|
|
31
31
|
|
|
32
32
|
// ── Agents ────────────────────────────────────────────────────
|
|
33
33
|
|
package/src/commands/run.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { existsSync, readdirSync, mkdirSync } from "node:fs";
|
|
|
6
6
|
import { join, resolve, basename } from "node:path";
|
|
7
7
|
import { c, type ParsedArgs } from "../colors";
|
|
8
8
|
import { getHarnessRoot, discoverDirs, promptSelect } from "../utils";
|
|
9
|
-
import type { TranscriptEntry } from "
|
|
9
|
+
import type { TranscriptEntry } from "@aos-harness/runtime/types";
|
|
10
10
|
|
|
11
11
|
function createEventBuffer(platformUrl: string, sessionId: string) {
|
|
12
12
|
const buffer: TranscriptEntry[] = [];
|
|
@@ -163,7 +163,7 @@ export async function runCommand(args: ParsedArgs): Promise<void> {
|
|
|
163
163
|
: join(coreDir, "workflows");
|
|
164
164
|
|
|
165
165
|
// ── Validate brief against profile ───────────────────────────
|
|
166
|
-
const { loadProfile, loadWorkflow, validateBrief } = await import("
|
|
166
|
+
const { loadProfile, loadWorkflow, validateBrief } = await import("@aos-harness/runtime/config-loader");
|
|
167
167
|
const profile = loadProfile(profileDir);
|
|
168
168
|
const validation = validateBrief(briefPath, profile.input.required_sections);
|
|
169
169
|
|
package/src/commands/validate.ts
CHANGED
|
@@ -51,11 +51,11 @@ export async function validateCommand(args: ParsedArgs): Promise<void> {
|
|
|
51
51
|
const coreDir = join(root, "core");
|
|
52
52
|
|
|
53
53
|
// Import runtime modules
|
|
54
|
-
const { loadAgent, loadProfile, loadDomain, loadWorkflow, loadSkill, validateBrief } = await import("
|
|
55
|
-
const { applyDomain } = await import("
|
|
56
|
-
const { resolveTemplate } = await import("
|
|
57
|
-
const { ConstraintEngine } = await import("
|
|
58
|
-
const { DelegationRouter } = await import("
|
|
54
|
+
const { loadAgent, loadProfile, loadDomain, loadWorkflow, loadSkill, validateBrief } = await import("@aos-harness/runtime/config-loader");
|
|
55
|
+
const { applyDomain } = await import("@aos-harness/runtime/domain-merger");
|
|
56
|
+
const { resolveTemplate } = await import("@aos-harness/runtime/template-resolver");
|
|
57
|
+
const { ConstraintEngine } = await import("@aos-harness/runtime/constraint-engine");
|
|
58
|
+
const { DelegationRouter } = await import("@aos-harness/runtime/delegation-router");
|
|
59
59
|
|
|
60
60
|
const results: CheckResult[] = [];
|
|
61
61
|
|
package/src/utils.ts
CHANGED
|
@@ -8,10 +8,28 @@ import { existsSync, readdirSync } from "node:fs";
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Resolve the AOS harness root directory.
|
|
11
|
-
*
|
|
11
|
+
*
|
|
12
|
+
* Resolution order:
|
|
13
|
+
* 1. Walk up from cwd looking for a directory with core/agents/ (user's project)
|
|
14
|
+
* 2. Fall back to the package install location (monorepo dev or npm install)
|
|
15
|
+
*
|
|
16
|
+
* This ensures commands like `aos list` find the user's project configs
|
|
17
|
+
* after `aos init`, not the package's internal directory.
|
|
12
18
|
*/
|
|
13
19
|
export function getHarnessRoot(): string {
|
|
14
|
-
//
|
|
20
|
+
// 1. Walk up from cwd looking for a project with core/
|
|
21
|
+
let dir = process.cwd();
|
|
22
|
+
const fsRoot = resolve("/");
|
|
23
|
+
while (dir !== fsRoot) {
|
|
24
|
+
if (existsSync(join(dir, "core", "agents"))) {
|
|
25
|
+
return dir;
|
|
26
|
+
}
|
|
27
|
+
const parent = resolve(dir, "..");
|
|
28
|
+
if (parent === dir) break;
|
|
29
|
+
dir = parent;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// 2. Fall back to package location (monorepo: cli/ -> root)
|
|
15
33
|
return resolve(import.meta.dir, "../..");
|
|
16
34
|
}
|
|
17
35
|
|