@agents-ensemble/core 0.2.1 → 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/dist/conductor/conductor-agent.d.ts +2 -1
- package/dist/conductor/conductor-agent.d.ts.map +1 -1
- package/dist/conductor/conductor-agent.js +3 -0
- package/dist/conductor/conductor-agent.js.map +1 -1
- package/dist/conductor/conductor-session.d.ts.map +1 -1
- package/dist/conductor/conductor-session.js +80 -18
- package/dist/conductor/conductor-session.js.map +1 -1
- package/dist/conductor/session/events/index.d.ts +1 -1
- package/dist/conductor/session/events/index.d.ts.map +1 -1
- package/dist/conductor/session/events/index.js.map +1 -1
- package/dist/conductor/session/events/session-log-event-groups.d.ts +2 -2
- package/dist/conductor/session/events/session-log-event-groups.d.ts.map +1 -1
- package/dist/conductor/session/events/session-log-event-groups.js +2 -0
- package/dist/conductor/session/events/session-log-event-groups.js.map +1 -1
- package/dist/conductor/session/events/session-log-event.d.ts +10 -1
- package/dist/conductor/session/events/session-log-event.d.ts.map +1 -1
- package/dist/conductor/session/session-logger.d.ts.map +1 -1
- package/dist/conductor/session/session-logger.js +2 -0
- package/dist/conductor/session/session-logger.js.map +1 -1
- package/dist/dispatch/attach-worker.d.ts +2 -0
- package/dist/dispatch/attach-worker.d.ts.map +1 -1
- package/dist/dispatch/attach-worker.js +4 -0
- package/dist/dispatch/attach-worker.js.map +1 -1
- package/dist/dispatch/session-usage-tool.d.ts +2 -0
- package/dist/dispatch/session-usage-tool.d.ts.map +1 -1
- package/dist/dispatch/session-usage-tool.js +3 -1
- package/dist/dispatch/session-usage-tool.js.map +1 -1
- package/dist/dispatch/worker-acp-session.d.ts +8 -1
- package/dist/dispatch/worker-acp-session.d.ts.map +1 -1
- package/dist/dispatch/worker-acp-session.js +15 -4
- package/dist/dispatch/worker-acp-session.js.map +1 -1
- package/dist/profile/index.d.ts +3 -2
- package/dist/profile/index.d.ts.map +1 -1
- package/dist/profile/index.js +1 -1
- package/dist/profile/index.js.map +1 -1
- package/dist/profile/load-profile.d.ts +18 -19
- package/dist/profile/load-profile.d.ts.map +1 -1
- package/dist/profile/load-profile.js +42 -51
- package/dist/profile/load-profile.js.map +1 -1
- package/dist/profile/profile-paths.d.ts +19 -0
- package/dist/profile/profile-paths.d.ts.map +1 -0
- package/dist/profile/profile-paths.js +39 -0
- package/dist/profile/profile-paths.js.map +1 -0
- package/dist/profile/resolve-worker-workspace.d.ts +12 -0
- package/dist/profile/resolve-worker-workspace.d.ts.map +1 -0
- package/dist/profile/resolve-worker-workspace.js +48 -0
- package/dist/profile/resolve-worker-workspace.js.map +1 -0
- package/dist/profile/team-profile-resolution.d.ts +39 -0
- package/dist/profile/team-profile-resolution.d.ts.map +1 -0
- package/dist/profile/team-profile-resolution.js +154 -0
- package/dist/profile/team-profile-resolution.js.map +1 -0
- package/dist/profile/types.d.ts +18 -0
- package/dist/profile/types.d.ts.map +1 -1
- package/dist/profile/types.js +11 -2
- package/dist/profile/types.js.map +1 -1
- package/dist/profiles/implementer-and-reviewer/conductor.prompt.yaml +18 -0
- package/dist/profiles/implementer-and-reviewer/implementer.prompt.yaml +15 -0
- package/dist/profiles/implementer-and-reviewer/reviewer.prompt.yaml +16 -0
- package/dist/prompt/build-worker-attach-prompt.d.ts +1 -0
- package/dist/prompt/build-worker-attach-prompt.d.ts.map +1 -1
- package/dist/prompt/build-worker-attach-prompt.js +6 -3
- package/dist/prompt/build-worker-attach-prompt.js.map +1 -1
- package/dist/prompt/contexts/kind.d.ts +1 -0
- package/dist/prompt/contexts/kind.d.ts.map +1 -1
- package/dist/prompt/contexts/kind.js.map +1 -1
- package/dist/prompt/modules/ensemble/conductor-base-module.js +6 -6
- package/dist/prompt/modules/ensemble/conductor-base-module.js.map +1 -1
- package/dist/prompt/modules/ensemble/worker-base-module.d.ts.map +1 -1
- package/dist/prompt/modules/ensemble/worker-base-module.js +3 -4
- package/dist/prompt/modules/ensemble/worker-base-module.js.map +1 -1
- package/dist/runtime/types.d.ts +2 -0
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/runtime/worker-runtime.d.ts +9 -1
- package/dist/runtime/worker-runtime.d.ts.map +1 -1
- package/dist/runtime/worker-runtime.js +37 -5
- package/dist/runtime/worker-runtime.js.map +1 -1
- package/dist/runtime/worker-session.d.ts +9 -3
- package/dist/runtime/worker-session.d.ts.map +1 -1
- package/dist/runtime/worker-session.js +9 -3
- package/dist/runtime/worker-session.js.map +1 -1
- package/dist/runtime/worker-status.d.ts +2 -0
- package/dist/runtime/worker-status.d.ts.map +1 -1
- package/dist/session/session-sidecar.d.ts +2 -0
- package/dist/session/session-sidecar.d.ts.map +1 -1
- package/dist/session/session-sidecar.js +4 -1
- package/dist/session/session-sidecar.js.map +1 -1
- package/dist/testing/mock-conductor-get-usage.d.ts +3 -0
- package/dist/testing/mock-conductor-get-usage.d.ts.map +1 -0
- package/dist/testing/mock-conductor-get-usage.js +15 -0
- package/dist/testing/mock-conductor-get-usage.js.map +1 -0
- package/dist/usage/enrich-session-usage-cost.d.ts +6 -0
- package/dist/usage/enrich-session-usage-cost.d.ts.map +1 -0
- package/dist/usage/enrich-session-usage-cost.js +17 -0
- package/dist/usage/enrich-session-usage-cost.js.map +1 -0
- package/dist/usage/types.d.ts +3 -0
- package/dist/usage/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/profiles/default/conductor.prompt.yaml +0 -29
- package/dist/profiles/default/implementer.prompt.yaml +0 -17
- package/dist/profiles/default/reviewer.prompt.yaml +0 -18
- /package/dist/profiles/{default → implementer-and-reviewer}/profile.yaml +0 -0
- /package/dist/profiles/{default → implementer-and-reviewer}/team.md +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-usage-tool.js","sourceRoot":"","sources":["../../src/dispatch/session-usage-tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"session-usage-tool.js","sourceRoot":"","sources":["../../src/dispatch/session-usage-tool.ts"],"names":[],"mappings":"AACA,OA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AAC;gBACD,OAAO,cAAc,CAAC,WAAW,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;YAC9D,CAAC;SACF;KACF,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAwB;IAChD,OAAO;QACL,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,IAAI;QAClC,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,IAAI;QACpC,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,IAAI;QAC5B,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,IAAI;QAC1B,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,IAAI;QAC9B,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,IAAI;QACpC,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,UAAU,EAAE,KAAK,CAAC,UAAU;KAC7B,CAAC;AACJ,CAAC"}
|
|
@@ -14,8 +14,13 @@ export interface ConnectWorkerAcpOptions {
|
|
|
14
14
|
export type ConnectWorkerAcpFn = (options: ConnectWorkerAcpOptions) => Promise<AcpBridge>;
|
|
15
15
|
export interface OpenWorkerAcpSessionOptions {
|
|
16
16
|
issueUrl: string;
|
|
17
|
-
/** Conductor が事前に resolve
|
|
17
|
+
/** Conductor が事前に resolve した作業ディレクトリ(Issue worktree)。 */
|
|
18
18
|
worktree: WorktreeRef;
|
|
19
|
+
/** ACP spawn / session cwd。未指定時は `worktree.path`。 */
|
|
20
|
+
acpCwd?: string;
|
|
21
|
+
workerName?: string;
|
|
22
|
+
/** resume 時に sidecar が記録した cwd。不一致なら attach 失敗。 */
|
|
23
|
+
expectedResumeAcpCwd?: string;
|
|
19
24
|
resumeAcpSessionId?: string;
|
|
20
25
|
bridge?: AcpBridge;
|
|
21
26
|
connectAcp?: ConnectWorkerAcpFn;
|
|
@@ -31,6 +36,8 @@ export interface WorkerAcpSession {
|
|
|
31
36
|
sessionId: string;
|
|
32
37
|
worktree: WorktreeRef;
|
|
33
38
|
issue: IssueRef;
|
|
39
|
+
/** 実際に ACP に渡した cwd(`session/new` / `session/load`)。 */
|
|
40
|
+
acpCwd: string;
|
|
34
41
|
}
|
|
35
42
|
export declare function openWorkerAcpSession(options: OpenWorkerAcpSessionOptions): Promise<WorkerAcpSession>;
|
|
36
43
|
export declare function runWorkerAcpPrompt(session: WorkerAcpSession, prompt: string, options?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-acp-session.d.ts","sourceRoot":"","sources":["../../src/dispatch/worker-acp-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"worker-acp-session.d.ts","sourceRoot":"","sources":["../../src/dispatch/worker-acp-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,wDAAwD;AACxD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,sBAAsB,GA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,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CACjC,GACA,OAAO,CAAC,YAAY,CAAC,CAEvB;AAED,+CAA+C;AAC/C,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAErE;AAED,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CAIf"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AcpBridge } from '../acp/acp-bridge.js';
|
|
2
|
+
import { assertWorkerWorkspaceDirectory } from '../profile/resolve-worker-workspace.js';
|
|
2
3
|
/** attach / dispatch 時に worker 名を spawn オプションへマージする。 */
|
|
3
4
|
export function mergeWorkerSpawn(spawn, workerName) {
|
|
4
5
|
return {
|
|
@@ -9,12 +10,21 @@ export function mergeWorkerSpawn(spawn, workerName) {
|
|
|
9
10
|
export async function openWorkerAcpSession(options) {
|
|
10
11
|
const worktree = options.worktree;
|
|
11
12
|
const issue = worktree.issue;
|
|
13
|
+
const acpCwd = options.acpCwd ?? worktree.path;
|
|
14
|
+
if (options.expectedResumeAcpCwd &&
|
|
15
|
+
options.expectedResumeAcpCwd !== acpCwd) {
|
|
16
|
+
const label = options.workerName ? `Worker "${options.workerName}"` : 'Worker';
|
|
17
|
+
throw new Error(`${label} resume cwd mismatch: sidecar has ${options.expectedResumeAcpCwd}, current profile resolves to ${acpCwd}`);
|
|
18
|
+
}
|
|
19
|
+
if (options.acpCwd !== undefined) {
|
|
20
|
+
assertWorkerWorkspaceDirectory(acpCwd, options.workerName);
|
|
21
|
+
}
|
|
12
22
|
let ownsBridge = false;
|
|
13
23
|
let bridge = options.bridge;
|
|
14
24
|
if (!bridge) {
|
|
15
25
|
if (options.connectAcp) {
|
|
16
26
|
bridge = await options.connectAcp({
|
|
17
|
-
cwd:
|
|
27
|
+
cwd: acpCwd,
|
|
18
28
|
spawn: options.spawn,
|
|
19
29
|
permissionHandler: options.permissionHandler,
|
|
20
30
|
});
|
|
@@ -22,7 +32,7 @@ export async function openWorkerAcpSession(options) {
|
|
|
22
32
|
}
|
|
23
33
|
else {
|
|
24
34
|
bridge = await AcpBridge.connect({
|
|
25
|
-
cwd:
|
|
35
|
+
cwd: acpCwd,
|
|
26
36
|
permissionHandler: options.permissionHandler,
|
|
27
37
|
...options.spawn,
|
|
28
38
|
});
|
|
@@ -32,14 +42,14 @@ export async function openWorkerAcpSession(options) {
|
|
|
32
42
|
let sessionId = options.resumeAcpSessionId;
|
|
33
43
|
if (sessionId) {
|
|
34
44
|
try {
|
|
35
|
-
await bridge.loadSession(sessionId,
|
|
45
|
+
await bridge.loadSession(sessionId, acpCwd, options.permissionHandler);
|
|
36
46
|
}
|
|
37
47
|
catch {
|
|
38
48
|
sessionId = undefined;
|
|
39
49
|
}
|
|
40
50
|
}
|
|
41
51
|
if (!sessionId) {
|
|
42
|
-
sessionId = await bridge.newSession(
|
|
52
|
+
sessionId = await bridge.newSession(acpCwd);
|
|
43
53
|
}
|
|
44
54
|
return {
|
|
45
55
|
bridge,
|
|
@@ -47,6 +57,7 @@ export async function openWorkerAcpSession(options) {
|
|
|
47
57
|
sessionId,
|
|
48
58
|
worktree,
|
|
49
59
|
issue,
|
|
60
|
+
acpCwd,
|
|
50
61
|
};
|
|
51
62
|
}
|
|
52
63
|
export async function runWorkerAcpPrompt(session, prompt, options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-acp-session.js","sourceRoot":"","sources":["../../src/dispatch/worker-acp-session.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"worker-acp-session.js","sourceRoot":"","sources":["../../src/dispatch/worker-acp-session.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAIjD,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AAG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@@
|
|
|
1
|
-
export { loadProfile, loadProfileFromFile, parseProfile, resolveProfilePath, resolveProfile, resolveProfileFilePath, resolveDefaultProfilePath, profileDirectoryPath, corePackageRoot, bundledProfilesRoot, bundledProfilePath, bundledDefaultProfilePath, PROFILES_DIR, PROFILE_FILE, DEFAULT_PROFILE_NAME, } from './load-profile.js';
|
|
2
|
-
export type { Profile, ProfileMaterial, ResolvedProfile, AgentDefinition, ProfileWorkerEntry, ProfileWorkerRef, SessionWorkerSpec, EnsembleSessionState, } from './types.js';
|
|
1
|
+
export { loadProfile, loadProfileFromFile, parseProfile, resolveProfileRef, resolveProfilePath, resolveProfile, resolveProfileFilePath, resolveDefaultProfilePath, ENSEMBLE_DEFAULT_PROFILE_ENV, profileDirectoryPath, corePackageRoot, bundledProfilesRoot, bundledProfilePath, bundledDefaultProfilePath, PROFILES_DIR, PROFILE_FILE, DEFAULT_PROFILE_NAME, DEFAULT_PROFILE_ALIAS, ENSEMBLE_DIR, TEAMS_DIR, teamProfileRoots, resolveTeamProfilePath, listTeamProfiles, normalizeTeamProfileName, teamProfileId, } from './load-profile.js';
|
|
2
|
+
export type { Profile, ProfileMaterial, ProfileMeta, ResolvedProfile, AgentDefinition, ProfileWorkerEntry, ProfileWorkerRef, SessionWorkerSpec, EnsembleSessionState, } from './types.js';
|
|
3
|
+
export type { TeamProfileSource, TeamProfileMeta, TeamProfileListEntry, TeamProfileRoot, TeamProfileResolutionOptions, } from './team-profile-resolution.js';
|
|
3
4
|
export { profileWorkersToSessionSpecs, resolveAgentPromptModule, normalizeProfileWorker, normalizeProfileWorkers, sessionStateFromProfile, } from './types.js';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/profile/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,yBAAyB,EACzB,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,yBAAyB,EACzB,YAAY,EACZ,YAAY,EACZ,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/profile/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,yBAAyB,EACzB,4BAA4B,EAC5B,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,yBAAyB,EACzB,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EACxB,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,OAAO,EACP,eAAe,EACf,WAAW,EACX,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,4BAA4B,GAC7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,YAAY,CAAC"}
|
package/dist/profile/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { loadProfile, loadProfileFromFile, parseProfile, resolveProfilePath, resolveProfile, resolveProfileFilePath, resolveDefaultProfilePath, profileDirectoryPath, corePackageRoot, bundledProfilesRoot, bundledProfilePath, bundledDefaultProfilePath, PROFILES_DIR, PROFILE_FILE, DEFAULT_PROFILE_NAME, } from './load-profile.js';
|
|
1
|
+
export { loadProfile, loadProfileFromFile, parseProfile, resolveProfileRef, resolveProfilePath, resolveProfile, resolveProfileFilePath, resolveDefaultProfilePath, ENSEMBLE_DEFAULT_PROFILE_ENV, profileDirectoryPath, corePackageRoot, bundledProfilesRoot, bundledProfilePath, bundledDefaultProfilePath, PROFILES_DIR, PROFILE_FILE, DEFAULT_PROFILE_NAME, DEFAULT_PROFILE_ALIAS, ENSEMBLE_DIR, TEAMS_DIR, teamProfileRoots, resolveTeamProfilePath, listTeamProfiles, normalizeTeamProfileName, teamProfileId, } from './load-profile.js';
|
|
2
2
|
export { profileWorkersToSessionSpecs, resolveAgentPromptModule, normalizeProfileWorker, normalizeProfileWorkers, sessionStateFromProfile, } from './types.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/profile/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,yBAAyB,EACzB,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,yBAAyB,EACzB,YAAY,EACZ,YAAY,EACZ,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/profile/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,yBAAyB,EACzB,4BAA4B,EAC5B,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,yBAAyB,EACzB,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EACxB,aAAa,GACd,MAAM,mBAAmB,CAAC;AAmB3B,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,YAAY,CAAC"}
|
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
import type { Profile, ResolvedProfile } from './types.js';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export declare const DEFAULT_PROFILE_NAME = "default";
|
|
2
|
+
export { bundledDefaultProfilePath, bundledProfilePath, bundledProfilesRoot, corePackageRoot, DEFAULT_PROFILE_ALIAS, DEFAULT_PROFILE_NAME, ENSEMBLE_DIR, PROFILE_FILE, profileDirectoryPath, PROFILES_DIR, TEAMS_DIR, } from './profile-paths.js';
|
|
3
|
+
export { teamProfileRoots, resolveTeamProfilePath, listTeamProfiles, normalizeTeamProfileName, teamProfileId, } from './team-profile-resolution.js';
|
|
5
4
|
export declare function parseProfile(source: unknown, label: string): Profile;
|
|
6
5
|
export declare function resolveProfileFilePath(profileDir: string, fileRef: string): string;
|
|
7
6
|
/** `file` / `promptFile` を読み込み、インラインに解決する。 */
|
|
8
|
-
export declare function resolveProfile(profile: Profile, profileDir: string): Promise<ResolvedProfile>;
|
|
9
|
-
export declare function loadProfileFromFile(filePath: string
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* 同梱プロファイルのルート。
|
|
14
|
-
* 正本はリポジトリ直下の `profiles/`。`build` で `dist/profiles/` にコピー済みなら dist を使う。
|
|
15
|
-
*/
|
|
16
|
-
export declare function bundledProfilesRoot(): string;
|
|
17
|
-
export declare function bundledProfilePath(name: string): string;
|
|
18
|
-
export declare function bundledDefaultProfilePath(): string;
|
|
19
|
-
export declare function profileDirectoryPath(cwd: string, name: string): string;
|
|
7
|
+
export declare function resolveProfile(profile: Profile, profileDir: string, repoRoot: string): Promise<ResolvedProfile>;
|
|
8
|
+
export declare function loadProfileFromFile(filePath: string, options?: {
|
|
9
|
+
repoRoot?: string;
|
|
10
|
+
}): Promise<ResolvedProfile>;
|
|
20
11
|
/**
|
|
21
12
|
* プロファイル参照をファイルパスに解決する。
|
|
22
|
-
* -
|
|
23
|
-
* - `profiles/foo/profile.yaml` や絶対パスは
|
|
13
|
+
* - 名前のみ → project `.ensemble/teams/` > user `~/.ensemble/teams/` > bundled > legacy
|
|
14
|
+
* - `profiles/foo/profile.yaml` や絶対パスは repoRoot 基準でそのまま
|
|
24
15
|
*/
|
|
25
|
-
export declare function resolveProfilePath(ref: string,
|
|
26
|
-
/**
|
|
16
|
+
export declare function resolveProfilePath(ref: string, repoRoot: string): string;
|
|
17
|
+
/** `--profile` 未指定時のデフォルト team profile(`--profile` と同じ解釈)。 */
|
|
18
|
+
export declare const ENSEMBLE_DEFAULT_PROFILE_ENV = "ENSEMBLE_DEFAULT_PROFILE";
|
|
19
|
+
/** CLI `--profile` > `ENSEMBLE_DEFAULT_PROFILE` > bundled default のうち、先に有効な参照を返す。 */
|
|
20
|
+
export declare function resolveProfileRef(options: {
|
|
21
|
+
profile?: string;
|
|
22
|
+
env?: NodeJS.ProcessEnv;
|
|
23
|
+
}): string | undefined;
|
|
24
|
+
/** `--profile` / env も未指定時は同梱 default。 */
|
|
27
25
|
export declare function resolveDefaultProfilePath(): string;
|
|
28
26
|
export declare function loadProfile(options: {
|
|
29
27
|
profile?: string;
|
|
30
28
|
cwd?: string;
|
|
29
|
+
env?: NodeJS.ProcessEnv;
|
|
31
30
|
}): Promise<{
|
|
32
31
|
profile: ResolvedProfile;
|
|
33
32
|
profilePath: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-profile.d.ts","sourceRoot":"","sources":["../../src/profile/load-profile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"load-profile.d.ts","sourceRoot":"","sources":["../../src/profile/load-profile.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,OAAO,EAGP,eAAe,EAChB,MAAM,YAAY,CAAC;AAYpB,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,qB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AAU,CAAC;CACzB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,eAAe,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CAW7D"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { existsSync } from 'node:fs';
|
|
2
1
|
import { readFile } from 'node:fs/promises';
|
|
3
2
|
import { dirname, isAbsolute, join } from 'node:path';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
3
|
import yaml from 'js-yaml';
|
|
6
4
|
import { parsePromptModuleFromYaml } from './parse-prompt-module.js';
|
|
5
|
+
import { resolveWorkerWorkspacePath } from './resolve-worker-workspace.js';
|
|
7
6
|
import { normalizeProfileWorkers } from './types.js';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
7
|
+
import { resolveTeamProfilePath } from './team-profile-resolution.js';
|
|
8
|
+
import { bundledDefaultProfilePath, PROFILE_FILE, } from './profile-paths.js';
|
|
9
|
+
export { bundledDefaultProfilePath, bundledProfilePath, bundledProfilesRoot, corePackageRoot, DEFAULT_PROFILE_ALIAS, DEFAULT_PROFILE_NAME, ENSEMBLE_DIR, PROFILE_FILE, profileDirectoryPath, PROFILES_DIR, TEAMS_DIR, } from './profile-paths.js';
|
|
10
|
+
export { teamProfileRoots, resolveTeamProfilePath, listTeamProfiles, normalizeTeamProfileName, teamProfileId, } from './team-profile-resolution.js';
|
|
11
11
|
export function parseProfile(source, label) {
|
|
12
12
|
if (!source || typeof source !== 'object' || !Array.isArray(source.workers)) {
|
|
13
13
|
throw new Error(`Invalid profile: ${label} (expected YAML with "workers" array)`);
|
|
@@ -74,78 +74,69 @@ async function resolveMaterial(material, profileDir, label) {
|
|
|
74
74
|
content,
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
+
function resolveProfileWorkers(workers, profileDir, repoRoot) {
|
|
78
|
+
return workers.map((worker) => ({
|
|
79
|
+
...worker,
|
|
80
|
+
...(worker.workspace
|
|
81
|
+
? {
|
|
82
|
+
resolvedWorkspacePath: resolveWorkerWorkspacePath(worker.workspace, profileDir, repoRoot),
|
|
83
|
+
}
|
|
84
|
+
: {}),
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
77
87
|
/** `file` / `promptFile` を読み込み、インラインに解決する。 */
|
|
78
|
-
export async function resolveProfile(profile, profileDir) {
|
|
88
|
+
export async function resolveProfile(profile, profileDir, repoRoot) {
|
|
79
89
|
const label = join(profileDir, PROFILE_FILE);
|
|
80
90
|
const agents = {};
|
|
81
91
|
for (const [name, agent] of Object.entries(profile.agents ?? {})) {
|
|
82
92
|
agents[name] = await resolveAgent(name, agent, profileDir, label);
|
|
83
93
|
}
|
|
84
94
|
return {
|
|
85
|
-
workers: profile.workers,
|
|
95
|
+
workers: resolveProfileWorkers(profile.workers, profileDir, repoRoot),
|
|
86
96
|
agents: Object.keys(agents).length > 0 ? agents : undefined,
|
|
87
97
|
materials: await Promise.all((profile.materials ?? []).map((material) => resolveMaterial(material, profileDir, label))),
|
|
88
98
|
};
|
|
89
99
|
}
|
|
90
|
-
export async function loadProfileFromFile(filePath) {
|
|
100
|
+
export async function loadProfileFromFile(filePath, options) {
|
|
101
|
+
const profileDir = dirname(filePath);
|
|
102
|
+
const repoRoot = options?.repoRoot ?? profileDir;
|
|
91
103
|
const raw = await readFile(filePath, 'utf8');
|
|
92
104
|
const parsed = yaml.load(raw);
|
|
93
105
|
const profile = parseProfile(parsed, filePath);
|
|
94
|
-
return resolveProfile(profile,
|
|
95
|
-
}
|
|
96
|
-
/** `@agents-ensemble/core` パッケージルート(`src/profile` または `dist/profile` から算出)。 */
|
|
97
|
-
export function corePackageRoot() {
|
|
98
|
-
return join(dirname(fileURLToPath(import.meta.url)), '../..');
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* 同梱プロファイルのルート。
|
|
102
|
-
* 正本はリポジトリ直下の `profiles/`。`build` で `dist/profiles/` にコピー済みなら dist を使う。
|
|
103
|
-
*/
|
|
104
|
-
export function bundledProfilesRoot() {
|
|
105
|
-
const packageRoot = corePackageRoot();
|
|
106
|
-
const distProfiles = join(packageRoot, 'dist/profiles');
|
|
107
|
-
if (existsSync(join(distProfiles, DEFAULT_PROFILE_NAME, PROFILE_FILE))) {
|
|
108
|
-
return distProfiles;
|
|
109
|
-
}
|
|
110
|
-
return join(packageRoot, '../../profiles');
|
|
111
|
-
}
|
|
112
|
-
export function bundledProfilePath(name) {
|
|
113
|
-
return join(bundledProfilesRoot(), name, PROFILE_FILE);
|
|
114
|
-
}
|
|
115
|
-
export function bundledDefaultProfilePath() {
|
|
116
|
-
return bundledProfilePath(DEFAULT_PROFILE_NAME);
|
|
117
|
-
}
|
|
118
|
-
export function profileDirectoryPath(cwd, name) {
|
|
119
|
-
return join(cwd, PROFILES_DIR, name, PROFILE_FILE);
|
|
106
|
+
return resolveProfile(profile, profileDir, repoRoot);
|
|
120
107
|
}
|
|
121
108
|
/**
|
|
122
109
|
* プロファイル参照をファイルパスに解決する。
|
|
123
|
-
* -
|
|
124
|
-
* - `profiles/foo/profile.yaml` や絶対パスは
|
|
110
|
+
* - 名前のみ → project `.ensemble/teams/` > user `~/.ensemble/teams/` > bundled > legacy
|
|
111
|
+
* - `profiles/foo/profile.yaml` や絶対パスは repoRoot 基準でそのまま
|
|
125
112
|
*/
|
|
126
|
-
export function resolveProfilePath(ref,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return bundled;
|
|
113
|
+
export function resolveProfilePath(ref, repoRoot) {
|
|
114
|
+
return resolveTeamProfilePath(ref, { repoRoot });
|
|
115
|
+
}
|
|
116
|
+
/** `--profile` 未指定時のデフォルト team profile(`--profile` と同じ解釈)。 */
|
|
117
|
+
export const ENSEMBLE_DEFAULT_PROFILE_ENV = 'ENSEMBLE_DEFAULT_PROFILE';
|
|
118
|
+
/** CLI `--profile` > `ENSEMBLE_DEFAULT_PROFILE` > bundled default のうち、先に有効な参照を返す。 */
|
|
119
|
+
export function resolveProfileRef(options) {
|
|
120
|
+
if (options.profile?.trim()) {
|
|
121
|
+
return options.profile.trim();
|
|
136
122
|
}
|
|
137
|
-
|
|
123
|
+
const fromEnv = options.env?.[ENSEMBLE_DEFAULT_PROFILE_ENV]?.trim();
|
|
124
|
+
return fromEnv || undefined;
|
|
138
125
|
}
|
|
139
|
-
/**
|
|
126
|
+
/** `--profile` / env も未指定時は同梱 default。 */
|
|
140
127
|
export function resolveDefaultProfilePath() {
|
|
141
128
|
return bundledDefaultProfilePath();
|
|
142
129
|
}
|
|
143
130
|
export async function loadProfile(options) {
|
|
144
131
|
const cwd = options.cwd ?? process.cwd();
|
|
145
|
-
const
|
|
146
|
-
|
|
132
|
+
const ref = resolveProfileRef({
|
|
133
|
+
profile: options.profile,
|
|
134
|
+
env: options.env ?? process.env,
|
|
135
|
+
});
|
|
136
|
+
const profilePath = ref
|
|
137
|
+
? resolveProfilePath(ref, cwd)
|
|
147
138
|
: resolveDefaultProfilePath();
|
|
148
|
-
const profile = await loadProfileFromFile(profilePath);
|
|
139
|
+
const profile = await loadProfileFromFile(profilePath, { repoRoot: cwd });
|
|
149
140
|
return { profile, profilePath };
|
|
150
141
|
}
|
|
151
142
|
//# sourceMappingURL=load-profile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-profile.js","sourceRoot":"","sources":["../../src/profile/load-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"load-profile.js","sourceRoot":"","sources":["../../src/profile/load-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAQrE,O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ACH,MAAM,WAAW,GAAG,GAAG;QACrB,CAAC,CAAC,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC;QAC9B,CAAC,CAAC,yBAAyB,EAAE,CAAC;IAChC,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC;IAC1E,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const PROFILES_DIR = "profiles";
|
|
2
|
+
export declare const PROFILE_FILE = "profile.yaml";
|
|
3
|
+
export declare const TEAMS_DIR = "teams";
|
|
4
|
+
export declare const ENSEMBLE_DIR = ".ensemble";
|
|
5
|
+
/** Canonical bundled default team profile name. */
|
|
6
|
+
export declare const DEFAULT_PROFILE_NAME = "implementer-and-reviewer";
|
|
7
|
+
/** CLI / API alias for {@link DEFAULT_PROFILE_NAME}. */
|
|
8
|
+
export declare const DEFAULT_PROFILE_ALIAS = "default";
|
|
9
|
+
/** `@agents-ensemble/core` パッケージルート(`src/profile` または `dist/profile` から算出)。 */
|
|
10
|
+
export declare function corePackageRoot(): string;
|
|
11
|
+
/**
|
|
12
|
+
* 同梱プロファイルのルート。
|
|
13
|
+
* 正本はリポジトリ直下の `profiles/`。`build` で `dist/profiles/` にコピー済みなら dist を使う。
|
|
14
|
+
*/
|
|
15
|
+
export declare function bundledProfilesRoot(): string;
|
|
16
|
+
export declare function bundledProfilePath(name: string): string;
|
|
17
|
+
export declare function bundledDefaultProfilePath(): string;
|
|
18
|
+
export declare function profileDirectoryPath(repoRoot: string, name: string): string;
|
|
19
|
+
//# sourceMappingURL=profile-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-paths.d.ts","sourceRoot":"","sources":["../../src/profile/profile-paths.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY,aAAa,CAAC;AACvC,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,SAAS,UAAU,CAAC;AACjC,eAAO,MAAM,YAAY,cAAc,CAAC;AACxC,mDAAmD;AACnD,eAAO,MAAM,oBAAoB,6BAA6B,CAAC;AAC/D,wDAAwD;AACxD,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAE/C,+EAA+E;AAC/E,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAO5C;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGvD;AAED,wBAAgB,yBAAyB,IAAI,MAAM,CAElD;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3E"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { dirname } from 'node:path';
|
|
5
|
+
export const PROFILES_DIR = 'profiles';
|
|
6
|
+
export const PROFILE_FILE = 'profile.yaml';
|
|
7
|
+
export const TEAMS_DIR = 'teams';
|
|
8
|
+
export const ENSEMBLE_DIR = '.ensemble';
|
|
9
|
+
/** Canonical bundled default team profile name. */
|
|
10
|
+
export const DEFAULT_PROFILE_NAME = 'implementer-and-reviewer';
|
|
11
|
+
/** CLI / API alias for {@link DEFAULT_PROFILE_NAME}. */
|
|
12
|
+
export const DEFAULT_PROFILE_ALIAS = 'default';
|
|
13
|
+
/** `@agents-ensemble/core` パッケージルート(`src/profile` または `dist/profile` から算出)。 */
|
|
14
|
+
export function corePackageRoot() {
|
|
15
|
+
return join(dirname(fileURLToPath(import.meta.url)), '../..');
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 同梱プロファイルのルート。
|
|
19
|
+
* 正本はリポジトリ直下の `profiles/`。`build` で `dist/profiles/` にコピー済みなら dist を使う。
|
|
20
|
+
*/
|
|
21
|
+
export function bundledProfilesRoot() {
|
|
22
|
+
const packageRoot = corePackageRoot();
|
|
23
|
+
const distProfiles = join(packageRoot, 'dist/profiles');
|
|
24
|
+
if (existsSync(join(distProfiles, DEFAULT_PROFILE_NAME, PROFILE_FILE))) {
|
|
25
|
+
return distProfiles;
|
|
26
|
+
}
|
|
27
|
+
return join(packageRoot, '../../profiles');
|
|
28
|
+
}
|
|
29
|
+
export function bundledProfilePath(name) {
|
|
30
|
+
const dirName = name === DEFAULT_PROFILE_ALIAS ? DEFAULT_PROFILE_NAME : name;
|
|
31
|
+
return join(bundledProfilesRoot(), dirName, PROFILE_FILE);
|
|
32
|
+
}
|
|
33
|
+
export function bundledDefaultProfilePath() {
|
|
34
|
+
return bundledProfilePath(DEFAULT_PROFILE_NAME);
|
|
35
|
+
}
|
|
36
|
+
export function profileDirectoryPath(repoRoot, name) {
|
|
37
|
+
return join(repoRoot, PROFILES_DIR, name, PROFILE_FILE);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=profile-paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-paths.js","sourceRoot":"","sources":["../../src/profile/profile-paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;AACvC,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC;AAC3C,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC;AACjC,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC;AACxC,mDAAmD;AACnD,MAAM,CAAC,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AAC/D,wDAAwD;AACxD,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAE/C,+EAA+E;AAC/E,MAAM,UAAU,eAAe;IAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AAChE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB;IACjC,MAAM,WAAW,GAAG,eAAe,EAAE,CAAC;IACtC,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;IACxD,IAAI,UAAU,CAAC,IAAI,CAAC,YAAY,EAAE,oBAAoB,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC;QACvE,OAAO,YAAY,CAAC;IACtB,CAAC;IACD,OAAO,IAAI,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,MAAM,OAAO,GAAG,IAAI,KAAK,qBAAqB,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7E,OAAO,IAAI,CAAC,mBAAmB,EAAE,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,UAAU,yBAAyB;IACvC,OAAO,kBAAkB,CAAC,oBAAoB,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,QAAgB,EAAE,IAAY;IACjE,OAAO,IAAI,CAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* profile の `workspace` を絶対パスへ解決する。
|
|
3
|
+
* - 絶対パスはそのまま
|
|
4
|
+
* - `./` / `../` で始まる相対パスは profile ディレクトリ基準
|
|
5
|
+
* - それ以外の相対パスは repo-root(`loadProfile` の cwd)基準
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolveWorkerWorkspacePath(workspace: string, profileDir: string, repoRoot: string): string;
|
|
8
|
+
/** worker ACP cwd が存在するディレクトリであることを検証する。 */
|
|
9
|
+
export declare function assertWorkerWorkspaceDirectory(path: string, workerName?: string): void;
|
|
10
|
+
/** harness 表示用に workspace パスを要約する(repo-root 相対を優先)。 */
|
|
11
|
+
export declare function summarizeWorkspacePath(path: string, repoRoot: string): string;
|
|
12
|
+
//# sourceMappingURL=resolve-worker-workspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-worker-workspace.d.ts","sourceRoot":"","sources":["../../src/profile/resolve-worker-workspace.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,MAAM,CAQR;AAED,4CAA4C;AAC5C,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,GAClB,IAAI,CAkBN;AAED,uDAAuD;AACvD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAW7E"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { statSync } from 'node:fs';
|
|
2
|
+
import { isAbsolute, resolve } from 'node:path';
|
|
3
|
+
/**
|
|
4
|
+
* profile の `workspace` を絶対パスへ解決する。
|
|
5
|
+
* - 絶対パスはそのまま
|
|
6
|
+
* - `./` / `../` で始まる相対パスは profile ディレクトリ基準
|
|
7
|
+
* - それ以外の相対パスは repo-root(`loadProfile` の cwd)基準
|
|
8
|
+
*/
|
|
9
|
+
export function resolveWorkerWorkspacePath(workspace, profileDir, repoRoot) {
|
|
10
|
+
if (isAbsolute(workspace)) {
|
|
11
|
+
return workspace;
|
|
12
|
+
}
|
|
13
|
+
if (workspace.startsWith('.')) {
|
|
14
|
+
return resolve(profileDir, workspace);
|
|
15
|
+
}
|
|
16
|
+
return resolve(repoRoot, workspace);
|
|
17
|
+
}
|
|
18
|
+
/** worker ACP cwd が存在するディレクトリであることを検証する。 */
|
|
19
|
+
export function assertWorkerWorkspaceDirectory(path, workerName) {
|
|
20
|
+
const label = workerName ? `Worker "${workerName}"` : 'Worker';
|
|
21
|
+
try {
|
|
22
|
+
const stat = statSync(path);
|
|
23
|
+
if (!stat.isDirectory()) {
|
|
24
|
+
throw new Error(`${label} workspace is not a directory: ${path}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
if (typeof error === 'object' &&
|
|
29
|
+
error !== null &&
|
|
30
|
+
'code' in error &&
|
|
31
|
+
error.code === 'ENOENT') {
|
|
32
|
+
throw new Error(`${label} workspace does not exist: ${path}`);
|
|
33
|
+
}
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/** harness 表示用に workspace パスを要約する(repo-root 相対を優先)。 */
|
|
38
|
+
export function summarizeWorkspacePath(path, repoRoot) {
|
|
39
|
+
const normalizedRoot = resolve(repoRoot);
|
|
40
|
+
const normalizedPath = resolve(path);
|
|
41
|
+
if (normalizedPath === normalizedRoot ||
|
|
42
|
+
normalizedPath.startsWith(`${normalizedRoot}/`)) {
|
|
43
|
+
const relative = normalizedPath.slice(normalizedRoot.length).replace(/^\//, '');
|
|
44
|
+
return relative || '.';
|
|
45
|
+
}
|
|
46
|
+
return normalizedPath;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=resolve-worker-workspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-worker-workspace.js","sourceRoot":"","sources":["../../src/profile/resolve-worker-workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,UA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AO,CAAC,IAAI,CAAC,CAAC;IACrC,IACE,cAAc,KAAK,cAAc;QACjC,cAAc,CAAC,UAAU,CAAC,GAAG,cAAc,GAAG,CAAC,EAC/C,CAAC;QACD,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAChF,OAAO,QAAQ,IAAI,GAAG,CAAC;IACzB,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type TeamProfileSource = 'project' | 'user' | 'bundled' | 'legacy';
|
|
2
|
+
export interface TeamProfileMeta {
|
|
3
|
+
id?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
summary?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TeamProfileListEntry {
|
|
8
|
+
/** Canonical identifier, e.g. `my-team@project`. */
|
|
9
|
+
id: string;
|
|
10
|
+
/** Short display name (directory name or canonical bundled name). */
|
|
11
|
+
name: string;
|
|
12
|
+
source: TeamProfileSource;
|
|
13
|
+
/** Absolute path to `profile.yaml`. */
|
|
14
|
+
path: string;
|
|
15
|
+
meta?: TeamProfileMeta;
|
|
16
|
+
/** Worker kind or name preview for catalog display. */
|
|
17
|
+
workersPreview: string[];
|
|
18
|
+
}
|
|
19
|
+
export interface TeamProfileRoot {
|
|
20
|
+
source: TeamProfileSource;
|
|
21
|
+
root: string;
|
|
22
|
+
}
|
|
23
|
+
export interface TeamProfileResolutionOptions {
|
|
24
|
+
repoRoot: string;
|
|
25
|
+
/** Override for tests. Defaults to `~/.ensemble`. */
|
|
26
|
+
userEnsembleRoot?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function normalizeTeamProfileName(name: string): string;
|
|
29
|
+
export declare function teamProfileId(name: string, source: TeamProfileSource): string;
|
|
30
|
+
/** Exploration roots in resolution priority order. */
|
|
31
|
+
export declare function teamProfileRoots(repoRoot: string, options?: Pick<TeamProfileResolutionOptions, 'userEnsembleRoot'>): TeamProfileRoot[];
|
|
32
|
+
/**
|
|
33
|
+
* Resolve a team profile reference to an absolute `profile.yaml` path.
|
|
34
|
+
* Name-only refs use priority: project > user > bundled > legacy.
|
|
35
|
+
*/
|
|
36
|
+
export declare function resolveTeamProfilePath(ref: string, options: TeamProfileResolutionOptions): string;
|
|
37
|
+
/** List team profiles from all layers with source distinction. */
|
|
38
|
+
export declare function listTeamProfiles(options: TeamProfileResolutionOptions): Promise<TeamProfileListEntry[]>;
|
|
39
|
+
//# sourceMappingURL=team-profile-resolution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team-profile-resolution.d.ts","sourceRoot":"","sources":["../../src/profile/team-profile-resolution.ts"],"names":[],"mappings":"AAkBA,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE1E,MAAM,WAAW,eAAe;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,EAAE,EAAE,MAAM,CAAC;IACX,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,iBAAiB,CAAC;IAC1B,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,uDAAuD;IACvD,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAkBD,wBAAgB,wBA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