@undefineds.co/linx 0.2.25 → 0.3.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/README.md +19 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/ai-command.js +154 -62
- package/dist/lib/ai-command.js.map +1 -1
- package/dist/lib/auto-mode/archive.js +1 -0
- package/dist/lib/auto-mode/archive.js.map +1 -1
- package/dist/lib/auto-mode/codex-composer.js +5 -1
- package/dist/lib/auto-mode/codex-composer.js.map +1 -1
- package/dist/lib/auto-mode/display.js +32 -4
- package/dist/lib/auto-mode/display.js.map +1 -1
- package/dist/lib/auto-mode/hooks/codex.js +15 -1
- package/dist/lib/auto-mode/hooks/codex.js.map +1 -1
- package/dist/lib/auto-mode/hooks/shared.js +31 -0
- package/dist/lib/auto-mode/hooks/shared.js.map +1 -1
- package/dist/lib/auto-mode/pod-ai.js +14 -7
- package/dist/lib/auto-mode/pod-ai.js.map +1 -1
- package/dist/lib/auto-mode/pod-persistence.js +64 -8
- package/dist/lib/auto-mode/pod-persistence.js.map +1 -1
- package/dist/lib/auto-mode/runner.js +107 -9
- package/dist/lib/auto-mode/runner.js.map +1 -1
- package/dist/lib/chat-api.js +4 -1
- package/dist/lib/chat-api.js.map +1 -1
- package/dist/lib/models.js +2 -2
- package/dist/lib/models.js.map +1 -1
- package/dist/lib/oidc-auth.js +5 -1
- package/dist/lib/oidc-auth.js.map +1 -1
- package/dist/lib/pi-adapter/runtime.js +105 -8
- package/dist/lib/pi-adapter/runtime.js.map +1 -1
- package/dist/lib/pi-adapter/session.js +2 -2
- package/dist/lib/pi-adapter/session.js.map +1 -1
- package/dist/lib/pi-adapter/stream.js +1 -0
- package/dist/lib/pi-adapter/stream.js.map +1 -1
- package/dist/lib/pod-data-session.js +22 -13
- package/dist/lib/pod-data-session.js.map +1 -1
- package/dist/lib/symphony/archive.js +169 -0
- package/dist/lib/symphony/archive.js.map +1 -0
- package/dist/lib/symphony-command.js +272 -0
- package/dist/lib/symphony-command.js.map +1 -0
- package/dist/skills/pod-storage/SKILL.md +83 -43
- package/package.json +10 -9
- package/vendor/agent-runtime/dist/auto-mode.d.ts +2 -0
- package/vendor/agent-runtime/dist/auto-mode.js +1 -0
- package/vendor/agent-runtime/dist/index.d.ts +1 -0
- package/vendor/agent-runtime/dist/index.js +1 -0
- package/vendor/agent-runtime/dist/symphony.d.ts +136 -0
- package/vendor/agent-runtime/dist/symphony.js +214 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symphony-command.js","sourceRoot":"","sources":["../../src/lib/symphony-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAInC,OAAO,EAAE,WAAW,EAAE,4BAA4B,EAAuB,MAAM,sBAAsB,CAAA;AACrG,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,eAAe,EACf,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,uBAAuB,CAAA;AAE9B,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,CAAU,CAAA;AA4BnE,MAAM,cAAc,GAAoB;IACtC,WAAW;IACX,oBAAoB,EAAE,4BAA4B;CACnD,CAAA;AAED,MAAM,UAAU,qBAAqB,CAAC,UAA2B,cAAc;IAC7E,OAAO;QACL,OAAO,EAAE,oBAAoB;QAC7B,QAAQ,EAAE,mDAAmD;QAC7D,OAAO,CAAC,OAAO;YACb,OAAO,wBAAwB,CAAC,OAAO,EAAE,OAAO,CAAC;iBAC9C,aAAa,CAAC,CAAC,EAAE,4DAA4D,CAAC,CAAA;QACnF,CAAC;QACD,OAAO;YACL,6BAA6B;QAC/B,CAAC;KACF,CAAA;AACH,CAAC;A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AM,MAAM,GAAG,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE;QACpC,GAAG;QACH,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC;KACpC,CAAC,CAAA;IACF,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,OAAO,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;AACzC,CAAC"}
|
|
@@ -1,60 +1,100 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pod-storage
|
|
3
|
-
description: Pod
|
|
3
|
+
description: Resolve durable Pod writes through shared descriptors, Consensus, pod_schema, and pod_storage instead of inventing paths or Turtle.
|
|
4
4
|
allowed-tools: Read, Write, Edit, Bash, Grep, Glob, pod_read, pod_write
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Pod
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
7
|
+
# Pod Storage
|
|
8
|
+
|
|
9
|
+
Use this skill when the user asks AI Secretary or another agent to save
|
|
10
|
+
credentials, configuration, grants, preferences, or other durable Pod-backed
|
|
11
|
+
data.
|
|
12
|
+
|
|
13
|
+
## Core Rule
|
|
14
|
+
|
|
15
|
+
Do not invent Pod paths, RDF predicates, subject templates, or Turtle.
|
|
16
|
+
|
|
17
|
+
Durable storage semantics belong to `@undefineds.co/models`:
|
|
18
|
+
|
|
19
|
+
- descriptors,
|
|
20
|
+
- resource base paths,
|
|
21
|
+
- subject templates,
|
|
22
|
+
- field predicates,
|
|
23
|
+
- validation,
|
|
24
|
+
- repository-backed commits.
|
|
25
|
+
|
|
26
|
+
## Workflow
|
|
27
|
+
|
|
28
|
+
1. Restate the storage request in structured fields when possible.
|
|
29
|
+
2. Use the injected `udfs` tool for schema lookup and semantic consensus.
|
|
30
|
+
LinX/linx-lite should provide runtime context for remote Consensus; without
|
|
31
|
+
that context, `udfs` can still run local deterministic schema commands.
|
|
32
|
+
3. For direct schema lookup, call `udfs schema classes`,
|
|
33
|
+
`udfs schema predicates`, or `udfs schema describe`.
|
|
34
|
+
4. For ambiguous natural-language storage requests, call `udfs consensus` with a
|
|
35
|
+
JSON input payload.
|
|
36
|
+
The future service-backed path should use the Responses protocol
|
|
37
|
+
(`/v1/conversations` + `/v1/responses`).
|
|
38
|
+
5. Ask the user any returned clarification questions.
|
|
39
|
+
6. Continue the same Responses conversation through the `conversation_id`
|
|
40
|
+
request field.
|
|
41
|
+
7. Build a domain-shaped DTO from the returned `schemaUri` and field mapping.
|
|
42
|
+
8. Optionally call `udfs storage validate --input <json>` before committing.
|
|
43
|
+
9. Persist through the shared models ORM/repository, not through hand-written
|
|
44
|
+
Turtle or a resource-specific `udfs` shortcut.
|
|
45
|
+
10. Report the schema URI, resource summary, and follow-up status.
|
|
46
|
+
|
|
47
|
+
## Current MVP Check
|
|
48
|
+
|
|
49
|
+
The local verification path is the injected `udfs` tool. Do not call back into
|
|
50
|
+
`linx`; `udfs` must also work when injected into non-LinX coding agents:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
udfs consensus --input '{"session_id":"sess_123","request":"我要保存这个 Cloudflare token","answers":{"token_type":"tunnel-token"}}' --json
|
|
54
|
+
udfs schema classes --uri 'https://vocab.xpod.dev/credential#Credential'
|
|
55
|
+
udfs schema predicates --uri 'https://vocab.xpod.dev/credential#Credential'
|
|
56
|
+
udfs schema predicates --uri 'https://vocab.xpod.dev/credential#Credential' --field apiKey
|
|
22
57
|
```
|
|
23
58
|
|
|
24
|
-
|
|
59
|
+
Inside LinX or another coding-agent shell, AI should use the injected `udfs`
|
|
60
|
+
tool:
|
|
25
61
|
|
|
62
|
+
```bash
|
|
63
|
+
udfs consensus --input '{"session_id":"sess_123","request":"我要保存这个 Cloudflare token","answers":{"token_type":"tunnel-token"}}' --json
|
|
64
|
+
udfs schema describe 'https://vocab.xpod.dev/credential#Credential'
|
|
65
|
+
udfs schema predicates --uri 'https://vocab.xpod.dev/credential#Credential'
|
|
66
|
+
udfs storage validate --input '{"schemaUri":"https://vocab.xpod.dev/credential#Credential","operation":"upsert","match":{"service":"infra","providerId":"cloudflare","secretType":"tunnel-token"},"set":{"label":"Cloudflare Tunnel Token","status":"active"}}'
|
|
26
67
|
```
|
|
27
|
-
pod_read /alice/settings/credentials.ttl
|
|
28
|
-
pod_write /alice/settings/credentials.ttl "content"
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
用 `pod_read` 读 Pod 文件,`pod_write` 写 Pod 文件。Content-Type 由扩展名自动推断(.ttl → text/turtle)。
|
|
32
68
|
|
|
33
|
-
|
|
69
|
+
Expected outcome:
|
|
34
70
|
|
|
35
|
-
|
|
71
|
+
- clarification question: API token or tunnel token,
|
|
72
|
+
- schema URI: `https://vocab.xpod.dev/credential#Credential`,
|
|
73
|
+
- predicate mapping includes `apiKey -> https://vocab.xpod.dev/credential#apiKey`,
|
|
74
|
+
- descriptor storage: `/settings/credentials.ttl#{id}`,
|
|
75
|
+
- validation plan: `/settings/credentials.ttl#infra-cloudflare-tunnel-token`,
|
|
76
|
+
- no commit in `udfs`; actual writes go through shared ORM/repository code.
|
|
77
|
+
- remote Consensus, when available, is reached through injected
|
|
78
|
+
`UDFS_CONSENSUS_BASE_URL` and `UDFS_CONSENSUS_TOKEN`; do not ask the user for a
|
|
79
|
+
command-line API key.
|
|
36
80
|
|
|
37
|
-
|
|
38
|
-
@prefix xpod: <https://undefineds.co/xpod#> .
|
|
81
|
+
## Secretary Rules
|
|
39
82
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
83
|
+
- Never store secrets in free-form notes.
|
|
84
|
+
- Never log full secret values.
|
|
85
|
+
- Use validation before risky writes, but persist through model-owned
|
|
86
|
+
repositories/ORM.
|
|
87
|
+
- Treat unmodeled durable data as a model proposal flow, not a permanent
|
|
88
|
+
catch-all note.
|
|
89
|
+
- User/developer-created descriptors must be validated before activation.
|
|
47
90
|
|
|
48
|
-
##
|
|
91
|
+
## Low-Level Pod Tools
|
|
49
92
|
|
|
50
|
-
|
|
93
|
+
`pod_read` and `pod_write` are protocol tools, not modeling tools. Use them only
|
|
94
|
+
when:
|
|
51
95
|
|
|
52
|
-
|
|
96
|
+
- no shared business model exists yet,
|
|
97
|
+
- the operation is explicitly protocol-level,
|
|
98
|
+
- or you are inspecting raw Pod state for debugging.
|
|
53
99
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
```
|
|
57
|
-
/alice/logs/tasks/task-001/
|
|
58
|
-
├── stdout.log
|
|
59
|
-
└── result.json
|
|
60
|
-
```
|
|
100
|
+
If a shared model exists, use model-owned helpers instead of hand-editing Turtle.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@undefineds.co/linx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -12,16 +12,17 @@
|
|
|
12
12
|
"test": "yarn build && node --test --test-concurrency=1 test/**/*.test.mjs"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@
|
|
16
|
-
"@
|
|
17
|
-
"@
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
15
|
+
"@inrupt/solid-client-authn-node": "^4.0.0",
|
|
16
|
+
"@mariozechner/pi-coding-agent": "^0.73.1",
|
|
17
|
+
"@sinclair/typebox": "^0.34.49",
|
|
18
|
+
"@undefineds.co/models": "0.2.33",
|
|
19
|
+
"@zed-industries/codex-acp": "0.14.0",
|
|
20
|
+
"n3": "^2.0.3",
|
|
21
|
+
"yargs": "^18.0.0"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
|
-
"@types/node": "^
|
|
24
|
-
"typescript": "^
|
|
24
|
+
"@types/node": "^25.9.1",
|
|
25
|
+
"typescript": "^6.0.3"
|
|
25
26
|
},
|
|
26
27
|
"files": [
|
|
27
28
|
"dist",
|
|
@@ -33,6 +33,7 @@ export interface AutoModeSessionRecord {
|
|
|
33
33
|
runtime: AutoModeRuntime;
|
|
34
34
|
transport?: AutoModeTransport;
|
|
35
35
|
mode: AutoModeMode;
|
|
36
|
+
goalMode?: boolean;
|
|
36
37
|
cwd: string;
|
|
37
38
|
model?: string;
|
|
38
39
|
prompt?: string;
|
|
@@ -192,6 +193,7 @@ export interface AutoModeThreadMetadata extends Record<string, unknown> {
|
|
|
192
193
|
runtime: AutoModeRuntime;
|
|
193
194
|
transport?: AutoModeTransport;
|
|
194
195
|
mode: AutoModeMode;
|
|
196
|
+
goalMode?: boolean;
|
|
195
197
|
cwd: string;
|
|
196
198
|
model?: string;
|
|
197
199
|
credentialSource: AutoModeCredentialSource;
|
|
@@ -1380,6 +1380,7 @@ export function buildAutoModeThreadMetadata(record) {
|
|
|
1380
1380
|
runtime: record.runtime,
|
|
1381
1381
|
transport: record.transport,
|
|
1382
1382
|
mode: record.mode,
|
|
1383
|
+
...(record.goalMode !== undefined ? { goalMode: record.goalMode } : {}),
|
|
1383
1384
|
cwd: record.cwd,
|
|
1384
1385
|
model: record.model,
|
|
1385
1386
|
credentialSource: record.credentialSource,
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { AutoModeBackend, AutoModeMode } from './auto-mode.js';
|
|
2
|
+
export declare const SYMPHONY_HOME_DIRNAME = "symphony";
|
|
3
|
+
export declare const SYMPHONY_ISSUES_DIRNAME = "issues";
|
|
4
|
+
export declare const SYMPHONY_DELIVERIES_DIRNAME = "deliveries";
|
|
5
|
+
export declare const SYMPHONY_SESSIONS_DIRNAME = "sessions";
|
|
6
|
+
export declare const SYMPHONY_ISSUE_FILE_NAME = "issue.json";
|
|
7
|
+
export declare const SYMPHONY_DELIVERY_FILE_NAME = "delivery.json";
|
|
8
|
+
export declare const SYMPHONY_SESSION_FILE_NAME = "session.json";
|
|
9
|
+
export type SymphonyWorkspaceKind = 'git' | 'folder';
|
|
10
|
+
export type SymphonyIssueStatus = 'open' | 'triaging' | 'in_progress' | 'blocked' | 'resolved' | 'closed';
|
|
11
|
+
export type SymphonyDeliveryStatus = 'pending' | 'dispatched' | 'completed' | 'failed';
|
|
12
|
+
export type SymphonySessionStatus = 'planned' | 'running' | 'completed' | 'failed';
|
|
13
|
+
export type SymphonyProjectionRole = 'user' | 'system' | 'tool';
|
|
14
|
+
export type SymphonyResourceKind = 'issue' | 'task' | 'delivery' | 'session';
|
|
15
|
+
export interface SymphonyWorkspaceRef {
|
|
16
|
+
path: string;
|
|
17
|
+
kind: SymphonyWorkspaceKind;
|
|
18
|
+
repository?: string;
|
|
19
|
+
branch?: string;
|
|
20
|
+
worktree?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface SymphonyChatThreadRef {
|
|
23
|
+
chat?: string;
|
|
24
|
+
thread?: string;
|
|
25
|
+
messages?: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface SymphonyIssueRecord extends SymphonyChatThreadRef {
|
|
28
|
+
uri: string;
|
|
29
|
+
title: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
status: SymphonyIssueStatus;
|
|
32
|
+
priority: 'low' | 'medium' | 'high' | 'urgent';
|
|
33
|
+
source: 'cli';
|
|
34
|
+
tasks: string[];
|
|
35
|
+
createdAt: string;
|
|
36
|
+
updatedAt: string;
|
|
37
|
+
closedAt?: string;
|
|
38
|
+
error?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface SymphonyDeliveryRecord extends SymphonyChatThreadRef {
|
|
41
|
+
uri: string;
|
|
42
|
+
issue: string;
|
|
43
|
+
task: string;
|
|
44
|
+
type: 'task_dispatch';
|
|
45
|
+
status: SymphonyDeliveryStatus;
|
|
46
|
+
sourceAgent: 'ai-secretary';
|
|
47
|
+
targetBackend: AutoModeBackend;
|
|
48
|
+
targetAgent: string;
|
|
49
|
+
projection: {
|
|
50
|
+
runtimeRole: SymphonyProjectionRole;
|
|
51
|
+
prompt: string;
|
|
52
|
+
};
|
|
53
|
+
session?: string;
|
|
54
|
+
autoModeSessionId?: string;
|
|
55
|
+
createdAt: string;
|
|
56
|
+
updatedAt: string;
|
|
57
|
+
completedAt?: string;
|
|
58
|
+
error?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface SymphonySessionRecord extends SymphonyChatThreadRef {
|
|
61
|
+
uri: string;
|
|
62
|
+
issue: string;
|
|
63
|
+
task: string;
|
|
64
|
+
delivery: string;
|
|
65
|
+
backend: AutoModeBackend;
|
|
66
|
+
mode: AutoModeMode;
|
|
67
|
+
status: SymphonySessionStatus;
|
|
68
|
+
cwd: string;
|
|
69
|
+
model?: string;
|
|
70
|
+
autoModeSessionId?: string;
|
|
71
|
+
dryRun?: boolean;
|
|
72
|
+
exitCode?: number | null;
|
|
73
|
+
createdAt: string;
|
|
74
|
+
updatedAt: string;
|
|
75
|
+
completedAt?: string;
|
|
76
|
+
error?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface SymphonyRunPlan {
|
|
79
|
+
issue: SymphonyIssueRecord;
|
|
80
|
+
task: string;
|
|
81
|
+
delivery: SymphonyDeliveryRecord;
|
|
82
|
+
session: SymphonySessionRecord;
|
|
83
|
+
}
|
|
84
|
+
export interface CreateSymphonyRunPlanInput {
|
|
85
|
+
objective: string;
|
|
86
|
+
title?: string;
|
|
87
|
+
acceptanceCriteria?: string[];
|
|
88
|
+
workspacePath: string;
|
|
89
|
+
workspaceKind?: SymphonyWorkspaceKind;
|
|
90
|
+
repository?: string;
|
|
91
|
+
branch?: string;
|
|
92
|
+
worktree?: string;
|
|
93
|
+
backend: AutoModeBackend;
|
|
94
|
+
mode: AutoModeMode;
|
|
95
|
+
model?: string;
|
|
96
|
+
chat?: string;
|
|
97
|
+
thread?: string;
|
|
98
|
+
messages?: string[];
|
|
99
|
+
now?: Date;
|
|
100
|
+
randomId?: string;
|
|
101
|
+
}
|
|
102
|
+
export declare function createSymphonyIssueUri(options?: {
|
|
103
|
+
now?: Date;
|
|
104
|
+
randomId?: string;
|
|
105
|
+
}): string;
|
|
106
|
+
export declare function createTaskUri(options?: {
|
|
107
|
+
now?: Date;
|
|
108
|
+
randomId?: string;
|
|
109
|
+
}): string;
|
|
110
|
+
export declare function createSymphonyDeliveryUri(options?: {
|
|
111
|
+
now?: Date;
|
|
112
|
+
randomId?: string;
|
|
113
|
+
}): string;
|
|
114
|
+
export declare function createSymphonySessionUri(options?: {
|
|
115
|
+
now?: Date;
|
|
116
|
+
randomId?: string;
|
|
117
|
+
}): string;
|
|
118
|
+
export declare function getSymphonyArchiveRelativePaths(uri: string, kind: 'issue' | 'delivery' | 'session'): {
|
|
119
|
+
dir: string;
|
|
120
|
+
file: string;
|
|
121
|
+
};
|
|
122
|
+
export declare function createRunPlan(input: CreateSymphonyRunPlanInput): SymphonyRunPlan;
|
|
123
|
+
export declare function renderSymphonyRuntimePrompt(input: {
|
|
124
|
+
issue?: SymphonyIssueRecord;
|
|
125
|
+
task: string;
|
|
126
|
+
objective: string;
|
|
127
|
+
acceptanceCriteria?: string[];
|
|
128
|
+
workspace: SymphonyWorkspaceRef;
|
|
129
|
+
backend: AutoModeBackend;
|
|
130
|
+
mode: AutoModeMode;
|
|
131
|
+
session: string;
|
|
132
|
+
}): string;
|
|
133
|
+
export declare function formatSymphonySessionSummary(session: SymphonySessionRecord): string;
|
|
134
|
+
export declare function formatSymphonyDeliverySummary(delivery: SymphonyDeliveryRecord): string;
|
|
135
|
+
export declare function formatSymphonyIssueSummary(issue: SymphonyIssueRecord): string;
|
|
136
|
+
export declare function getSymphonyArchiveKey(uri: string): string;
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
export const SYMPHONY_HOME_DIRNAME = 'symphony';
|
|
2
|
+
export const SYMPHONY_ISSUES_DIRNAME = 'issues';
|
|
3
|
+
export const SYMPHONY_DELIVERIES_DIRNAME = 'deliveries';
|
|
4
|
+
export const SYMPHONY_SESSIONS_DIRNAME = 'sessions';
|
|
5
|
+
export const SYMPHONY_ISSUE_FILE_NAME = 'issue.json';
|
|
6
|
+
export const SYMPHONY_DELIVERY_FILE_NAME = 'delivery.json';
|
|
7
|
+
export const SYMPHONY_SESSION_FILE_NAME = 'session.json';
|
|
8
|
+
const SYMPHONY_URI_PREFIX = 'urn:undefineds:linx';
|
|
9
|
+
export function createSymphonyIssueUri(options = {}) {
|
|
10
|
+
return createSymphonyResourceUri('issue', options);
|
|
11
|
+
}
|
|
12
|
+
export function createTaskUri(options = {}) {
|
|
13
|
+
return createSymphonyResourceUri('task', options);
|
|
14
|
+
}
|
|
15
|
+
export function createSymphonyDeliveryUri(options = {}) {
|
|
16
|
+
return createSymphonyResourceUri('delivery', options);
|
|
17
|
+
}
|
|
18
|
+
export function createSymphonySessionUri(options = {}) {
|
|
19
|
+
return createSymphonyResourceUri('session', options);
|
|
20
|
+
}
|
|
21
|
+
export function getSymphonyArchiveRelativePaths(uri, kind) {
|
|
22
|
+
const key = getSymphonyArchiveKey(uri);
|
|
23
|
+
const dirName = kind === 'issue'
|
|
24
|
+
? SYMPHONY_ISSUES_DIRNAME
|
|
25
|
+
: kind === 'delivery'
|
|
26
|
+
? SYMPHONY_DELIVERIES_DIRNAME
|
|
27
|
+
: SYMPHONY_SESSIONS_DIRNAME;
|
|
28
|
+
const fileName = kind === 'issue'
|
|
29
|
+
? SYMPHONY_ISSUE_FILE_NAME
|
|
30
|
+
: kind === 'delivery'
|
|
31
|
+
? SYMPHONY_DELIVERY_FILE_NAME
|
|
32
|
+
: SYMPHONY_SESSION_FILE_NAME;
|
|
33
|
+
return {
|
|
34
|
+
dir: `${dirName}/${key}`,
|
|
35
|
+
file: `${dirName}/${key}/${fileName}`,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export function createRunPlan(input) {
|
|
39
|
+
const now = input.now ?? new Date();
|
|
40
|
+
const timestamp = now.toISOString();
|
|
41
|
+
const randomId = normalizeSymphonyRandomId(input.randomId);
|
|
42
|
+
const uriOptions = { now, randomId };
|
|
43
|
+
const objective = normalizeRequiredText(input.objective, 'objective');
|
|
44
|
+
const title = normalizeOptionalText(input.title) ?? createSymphonyTitle(objective);
|
|
45
|
+
const acceptanceCriteria = normalizeSymphonyAcceptanceCriteria(input.acceptanceCriteria);
|
|
46
|
+
const chatThread = normalizeSymphonyChatThreadRef(input);
|
|
47
|
+
const workspace = {
|
|
48
|
+
path: normalizeRequiredText(input.workspacePath, 'workspacePath'),
|
|
49
|
+
kind: input.workspaceKind ?? 'folder',
|
|
50
|
+
...(normalizeOptionalText(input.repository) ? { repository: normalizeOptionalText(input.repository) } : {}),
|
|
51
|
+
...(normalizeOptionalText(input.branch) ? { branch: normalizeOptionalText(input.branch) } : {}),
|
|
52
|
+
...(normalizeOptionalText(input.worktree) ? { worktree: normalizeOptionalText(input.worktree) } : {}),
|
|
53
|
+
};
|
|
54
|
+
const issueUri = createSymphonyIssueUri(uriOptions);
|
|
55
|
+
const taskUri = createTaskUri(uriOptions);
|
|
56
|
+
const deliveryUri = createSymphonyDeliveryUri(uriOptions);
|
|
57
|
+
const sessionUri = createSymphonySessionUri(uriOptions);
|
|
58
|
+
const issue = {
|
|
59
|
+
uri: issueUri,
|
|
60
|
+
title,
|
|
61
|
+
description: objective,
|
|
62
|
+
status: 'open',
|
|
63
|
+
priority: 'medium',
|
|
64
|
+
source: 'cli',
|
|
65
|
+
tasks: [taskUri],
|
|
66
|
+
...chatThread,
|
|
67
|
+
createdAt: timestamp,
|
|
68
|
+
updatedAt: timestamp,
|
|
69
|
+
};
|
|
70
|
+
const session = {
|
|
71
|
+
uri: sessionUri,
|
|
72
|
+
issue: issueUri,
|
|
73
|
+
task: taskUri,
|
|
74
|
+
delivery: deliveryUri,
|
|
75
|
+
backend: input.backend,
|
|
76
|
+
mode: input.mode,
|
|
77
|
+
status: 'planned',
|
|
78
|
+
cwd: workspace.path,
|
|
79
|
+
...(normalizeOptionalText(input.model) ? { model: normalizeOptionalText(input.model) } : {}),
|
|
80
|
+
...chatThread,
|
|
81
|
+
createdAt: timestamp,
|
|
82
|
+
updatedAt: timestamp,
|
|
83
|
+
};
|
|
84
|
+
const delivery = {
|
|
85
|
+
uri: deliveryUri,
|
|
86
|
+
issue: issueUri,
|
|
87
|
+
task: taskUri,
|
|
88
|
+
type: 'task_dispatch',
|
|
89
|
+
status: 'pending',
|
|
90
|
+
sourceAgent: 'ai-secretary',
|
|
91
|
+
targetBackend: input.backend,
|
|
92
|
+
targetAgent: `${input.backend}-worker`,
|
|
93
|
+
projection: {
|
|
94
|
+
runtimeRole: 'user',
|
|
95
|
+
prompt: renderSymphonyRuntimePrompt({
|
|
96
|
+
issue,
|
|
97
|
+
task: taskUri,
|
|
98
|
+
objective,
|
|
99
|
+
acceptanceCriteria,
|
|
100
|
+
workspace,
|
|
101
|
+
backend: input.backend,
|
|
102
|
+
mode: input.mode,
|
|
103
|
+
session: sessionUri,
|
|
104
|
+
}),
|
|
105
|
+
},
|
|
106
|
+
session: sessionUri,
|
|
107
|
+
...chatThread,
|
|
108
|
+
createdAt: timestamp,
|
|
109
|
+
updatedAt: timestamp,
|
|
110
|
+
};
|
|
111
|
+
return { issue, task: taskUri, delivery, session };
|
|
112
|
+
}
|
|
113
|
+
export function renderSymphonyRuntimePrompt(input) {
|
|
114
|
+
const acceptanceCriteria = normalizeSymphonyAcceptanceCriteria(input.acceptanceCriteria);
|
|
115
|
+
const criteria = acceptanceCriteria.length > 0
|
|
116
|
+
? acceptanceCriteria.map((item, index) => `${index + 1}. ${item}`).join('\n')
|
|
117
|
+
: '1. Complete the objective and report concrete verification evidence.';
|
|
118
|
+
return [
|
|
119
|
+
'# LinX Symphony Task',
|
|
120
|
+
'',
|
|
121
|
+
...(input.issue ? [`Issue URI: ${input.issue.uri}`] : []),
|
|
122
|
+
`Task URI: ${input.task}`,
|
|
123
|
+
`Session URI: ${input.session}`,
|
|
124
|
+
`Backend: ${input.backend}`,
|
|
125
|
+
`Mode: ${input.mode}`,
|
|
126
|
+
`Workspace: ${input.workspace.path}`,
|
|
127
|
+
`Workspace kind: ${input.workspace.kind}`,
|
|
128
|
+
'',
|
|
129
|
+
'## Objective',
|
|
130
|
+
input.objective,
|
|
131
|
+
'',
|
|
132
|
+
'## Acceptance Criteria',
|
|
133
|
+
criteria,
|
|
134
|
+
'',
|
|
135
|
+
'## Execution Contract',
|
|
136
|
+
'- Start and maintain this as the active goal for the worker session until the acceptance criteria are met.',
|
|
137
|
+
'- Work only inside the workspace unless the task explicitly requires otherwise.',
|
|
138
|
+
'- Treat this prompt as a delegated task from the user via AI Secretary.',
|
|
139
|
+
'- Treat later Secretary messages in this session as Steer or follow-up Delivery updates, not as a replacement for the Goal.',
|
|
140
|
+
'- Preserve a concise report with changed files, commands run, and remaining risks.',
|
|
141
|
+
'- If blocked by missing credentials, destructive actions, or unclear scope, report the blocker instead of guessing.',
|
|
142
|
+
].join('\n');
|
|
143
|
+
}
|
|
144
|
+
export function formatSymphonySessionSummary(session) {
|
|
145
|
+
const linked = session.autoModeSessionId ? ` -> ${session.autoModeSessionId}` : '';
|
|
146
|
+
return `${formatSymphonyUri(session.uri)} ${session.status} ${session.backend}/${session.mode}${linked} (${session.cwd})`;
|
|
147
|
+
}
|
|
148
|
+
export function formatSymphonyDeliverySummary(delivery) {
|
|
149
|
+
return `${formatSymphonyUri(delivery.uri)} ${delivery.status} ${delivery.sourceAgent} -> ${delivery.targetBackend} (${formatSymphonyUri(delivery.issue)}/${formatSymphonyUri(delivery.task)})`;
|
|
150
|
+
}
|
|
151
|
+
export function formatSymphonyIssueSummary(issue) {
|
|
152
|
+
return `${formatSymphonyUri(issue.uri)} ${issue.status} ${issue.title} (${issue.tasks.length} task${issue.tasks.length === 1 ? '' : 's'})`;
|
|
153
|
+
}
|
|
154
|
+
export function getSymphonyArchiveKey(uri) {
|
|
155
|
+
const trimmed = uri.trim();
|
|
156
|
+
if (!trimmed) {
|
|
157
|
+
throw new Error('Missing Symphony resource URI');
|
|
158
|
+
}
|
|
159
|
+
const tail = trimmed.match(/[:/#]([^:/#]+)$/u)?.[1] ?? trimmed;
|
|
160
|
+
const key = decodeURIComponent(tail)
|
|
161
|
+
.replace(/[^a-zA-Z0-9._-]/gu, '-')
|
|
162
|
+
.replace(/-+/gu, '-')
|
|
163
|
+
.replace(/^-|-$/gu, '');
|
|
164
|
+
return key || Buffer.from(trimmed).toString('base64url');
|
|
165
|
+
}
|
|
166
|
+
function createSymphonyResourceUri(kind, options = {}) {
|
|
167
|
+
const key = `${kind}_${formatSymphonyTimestamp(options.now)}_${normalizeSymphonyRandomId(options.randomId)}`;
|
|
168
|
+
return `${SYMPHONY_URI_PREFIX}:${kind}:${key}`;
|
|
169
|
+
}
|
|
170
|
+
function formatSymphonyUri(uri) {
|
|
171
|
+
return getSymphonyArchiveKey(uri);
|
|
172
|
+
}
|
|
173
|
+
function createSymphonyTitle(objective) {
|
|
174
|
+
const compact = objective.replace(/\s+/gu, ' ').trim();
|
|
175
|
+
return compact.length > 80 ? `${compact.slice(0, 77)}...` : compact;
|
|
176
|
+
}
|
|
177
|
+
function normalizeSymphonyAcceptanceCriteria(criteria) {
|
|
178
|
+
return (criteria ?? [])
|
|
179
|
+
.flatMap((item) => item.split(/\r?\n/u))
|
|
180
|
+
.map((item) => item.trim())
|
|
181
|
+
.filter(Boolean);
|
|
182
|
+
}
|
|
183
|
+
function normalizeRequiredText(value, name) {
|
|
184
|
+
const normalized = normalizeOptionalText(value);
|
|
185
|
+
if (!normalized) {
|
|
186
|
+
throw new Error(`Missing Symphony ${name}`);
|
|
187
|
+
}
|
|
188
|
+
return normalized;
|
|
189
|
+
}
|
|
190
|
+
function normalizeOptionalText(value) {
|
|
191
|
+
const normalized = typeof value === 'string' ? value.trim() : '';
|
|
192
|
+
return normalized || undefined;
|
|
193
|
+
}
|
|
194
|
+
function normalizeSymphonyChatThreadRef(input) {
|
|
195
|
+
const chat = normalizeOptionalText(input.chat);
|
|
196
|
+
const thread = normalizeOptionalText(input.thread);
|
|
197
|
+
const messages = (input.messages ?? [])
|
|
198
|
+
.map((item) => normalizeOptionalText(item))
|
|
199
|
+
.filter((item) => Boolean(item));
|
|
200
|
+
return {
|
|
201
|
+
...(chat ? { chat } : {}),
|
|
202
|
+
...(thread ? { thread } : {}),
|
|
203
|
+
...(messages.length > 0 ? { messages } : {}),
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
function formatSymphonyTimestamp(now = new Date()) {
|
|
207
|
+
return now.toISOString().replace(/[:.]/gu, '-');
|
|
208
|
+
}
|
|
209
|
+
function normalizeSymphonyRandomId(randomId) {
|
|
210
|
+
const normalized = typeof randomId === 'string'
|
|
211
|
+
? randomId.replace(/[^a-zA-Z0-9_-]/gu, '').slice(0, 12)
|
|
212
|
+
: '';
|
|
213
|
+
return normalized || Math.random().toString(36).slice(2, 10);
|
|
214
|
+
}
|