@agents-ensemble/core 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acp/extract-acp-tool-name.d.ts +4 -0
- package/dist/acp/extract-acp-tool-name.d.ts.map +1 -0
- package/dist/acp/extract-acp-tool-name.js +29 -0
- package/dist/acp/extract-acp-tool-name.js.map +1 -0
- package/dist/acp/index.d.ts +16 -0
- package/dist/acp/index.d.ts.map +1 -0
- package/dist/acp/index.js +9 -0
- package/dist/acp/index.js.map +1 -0
- package/dist/acp/session-update-kinds.d.ts +9 -0
- package/dist/acp/session-update-kinds.d.ts.map +1 -0
- package/dist/acp/session-update-kinds.js +16 -0
- package/dist/acp/session-update-kinds.js.map +1 -0
- package/dist/acp/types.d.ts +3 -1
- package/dist/acp/types.d.ts.map +1 -1
- package/dist/acp/types.js.map +1 -1
- package/dist/conductor/conductor-session-driver.d.ts +2 -2
- package/dist/conductor/conductor-session-driver.d.ts.map +1 -1
- package/dist/conductor/conductor-session-driver.js +2 -2
- package/dist/conductor/conductor-session-driver.js.map +1 -1
- package/dist/conductor/conductor-session.d.ts +2 -2
- package/dist/conductor/conductor-session.d.ts.map +1 -1
- package/dist/conductor/conductor-session.js +39 -4
- package/dist/conductor/conductor-session.js.map +1 -1
- package/dist/conductor/index.d.ts +33 -0
- package/dist/conductor/index.d.ts.map +1 -0
- package/dist/conductor/index.js +19 -0
- package/dist/conductor/index.js.map +1 -0
- package/dist/conductor/session/dispatch-mode.d.ts +16 -0
- package/dist/conductor/session/dispatch-mode.d.ts.map +1 -0
- package/dist/conductor/session/dispatch-mode.js +17 -0
- package/dist/conductor/session/dispatch-mode.js.map +1 -0
- package/dist/conductor/session/events/index.d.ts +9 -0
- package/dist/conductor/session/events/index.d.ts.map +1 -0
- package/dist/conductor/session/events/index.js +2 -0
- package/dist/conductor/session/events/index.js.map +1 -0
- package/dist/conductor/session/events/session-event.d.ts +28 -0
- package/dist/conductor/session/events/session-event.d.ts.map +1 -0
- package/dist/conductor/session/events/session-event.js +2 -0
- package/dist/conductor/session/events/session-event.js.map +1 -0
- package/dist/conductor/session/events/session-log-event-groups.d.ts +12 -0
- package/dist/conductor/session/events/session-log-event-groups.d.ts.map +1 -0
- package/dist/conductor/session/events/session-log-event-groups.js +52 -0
- package/dist/conductor/session/events/session-log-event-groups.js.map +1 -0
- package/dist/conductor/session/events/session-log-event.d.ts +174 -0
- package/dist/conductor/session/events/session-log-event.d.ts.map +1 -0
- package/dist/conductor/session/events/session-log-event.js +2 -0
- package/dist/conductor/session/events/session-log-event.js.map +1 -0
- package/dist/conductor/session/events/shared/dispatch-fields.d.ts +6 -0
- package/dist/conductor/session/events/shared/dispatch-fields.d.ts.map +1 -0
- package/dist/conductor/session/events/shared/dispatch-fields.js +2 -0
- package/dist/conductor/session/events/shared/dispatch-fields.js.map +1 -0
- package/dist/conductor/session/events/shared/permission-pending.d.ts +11 -0
- package/dist/conductor/session/events/shared/permission-pending.d.ts.map +1 -0
- package/dist/conductor/session/events/shared/permission-pending.js +2 -0
- package/dist/conductor/session/events/shared/permission-pending.js.map +1 -0
- package/dist/conductor/session/events/shared/worker-outcome.d.ts +11 -0
- package/dist/conductor/session/events/shared/worker-outcome.d.ts.map +1 -0
- package/dist/conductor/session/events/shared/worker-outcome.js +2 -0
- package/dist/conductor/session/events/shared/worker-outcome.js.map +1 -0
- package/dist/conductor/session/events/shared/worker-prompt-source.d.ts +3 -0
- package/dist/conductor/session/events/shared/worker-prompt-source.d.ts.map +1 -0
- package/dist/conductor/session/events/shared/worker-prompt-source.js +2 -0
- package/dist/conductor/session/events/shared/worker-prompt-source.js.map +1 -0
- package/dist/conductor/session/select-dispatch-batch.js +2 -2
- package/dist/conductor/session/select-dispatch-batch.js.map +1 -1
- package/dist/conductor/session/session-event-queue.d.ts.map +1 -1
- package/dist/conductor/session/session-event-queue.js +2 -3
- package/dist/conductor/session/session-event-queue.js.map +1 -1
- package/dist/conductor/session/session-event.d.ts +1 -27
- package/dist/conductor/session/session-event.d.ts.map +1 -1
- package/dist/conductor/session/session-event.js +1 -7
- package/dist/conductor/session/session-event.js.map +1 -1
- package/dist/conductor/session/session-logger.d.ts +5 -122
- package/dist/conductor/session/session-logger.d.ts.map +1 -1
- package/dist/conductor/session/session-logger.js +3 -0
- package/dist/conductor/session/session-logger.js.map +1 -1
- package/dist/conductor/session-policy.d.ts.map +1 -1
- package/dist/conductor/session-policy.js +0 -4
- package/dist/conductor/session-policy.js.map +1 -1
- package/dist/dispatch/attach-worker.d.ts +7 -2
- package/dist/dispatch/attach-worker.d.ts.map +1 -1
- package/dist/dispatch/attach-worker.js +4 -3
- package/dist/dispatch/attach-worker.js.map +1 -1
- package/dist/dispatch/index.d.ts +10 -0
- package/dist/dispatch/index.d.ts.map +1 -0
- package/dist/dispatch/index.js +6 -0
- package/dist/dispatch/index.js.map +1 -0
- package/dist/dispatch/session-usage-tool.d.ts.map +1 -1
- package/dist/dispatch/session-usage-tool.js +1 -16
- package/dist/dispatch/session-usage-tool.js.map +1 -1
- package/dist/dispatch/worker-acp-session.d.ts +2 -2
- package/dist/dispatch/worker-acp-session.d.ts.map +1 -1
- package/dist/dispatch/worker-dispatch.d.ts +9 -5
- package/dist/dispatch/worker-dispatch.d.ts.map +1 -1
- package/dist/dispatch/worker-dispatch.js.map +1 -1
- package/dist/dispatch/worker-status-tool.d.ts.map +1 -1
- package/dist/dispatch/worker-status-tool.js +3 -18
- package/dist/dispatch/worker-status-tool.js.map +1 -1
- package/dist/dispatch/yaml-tool-result.d.ts +10 -0
- package/dist/dispatch/yaml-tool-result.d.ts.map +1 -0
- package/dist/dispatch/yaml-tool-result.js +17 -0
- package/dist/dispatch/yaml-tool-result.js.map +1 -0
- package/dist/escalation/index.d.ts +22 -0
- package/dist/escalation/index.d.ts.map +1 -0
- package/dist/escalation/index.js +14 -0
- package/dist/escalation/index.js.map +1 -0
- package/dist/github/fetch-github-updates.d.ts +1 -1
- package/dist/github/fetch-github-updates.d.ts.map +1 -1
- package/dist/github/fetch-github-updates.js +68 -17
- package/dist/github/fetch-github-updates.js.map +1 -1
- package/dist/github/github-monitor-cursor.d.ts +1 -1
- package/dist/github/github-monitor-cursor.d.ts.map +1 -1
- package/dist/github/github-monitor-cursor.js +1 -1
- package/dist/github/github-monitor-cursor.js.map +1 -1
- package/dist/github/github-monitor.js +1 -1
- package/dist/github/github-monitor.js.map +1 -1
- package/dist/github/github-post-loop-resume.d.ts +9 -0
- package/dist/github/github-post-loop-resume.d.ts.map +1 -0
- package/dist/github/github-post-loop-resume.js +16 -0
- package/dist/github/github-post-loop-resume.js.map +1 -0
- package/dist/github/github-test-fixtures.d.ts +13 -0
- package/dist/github/github-test-fixtures.d.ts.map +1 -1
- package/dist/github/github-test-fixtures.js +17 -0
- package/dist/github/github-test-fixtures.js.map +1 -1
- package/dist/github/index.d.ts +12 -0
- package/dist/github/index.d.ts.map +1 -0
- package/dist/github/index.js +7 -0
- package/dist/github/index.js.map +1 -0
- package/dist/index.d.ts +16 -127
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -70
- package/dist/index.js.map +1 -1
- package/dist/permission/index.d.ts +19 -0
- package/dist/permission/index.d.ts.map +1 -0
- package/dist/permission/index.js +10 -0
- package/dist/permission/index.js.map +1 -0
- package/dist/profile/index.d.ts +4 -0
- package/dist/profile/index.d.ts.map +1 -0
- package/dist/profile/index.js +3 -0
- package/dist/profile/index.js.map +1 -0
- package/dist/profile/load-profile.d.ts +5 -5
- package/dist/profile/load-profile.d.ts.map +1 -1
- package/dist/profile/load-profile.js +19 -7
- package/dist/profile/load-profile.js.map +1 -1
- package/dist/profile/parse-prompt-module.d.ts +4 -0
- package/dist/profile/parse-prompt-module.d.ts.map +1 -0
- package/dist/profile/parse-prompt-module.js +56 -0
- package/dist/profile/parse-prompt-module.js.map +1 -0
- package/dist/profile/types.d.ts +14 -12
- package/dist/profile/types.d.ts.map +1 -1
- package/dist/profile/types.js +4 -4
- package/dist/profile/types.js.map +1 -1
- package/dist/profiles/default/conductor.prompt.yaml +29 -0
- package/dist/profiles/default/implementer.prompt.yaml +17 -0
- package/dist/profiles/default/profile.yaml +5 -5
- package/dist/profiles/default/reviewer.prompt.yaml +18 -0
- package/dist/prompt/build-worker-attach-prompt.d.ts +2 -1
- package/dist/prompt/build-worker-attach-prompt.d.ts.map +1 -1
- package/dist/prompt/build-worker-attach-prompt.js +1 -1
- package/dist/prompt/build-worker-attach-prompt.js.map +1 -1
- package/dist/prompt/build-worker-prompt.d.ts +3 -2
- package/dist/prompt/build-worker-prompt.d.ts.map +1 -1
- package/dist/prompt/build-worker-prompt.js +1 -1
- package/dist/prompt/build-worker-prompt.js.map +1 -1
- package/dist/prompt/compile-system-prompt.d.ts +4 -3
- package/dist/prompt/compile-system-prompt.d.ts.map +1 -1
- package/dist/prompt/compile-system-prompt.js +1 -1
- package/dist/prompt/compile-system-prompt.js.map +1 -1
- package/dist/prompt/index.d.ts +3 -0
- package/dist/prompt/index.d.ts.map +1 -0
- package/dist/prompt/index.js +2 -0
- package/dist/prompt/index.js.map +1 -0
- package/dist/prompt/modules/shared/profile-prompt-module.d.ts +3 -3
- package/dist/prompt/modules/shared/profile-prompt-module.d.ts.map +1 -1
- package/dist/prompt/modules/shared/profile-prompt-module.js +14 -12
- package/dist/prompt/modules/shared/profile-prompt-module.js.map +1 -1
- package/dist/runtime/index.d.ts +13 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +6 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/map-worker-lifecycle.d.ts +5 -0
- package/dist/runtime/map-worker-lifecycle.d.ts.map +1 -0
- package/dist/runtime/map-worker-lifecycle.js +17 -0
- package/dist/runtime/map-worker-lifecycle.js.map +1 -0
- package/dist/runtime/types.d.ts +19 -2
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/runtime/worker-display-state.d.ts +3 -0
- package/dist/runtime/worker-display-state.d.ts.map +1 -0
- package/dist/runtime/worker-display-state.js +2 -0
- package/dist/runtime/worker-display-state.js.map +1 -0
- package/dist/runtime/worker-lifecycle-state.d.ts +3 -0
- package/dist/runtime/worker-lifecycle-state.d.ts.map +1 -0
- package/dist/runtime/worker-lifecycle-state.js +2 -0
- package/dist/runtime/worker-lifecycle-state.js.map +1 -0
- package/dist/runtime/worker-runtime.d.ts +5 -1
- package/dist/runtime/worker-runtime.d.ts.map +1 -1
- package/dist/runtime/worker-runtime.js +30 -3
- package/dist/runtime/worker-runtime.js.map +1 -1
- package/dist/runtime/worker-session.d.ts +8 -2
- package/dist/runtime/worker-session.d.ts.map +1 -1
- package/dist/runtime/worker-session.js +11 -3
- package/dist/runtime/worker-session.js.map +1 -1
- package/dist/runtime/worker-status.d.ts +4 -3
- package/dist/runtime/worker-status.d.ts.map +1 -1
- package/dist/runtime/worker-status.js +0 -1
- package/dist/runtime/worker-status.js.map +1 -1
- package/dist/session/index.d.ts +3 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +2 -0
- package/dist/session/index.js.map +1 -0
- package/dist/session/session-sidecar.d.ts +2 -2
- package/dist/session/session-sidecar.d.ts.map +1 -1
- package/dist/session/session-sidecar.js.map +1 -1
- package/dist/testing/index.d.ts +7 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +4 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/usage/index.d.ts +5 -0
- package/dist/usage/index.d.ts.map +1 -0
- package/dist/usage/index.js +3 -0
- package/dist/usage/index.js.map +1 -0
- package/dist/workspace/index.d.ts +7 -0
- package/dist/workspace/index.d.ts.map +1 -0
- package/dist/workspace/index.js +5 -0
- package/dist/workspace/index.js.map +1 -0
- package/package.json +5 -1
- package/dist/profiles/default/conductor.md +0 -35
- package/dist/profiles/default/implementer.md +0 -17
- package/dist/profiles/default/reviewer.md +0 -18
package/dist/index.js
CHANGED
|
@@ -1,73 +1,17 @@
|
|
|
1
1
|
/** Shared orchestration types and logic for agents-ensemble. */
|
|
2
2
|
export const PACKAGE_NAME = '@agents-ensemble/core';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
export { attachWorker } from './dispatch/attach-worker.js';
|
|
18
|
-
export { runGh } from './github/run-gh.js';
|
|
19
|
-
export { fetchIssueContext, } from './github/issue-context.js';
|
|
20
|
-
export { formatIssueContextForPrompt, formatIssueContextYaml, } from './github/format-issue-context-prompt.js';
|
|
21
|
-
export { createGitHubMonitor, DEFAULT_GITHUB_MONITOR_DEBOUNCE_MS, DEFAULT_GITHUB_MONITOR_POLL_INTERVAL_MS, DEFAULT_GITHUB_MONITOR_ACTIVE_POLL_INTERVAL_MS, } from './github/github-monitor.js';
|
|
22
|
-
export { emptyGitHubMonitorCursor, isEmptyGitHubMonitorCursor, normalizeGitHubMonitorCursor, } from './github/github-monitor-cursor.js';
|
|
23
|
-
export { fetchGitHubUpdates } from './github/fetch-github-updates.js';
|
|
24
|
-
export { ConductorAgent } from './conductor/conductor-agent.js';
|
|
25
|
-
export { loadProfile, loadProfileFromFile, parseProfile, resolveProfilePath, resolveProfile, resolveProfileFilePath, resolveDefaultProfilePath, profileDirectoryPath, corePackageRoot, bundledProfilesRoot, bundledProfilePath, bundledDefaultProfilePath, PROFILES_DIR, PROFILE_FILE, DEFAULT_PROFILE_NAME, } from './profile/load-profile.js';
|
|
26
|
-
export { profileWorkersToSessionSpecs, resolveAgentSystemPrompt, normalizeProfileWorker, normalizeProfileWorkers, sessionStateFromProfile, } from './profile/types.js';
|
|
27
|
-
export { WorkerSession } from './runtime/worker-session.js';
|
|
28
|
-
export { runConductorSession } from './conductor/conductor-session.js';
|
|
29
|
-
export { ensureCursorSdkRipgrepPath, resolveBundledSdkRipgrepPath, } from './conductor/configure-cursor-sdk-env.js';
|
|
30
|
-
export { runIssueSession } from './conductor/issue-session.js';
|
|
31
|
-
export { submitOperatorInput } from './conductor/submit-operator-input.js';
|
|
32
|
-
export { isOperatorExitCommand } from './conductor/operator-exit.js';
|
|
33
|
-
export { createOperatorPostLoopGate, } from './conductor/operator-post-loop-gate.js';
|
|
34
|
-
export { canDispatchConductorSend, autonomousTurnsAfterConductorSend, autonomousTurnsAfterConductorBatch, shouldStopIssueLoop, resolveIssueLoopStopReason, resolveMaxTurns, isMaxTurnsLimited, operatorInputMaxTurns, DEFAULT_MAX_ISSUE_TURNS, } from './conductor/session-policy.js';
|
|
35
|
-
export { runConductorSessionDriver } from './conductor/conductor-session-driver.js';
|
|
36
|
-
export { createTestOperatorInputBinding } from './conductor/testing/test-operator-input-binding.js';
|
|
37
|
-
export { SessionEventQueue, } from './conductor/session/session-event-queue.js';
|
|
38
|
-
export { formatSessionEventForConductor, formatSessionEventsForConductor, } from './conductor/session/format-session-event.js';
|
|
39
|
-
export { dispatchBatchStateAfterSend, eventSourceKey, markContinuationConsumed, selectDispatchBatch, countWorkerOutcomesInBatch, } from './conductor/session/select-dispatch-batch.js';
|
|
40
|
-
export { SessionLogger, } from './conductor/session/session-logger.js';
|
|
41
|
-
export { CONDUCTOR_AUTH_HINT, formatConductorAuthRecoveryHint, getConductorAuthStatus, hasConductorAuth, isBareConductorSendAuthError, isConductorAuthError, isConductorSendAuthError, loginConductor, logoutConductor, resolveConductorApiKey, } from './conductor/conductor-auth.js';
|
|
42
|
-
export { CONDUCTOR_MODEL_ID_ENV, DEFAULT_CONDUCTOR_MODEL_ID, normalizeConductorModelId, resolveConductorModelId, } from './conductor/resolve-conductor-model-id.js';
|
|
43
|
-
export { listConductorModels } from './conductor/list-conductor-models.js';
|
|
44
|
-
export { PermissionBroker, allowOnce, deny, } from './permission/permission-broker.js';
|
|
45
|
-
export { evaluatePermissionPolicy, } from './permission/permission-policy.js';
|
|
46
|
-
export { parsePermissionRequest, } from './permission/permission-request.js';
|
|
47
|
-
export { PermissionPipeline } from './permission/permission-pipeline.js';
|
|
48
|
-
export { createPermissionDeadlockMonitor, DEFAULT_PERMISSION_DEADLOCK_POLL_MS, DEFAULT_PERMISSION_DEADLOCK_STALL_MS, formatPermissionDeadlockWarningMessage, isPermissionDeadlockRisk, } from './permission/permission-deadlock-monitor.js';
|
|
49
|
-
export { PendingPermissionRegistry, } from './permission/pending-permission.js';
|
|
50
|
-
export { createResolvePermissionTool } from './permission/resolve-permission-tool.js';
|
|
51
|
-
export { formatPendingPermissionSummaries } from './permission/format-pending-permissions.js';
|
|
52
|
-
export { extractPermissionOperationSummary, formatPermissionSummaryForOperator, } from './permission/format-permission-summary-for-operator.js';
|
|
53
|
-
export { SessionUsageTracker, resetSessionUsageRoundCounter, } from './usage/session-usage-tracker.js';
|
|
54
|
-
export { estimateTokenUsageFromText } from './usage/estimate-token-usage.js';
|
|
55
|
-
export { createSessionUsageTools } from './dispatch/session-usage-tool.js';
|
|
56
|
-
export { EscalationUnavailableError, } from './escalation/escalation-unavailable-error.js';
|
|
57
|
-
export { ESCALATION_RESPONSE_ENV, readEscalationEnvFallback, parseEnvInquiryResponse, resolveHumanInquiryFromEnv, escalationUnavailableMessage, createEnvFallbackHumanInquiryHandler, } from './escalation/resolve-human-inquiry.js';
|
|
58
|
-
export { permissionRequestToHumanInquiry } from './escalation/permission-inquiry.js';
|
|
59
|
-
export { createPermissionAskHandler } from './escalation/create-permission-ask-handler.js';
|
|
60
|
-
export { createAskHumanTool } from './escalation/ask-human-tool.js';
|
|
61
|
-
export { createAnswerOpenQuestionTool } from './escalation/answer-open-question-tool.js';
|
|
62
|
-
export { OpenQuestionRegistry, } from './escalation/open-question.js';
|
|
63
|
-
export { SESSION_SIDECAR_VERSION, assertSessionSidecarMatches, findLatestSessionSidecarForIssue, listSessionSidecars, loadSessionSidecar, requireSessionSidecarForResume, saveSessionSidecar, sessionSidecarDir, sessionSidecarPath, SessionSidecarNotFoundError, } from './session/session-sidecar.js';
|
|
64
|
-
export { formatOpenQuestionEnqueuedReport, formatOpenQuestionAnsweredReport, joinOperatorInput, } from './escalation/format-registry-update.js';
|
|
65
|
-
export { createOpenQuestionListTools } from './escalation/open-question-list-tools.js';
|
|
66
|
-
export { applyOperatorMessage } from './escalation/apply-operator-message.js';
|
|
67
|
-
export { recordOpenQuestionAnswer } from './escalation/record-open-question-answer.js';
|
|
68
|
-
export { openQuestionToEscalationRecord } from './escalation/open-question-to-escalation.js';
|
|
69
|
-
export { ensureMaxTurnsOpenQuestion, MAX_TURNS_OPEN_QUESTION_TEXT } from './escalation/enqueue-max-turns-question.js';
|
|
70
|
-
export { ConductorInbox } from './runtime/conductor-inbox.js';
|
|
71
|
-
export { startInboxProcessor } from './runtime/inbox-processor.js';
|
|
72
|
-
export { WorkerRuntime } from './runtime/worker-runtime.js';
|
|
3
|
+
export * from './acp/index.js';
|
|
4
|
+
export * from './workspace/index.js';
|
|
5
|
+
export * from './profile/index.js';
|
|
6
|
+
export * from './prompt/index.js';
|
|
7
|
+
export * from './dispatch/index.js';
|
|
8
|
+
export * from './github/index.js';
|
|
9
|
+
export * from './conductor/index.js';
|
|
10
|
+
export * from './permission/index.js';
|
|
11
|
+
export * from './usage/index.js';
|
|
12
|
+
export * from './escalation/index.js';
|
|
13
|
+
export * from './session/index.js';
|
|
14
|
+
export * from './runtime/index.js';
|
|
15
|
+
/** @deprecated Import from `@agents-ensemble/core/testing` instead. */
|
|
16
|
+
export { FakeAcpServer, startFakeAcpServer, createInProcessStreamPair, createTestOperatorInputBinding, } from './testing/index.js';
|
|
73
17
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAEhE,MAAM,CAAC,MAAM,YAAY,GAAG,uBAAuB,CAAC;AAEpD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAEhE,MAAM,CAAC,MAAM,YAAY,GAAG,uBAAuB,CAAC;AAEpD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AAEnC,uEAAuE;AACvE,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,yBAAyB,EACzB,8BAA8B,GAC/B,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { PermissionBroker, allowOnce, deny, } from './permission-broker.js';
|
|
2
|
+
export type { PermissionAskHandler, PermissionBrokerOptions, } from './permission-broker.js';
|
|
3
|
+
export { evaluatePermissionPolicy, } from './permission-policy.js';
|
|
4
|
+
export type { PermissionPolicyRules, PermissionVerdict, } from './permission-policy.js';
|
|
5
|
+
export { parsePermissionRequest, } from './permission-request.js';
|
|
6
|
+
export type { PermissionRequest } from './permission-request.js';
|
|
7
|
+
export { PermissionPipeline } from './permission-pipeline.js';
|
|
8
|
+
export type { PermissionPipelineOptions, PermissionPipelineOutcome, } from './permission-pipeline.js';
|
|
9
|
+
export { createPermissionDeadlockMonitor, DEFAULT_PERMISSION_DEADLOCK_POLL_MS, DEFAULT_PERMISSION_DEADLOCK_STALL_MS, formatPermissionDeadlockWarningMessage, isPermissionDeadlockRisk, } from './permission-deadlock-monitor.js';
|
|
10
|
+
export type { PermissionDeadlockActivitySnapshot, PermissionDeadlockMonitor, PermissionDeadlockMonitorOptions, } from './permission-deadlock-monitor.js';
|
|
11
|
+
export { PendingPermissionRegistry, } from './pending-permission.js';
|
|
12
|
+
export type { PendingPermission } from './pending-permission.js';
|
|
13
|
+
export { createResolvePermissionTool } from './resolve-permission-tool.js';
|
|
14
|
+
export type { ResolvePermissionToolOptions } from './resolve-permission-tool.js';
|
|
15
|
+
export { formatPendingPermissionSummaries } from './format-pending-permissions.js';
|
|
16
|
+
export { extractPermissionOperationSummary, formatPermissionSummaryForOperator, } from './format-permission-summary-for-operator.js';
|
|
17
|
+
export type { FormatPermissionSummaryForOperatorOptions } from './format-permission-summary-for-operator.js';
|
|
18
|
+
export type { PermissionOperationSummary } from './format-permission-summary-for-operator.js';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/permission/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,IAAI,GACL,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,YAAY,EACV,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,+BAA+B,EAC/B,mCAAmC,EACnC,oCAAoC,EACpC,sCAAsC,EACtC,wBAAwB,GACzB,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EACV,kCAAkC,EAClC,yBAAyB,EACzB,gCAAgC,GACjC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAC3E,YAAY,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EACL,iCAAiC,EACjC,kCAAkC,GACnC,MAAM,6CAA6C,CAAC;AACrD,YAAY,EAAE,yCAAyC,EAAE,MAAM,6CAA6C,CAAC;AAC7G,YAAY,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { PermissionBroker, allowOnce, deny, } from './permission-broker.js';
|
|
2
|
+
export { evaluatePermissionPolicy, } from './permission-policy.js';
|
|
3
|
+
export { parsePermissionRequest, } from './permission-request.js';
|
|
4
|
+
export { PermissionPipeline } from './permission-pipeline.js';
|
|
5
|
+
export { createPermissionDeadlockMonitor, DEFAULT_PERMISSION_DEADLOCK_POLL_MS, DEFAULT_PERMISSION_DEADLOCK_STALL_MS, formatPermissionDeadlockWarningMessage, isPermissionDeadlockRisk, } from './permission-deadlock-monitor.js';
|
|
6
|
+
export { PendingPermissionRegistry, } from './pending-permission.js';
|
|
7
|
+
export { createResolvePermissionTool } from './resolve-permission-tool.js';
|
|
8
|
+
export { formatPendingPermissionSummaries } from './format-pending-permissions.js';
|
|
9
|
+
export { extractPermissionOperationSummary, formatPermissionSummaryForOperator, } from './format-permission-summary-for-operator.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/permission/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,IAAI,GACL,MAAM,wBAAwB,CAAC;AAKhC,OAAO,EACL,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAKhC,OAAO,EACL,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAK9D,OAAO,EACL,+BAA+B,EAC/B,mCAAmC,EACnC,oCAAoC,EACpC,sCAAsC,EACtC,wBAAwB,GACzB,MAAM,kCAAkC,CAAC;AAM1C,OAAO,EACL,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAE3E,OAAO,EAAE,gCAAgC,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EACL,iCAAiC,EACjC,kCAAkC,GACnC,MAAM,6CAA6C,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
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';
|
|
3
|
+
export { profileWorkersToSessionSpecs, resolveAgentPromptModule, normalizeProfileWorker, normalizeProfileWorkers, sessionStateFromProfile, } from './types.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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,GACrB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,OAAO,EACP,eAAe,EACf,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +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';
|
|
2
|
+
export { profileWorkersToSessionSpecs, resolveAgentPromptModule, normalizeProfileWorker, normalizeProfileWorkers, sessionStateFromProfile, } from './types.js';
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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,GACrB,MAAM,mBAAmB,CAAC;AAW3B,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,YAAY,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Profile } from './types.js';
|
|
1
|
+
import type { Profile, ResolvedProfile } from './types.js';
|
|
2
2
|
export declare const PROFILES_DIR = "profiles";
|
|
3
3
|
export declare const PROFILE_FILE = "profile.yaml";
|
|
4
4
|
export declare const DEFAULT_PROFILE_NAME = "default";
|
|
5
5
|
export declare function parseProfile(source: unknown, label: string): Profile;
|
|
6
6
|
export declare function resolveProfileFilePath(profileDir: string, fileRef: string): string;
|
|
7
|
-
/** `file` / `
|
|
8
|
-
export declare function resolveProfile(profile: Profile, profileDir: string): Promise<
|
|
9
|
-
export declare function loadProfileFromFile(filePath: string): Promise<
|
|
7
|
+
/** `file` / `promptFile` を読み込み、インラインに解決する。 */
|
|
8
|
+
export declare function resolveProfile(profile: Profile, profileDir: string): Promise<ResolvedProfile>;
|
|
9
|
+
export declare function loadProfileFromFile(filePath: string): Promise<ResolvedProfile>;
|
|
10
10
|
/** `@agents-ensemble/core` パッケージルート(`src/profile` または `dist/profile` から算出)。 */
|
|
11
11
|
export declare function corePackageRoot(): string;
|
|
12
12
|
/**
|
|
@@ -29,7 +29,7 @@ export declare function loadProfile(options: {
|
|
|
29
29
|
profile?: string;
|
|
30
30
|
cwd?: string;
|
|
31
31
|
}): Promise<{
|
|
32
|
-
profile:
|
|
32
|
+
profile: ResolvedProfile;
|
|
33
33
|
profilePath: string;
|
|
34
34
|
}>;
|
|
35
35
|
//# sourceMappingURL=load-profile.d.ts.map
|
|
@@ -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":"AAMA,OAAO,KAAK,EAEV,OAAO,EAGP,eAAe,EAChB,MAAM,YAAY,CAAC;AAGpB,eAAO,MAAM,YAAY,aAAa,CAAC;AACvC,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAE9C,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAyCpE;AAED,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAKlF;AAiDD,8CAA8C;AAC9C,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,eAAe,CAAC,CAiB1B;AAED,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAKpF;AAED,+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,CAEvD;AAED,wBAAgB,yBAAyB,IAAI,MAAM,CAElD;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAcnE;AAED,iCAAiC;AACjC,wBAAgB,yBAAyB,IAAI,MAAM,CAElD;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,eAAe,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CAO7D"}
|
|
@@ -3,6 +3,7 @@ import { readFile } from 'node:fs/promises';
|
|
|
3
3
|
import { dirname, isAbsolute, join } from 'node:path';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import yaml from 'js-yaml';
|
|
6
|
+
import { parsePromptModuleFromYaml } from './parse-prompt-module.js';
|
|
6
7
|
import { normalizeProfileWorkers } from './types.js';
|
|
7
8
|
export const PROFILES_DIR = 'profiles';
|
|
8
9
|
export const PROFILE_FILE = 'profile.yaml';
|
|
@@ -18,8 +19,12 @@ export function parseProfile(source, label) {
|
|
|
18
19
|
if (!agent || typeof agent !== 'object') {
|
|
19
20
|
throw new Error(`Invalid profile agent "${name}" in ${label}`);
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
const legacy = agent;
|
|
23
|
+
if ('systemPrompt' in legacy || 'systemPromptFile' in legacy) {
|
|
24
|
+
throw new Error(`Invalid profile agent "${name}" in ${label}: systemPrompt / systemPromptFile are removed; use prompt / promptFile`);
|
|
25
|
+
}
|
|
26
|
+
if (agent.prompt && agent.promptFile) {
|
|
27
|
+
throw new Error(`Invalid profile agent "${name}" in ${label}: use either prompt or promptFile`);
|
|
23
28
|
}
|
|
24
29
|
}
|
|
25
30
|
for (const [index, material] of (profile.materials ?? []).entries()) {
|
|
@@ -43,11 +48,18 @@ async function readProfileFile(profileDir, fileRef) {
|
|
|
43
48
|
return readFile(path, 'utf8');
|
|
44
49
|
}
|
|
45
50
|
async function resolveAgent(name, agent, profileDir, label) {
|
|
46
|
-
if (!agent.
|
|
47
|
-
return {
|
|
51
|
+
if (!agent.prompt && !agent.promptFile) {
|
|
52
|
+
return {};
|
|
53
|
+
}
|
|
54
|
+
if (agent.promptFile) {
|
|
55
|
+
const raw = yaml.load(await readProfileFile(profileDir, agent.promptFile));
|
|
56
|
+
return {
|
|
57
|
+
prompt: parsePromptModuleFromYaml(raw, `${label} (${agent.promptFile})`),
|
|
58
|
+
};
|
|
48
59
|
}
|
|
49
|
-
|
|
50
|
-
|
|
60
|
+
return {
|
|
61
|
+
prompt: parsePromptModuleFromYaml(agent.prompt, `${label} (agents.${name}.prompt)`),
|
|
62
|
+
};
|
|
51
63
|
}
|
|
52
64
|
async function resolveMaterial(material, profileDir, label) {
|
|
53
65
|
const content = material.content ??
|
|
@@ -62,7 +74,7 @@ async function resolveMaterial(material, profileDir, label) {
|
|
|
62
74
|
content,
|
|
63
75
|
};
|
|
64
76
|
}
|
|
65
|
-
/** `file` / `
|
|
77
|
+
/** `file` / `promptFile` を読み込み、インラインに解決する。 */
|
|
66
78
|
export async function resolveProfile(profile, profileDir) {
|
|
67
79
|
const label = join(profileDir, PROFILE_FILE);
|
|
68
80
|
const agents = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-profile.js","sourceRoot":"","sources":["../../src/profile/load-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAI,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"load-profile.js","sourceRoot":"","sources":["../../src/profile/load-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAQrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;AACvC,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC;AAC3C,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAE9C,MAAM,UAAU,YAAY,CAAC,MAAe,EAAE,KAAa;IACzD,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,K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AAE,IAAI,EAAE,YAAY,CAAC,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAW,EAAE,GAAW;IACzD,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACpB,OAAO,GAAG,CAAC;IACb,CAAC;IACD,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACvE,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACxB,CAAC;IAED,MAAM,OAAO,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACxC,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACxB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,OAAO,oBAAoB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACxC,CAAC;AAED,iCAAiC;AACjC,MAAM,UAAU,yBAAyB;IACvC,OAAO,yBAAyB,EAAE,CAAC;AACrC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAGjC;IACC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACzC,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO;QACjC,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;QAC1C,CAAC,CAAC,yBAAyB,EAAE,CAAC;IAChC,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,WAAW,CAAC,CAAC;IACvD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PromptModule } from '@modular-prompt/core';
|
|
2
|
+
/** profile の modular-prompt YAML を静的 `PromptModule` に変換する(DynamicContent 不可)。 */
|
|
3
|
+
export declare function parsePromptModuleFromYaml(source: unknown, label: string): PromptModule;
|
|
4
|
+
//# sourceMappingURL=parse-prompt-module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-prompt-module.d.ts","sourceRoot":"","sources":["../../src/profile/parse-prompt-module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAqB,MAAM,sBAAsB,CAAC;AAqD5E,iFAAiF;AACjF,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,CA4BtF"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { STANDARD_SECTIONS } from '@modular-prompt/core';
|
|
2
|
+
const PROMPT_SECTION_NAMES = Object.keys(STANDARD_SECTIONS);
|
|
3
|
+
const SUBSECTION_TYPE = 'subsection';
|
|
4
|
+
function isSubSection(value) {
|
|
5
|
+
if (!value || typeof value !== 'object') {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
const subsection = value;
|
|
9
|
+
return (subsection.type === SUBSECTION_TYPE &&
|
|
10
|
+
typeof subsection.title === 'string' &&
|
|
11
|
+
Array.isArray(subsection.items));
|
|
12
|
+
}
|
|
13
|
+
function parseSectionItems(items, label, sectionName) {
|
|
14
|
+
return items.map((item, index) => {
|
|
15
|
+
if (typeof item === 'string') {
|
|
16
|
+
return item;
|
|
17
|
+
}
|
|
18
|
+
if (isSubSection(item)) {
|
|
19
|
+
const parsedItems = item.items.map((entry, entryIndex) => {
|
|
20
|
+
if (typeof entry !== 'string') {
|
|
21
|
+
throw new Error(`Invalid profile prompt in ${label}: ${sectionName}[${index}].items[${entryIndex}] must be a string`);
|
|
22
|
+
}
|
|
23
|
+
return entry;
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
type: SUBSECTION_TYPE,
|
|
27
|
+
title: item.title,
|
|
28
|
+
items: parsedItems,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
throw new Error(`Invalid profile prompt in ${label}: ${sectionName}[${index}] must be a string or subsection`);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/** profile の modular-prompt YAML を静的 `PromptModule` に変換する(DynamicContent 不可)。 */
|
|
35
|
+
export function parsePromptModuleFromYaml(source, label) {
|
|
36
|
+
if (!source || typeof source !== 'object' || Array.isArray(source)) {
|
|
37
|
+
throw new Error(`Invalid profile prompt in ${label}: expected YAML object`);
|
|
38
|
+
}
|
|
39
|
+
const raw = source;
|
|
40
|
+
const module = {};
|
|
41
|
+
for (const key of Object.keys(raw)) {
|
|
42
|
+
if (!PROMPT_SECTION_NAMES.includes(key)) {
|
|
43
|
+
throw new Error(`Invalid profile prompt in ${label}: unknown section "${key}"`);
|
|
44
|
+
}
|
|
45
|
+
const value = raw[key];
|
|
46
|
+
if (!Array.isArray(value)) {
|
|
47
|
+
throw new Error(`Invalid profile prompt in ${label}: section "${key}" must be an array`);
|
|
48
|
+
}
|
|
49
|
+
module[key] = parseSectionItems(value, label, key);
|
|
50
|
+
}
|
|
51
|
+
if (Object.keys(module).length === 0) {
|
|
52
|
+
throw new Error(`Invalid profile prompt in ${label}: prompt is empty`);
|
|
53
|
+
}
|
|
54
|
+
return module;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=parse-prompt-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-prompt-module.js","sourceRoot":"","sources":["../../src/profile/parse-prompt-module.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,oBAAoB,GAAG,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAEzD,CAAC;AAEF,MAAM,eAAe,GAAG,YAAY,CAAC;AAIrC,SAAS,YAAY,CAAC,KAAc;IAClC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC;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AAC,6BAA6B,KAAK,wBAAwB,CAAC,CAAC;IAC9E,CAAC;IAED,MAAM,GAAG,GAAG,MAAiC,CAAC;IAC9C,MAAM,MAAM,GAAyC,EAAE,CAAC;IAExD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACnC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,GAAqC,CAAC,EAAE,CAAC;YAC1E,MAAM,IAAI,KAAK,CACb,6BAA6B,KAAK,sBAAsB,GAAG,GAAG,CAC/D,CAAC;QACJ,CAAC;QACD,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CACb,6BAA6B,KAAK,cAAc,GAAG,oBAAoB,CACxE,CAAC;QACJ,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,GAAG,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IACrD,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CAAC,6BAA6B,KAAK,mBAAmB,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/profile/types.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import type { PromptModule } from '@modular-prompt/core';
|
|
2
|
+
/** kind ごとの agent 定義(modular-prompt 拡張)。`conductor` は暗黙起動の SDK agent、他は worker init prompt 用。 */
|
|
2
3
|
export interface AgentDefinition {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/** インライン modular-prompt YAML。`promptFile` と排他。 */
|
|
5
|
+
prompt?: Record<string, unknown>;
|
|
6
|
+
/** プロファイルディレクトリ基準の YAML ファイル。`prompt` と排他。 */
|
|
7
|
+
promptFile?: string;
|
|
6
8
|
}
|
|
7
9
|
/** プロファイル YAML の worker エントリ(文字列は name=kind のショートハンド)。 */
|
|
8
10
|
export type ProfileWorkerRef = string | ProfileWorkerRefObject;
|
|
@@ -42,17 +44,17 @@ export interface ResolvedProfileMaterial {
|
|
|
42
44
|
title: string;
|
|
43
45
|
content: string;
|
|
44
46
|
}
|
|
45
|
-
/** load 後: agent 定義の
|
|
47
|
+
/** load 後: agent 定義の prompt が解決済み。 */
|
|
46
48
|
export interface ResolvedAgentDefinition {
|
|
47
|
-
|
|
49
|
+
prompt?: PromptModule;
|
|
48
50
|
}
|
|
49
|
-
export interface ResolvedProfile extends Profile {
|
|
51
|
+
export interface ResolvedProfile extends Omit<Profile, 'agents'> {
|
|
50
52
|
agents?: Record<string, ResolvedAgentDefinition>;
|
|
51
53
|
}
|
|
52
54
|
export interface SessionWorkerSpec {
|
|
53
55
|
name: string;
|
|
54
56
|
kind: string;
|
|
55
|
-
|
|
57
|
+
prompt?: PromptModule;
|
|
56
58
|
}
|
|
57
59
|
/** compile 時に state へ載せる worker 構成と kind 一覧。 */
|
|
58
60
|
export interface EnsembleSessionState {
|
|
@@ -61,10 +63,10 @@ export interface EnsembleSessionState {
|
|
|
61
63
|
materials?: ResolvedProfileMaterial[];
|
|
62
64
|
}
|
|
63
65
|
export declare function resolvedProfileMaterials(materials?: ProfileMaterial[]): ResolvedProfileMaterial[] | undefined;
|
|
64
|
-
export declare function sessionStateFromProfile(profile: Pick<
|
|
66
|
+
export declare function sessionStateFromProfile(profile: Pick<ResolvedProfile, 'workers' | 'agents' | 'materials'>): EnsembleSessionState;
|
|
65
67
|
export declare function normalizeProfileWorker(entry: unknown, label: string, index: number): ProfileWorkerEntry;
|
|
66
68
|
export declare function normalizeProfileWorkers(workers: unknown[], label: string): ProfileWorkerEntry[];
|
|
67
|
-
export declare function profileWorkersToSessionSpecs(profile:
|
|
68
|
-
/** kind に対応する
|
|
69
|
-
export declare function
|
|
69
|
+
export declare function profileWorkersToSessionSpecs(profile: ResolvedProfile): SessionWorkerSpec[];
|
|
70
|
+
/** kind に対応する profile agent module。agents[kind] → agents.default → undefined。 */
|
|
71
|
+
export declare function resolveAgentPromptModule(kind: string, agents: Record<string, ResolvedAgentDefinition> | undefined): PromptModule | undefined;
|
|
70
72
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/profile/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/profile/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,iGAAiG;AACjG,MAAM,WAAW,eAAe;IAC9B,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,0DAA0D;AAC1D,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,sBAAsB,CAAC;AAE/D,MAAM,WAAW,sBAAsB;IACrC,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,0BAA0B;AAC1B,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACzC,yCAAyC;IACzC,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,kEAAkE;IAClE,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,CA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AAO,EAAE,OAAO,EAAE,EAClB,KAAK,EAAE,MAAM,GACZ,kBAAkB,EAAE,CAgBtB;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,eAAe,GAAG,iBAAiB,EAAE,CAM1F;AAED,iFAAiF;AACjF,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,GAAG,SAAS,GAC1D,YAAY,GAAG,SAAS,CAG1B"}
|
package/dist/profile/types.js
CHANGED
|
@@ -50,12 +50,12 @@ export function profileWorkersToSessionSpecs(profile) {
|
|
|
50
50
|
return profile.workers.map((worker) => ({
|
|
51
51
|
name: worker.name,
|
|
52
52
|
kind: worker.kind,
|
|
53
|
-
|
|
53
|
+
prompt: resolveAgentPromptModule(worker.kind, profile.agents),
|
|
54
54
|
}));
|
|
55
55
|
}
|
|
56
|
-
/** kind に対応する
|
|
57
|
-
export function
|
|
56
|
+
/** kind に対応する profile agent module。agents[kind] → agents.default → undefined。 */
|
|
57
|
+
export function resolveAgentPromptModule(kind, agents) {
|
|
58
58
|
const agent = agents?.[kind] ?? agents?.default;
|
|
59
|
-
return agent?.
|
|
59
|
+
return agent?.prompt;
|
|
60
60
|
}
|
|
61
61
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/profile/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/profile/types.ts"],"names":[],"mappings":"AA4EA,MAAM,UAAU,wBAAwB,CACtC,SAA6B;IAE7B,MAAM,QAAQ,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;QAC7D,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC;QACzC,IAAI,CAAC,OAAO;YAAE,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O,CAAC,MAAM,CAAC;KAC9D,CAAC,CAAC,CAAC;AACN,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,wBAAwB,CACtC,IAAY,EACZ,MAA2D;IAE3D,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,MAAM,EAAE,OAAO,CAAC;IAChD,OAAO,KAAK,EAAE,MAAM,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
persona:
|
|
2
|
+
- あなたは **conductor** です。セッション開始時に起動し、すでにいる worker を制御します。
|
|
3
|
+
instructions:
|
|
4
|
+
- type: subsection
|
|
5
|
+
title: 読み方
|
|
6
|
+
items:
|
|
7
|
+
- 同梱の `team.md`(標準動作モード)を読んでください。
|
|
8
|
+
- '**§3 conductor** — 指示として従う'
|
|
9
|
+
- その他の章 — 相手(implementer / reviewer)への期待として読む
|
|
10
|
+
- §1 全員の前提、§6 連携 — 全員共通のルール
|
|
11
|
+
- '`team.md` は手順書ではなく、役割の境界と連携の作法を決める。いま何をすべきかの正本は **Issue / PR** と、指示のあった **Skill**。'
|
|
12
|
+
- type: subsection
|
|
13
|
+
title: 起動時の立場
|
|
14
|
+
items:
|
|
15
|
+
- 実装・検証は行わず、Issue / PR を正本として worker を調整する
|
|
16
|
+
- implementer / reviewer との会話は簡潔に。worker への作業指示は `prompt_worker`、詳細な状態・報告の正本は Issue / PR
|
|
17
|
+
- implementer / reviewer はセッション開始時にすでにいる。追加起動はできない
|
|
18
|
+
- 自分で判断できないことは open question でオペレータの最終判断を仰ぐ
|
|
19
|
+
- type: subsection
|
|
20
|
+
title: prompt_worker(worker-and-reviewer)
|
|
21
|
+
items:
|
|
22
|
+
- '**implementer** へ: 対象 Issue、今回のゴール、スコープ、使う Skill 等'
|
|
23
|
+
- '**reviewer** へ: 対象 PR URL、レビュー観点、再レビューなら前回ブロッカー'
|
|
24
|
+
- '**スナップショットのみ**。`attachInFlight` や worker の idle / processing を **ポーリング・`Await` で待たない**。変化は harness の SessionEvent(`permission.pending` / `worker.completed` 等)で届く([ADR 0016](../../docs/adr/0016-bootstrap-permission-conductor-wait.md))'
|
|
25
|
+
- type: subsection
|
|
26
|
+
title: permission(init prompt 中も同様)
|
|
27
|
+
items:
|
|
28
|
+
- '`permission.pending` が届いたら **init prompt 未完了・worker が processing 中でも先に処理する**(`resolve_permission` または `ask_human`)'
|
|
29
|
+
- permission を放置したまま worker の idle を待たない
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
persona:
|
|
2
|
+
- あなたは **implementer** です。セッション開始時に起動し、conductor からの作業指示を待ちます。
|
|
3
|
+
instructions:
|
|
4
|
+
- type: subsection
|
|
5
|
+
title: 読み方
|
|
6
|
+
items:
|
|
7
|
+
- 同梱の `team.md`(標準動作モード)を読んでください。
|
|
8
|
+
- '**§4 implementer** — 指示として従う'
|
|
9
|
+
- その他の章 — 相手(conductor / reviewer)への期待として読む
|
|
10
|
+
- §1 全員の前提、§6 連携 — 全員共通のルール
|
|
11
|
+
- 手順の細部の正本は **Skill(指示があれば)と Issue / PR**。
|
|
12
|
+
- type: subsection
|
|
13
|
+
title: 起動時の立場
|
|
14
|
+
items:
|
|
15
|
+
- worktree を作成し、実装・テスト・ドキュメント・PR 作成を担う
|
|
16
|
+
- reviewer と直接会話しない。伝えることは Issue / PR に書く
|
|
17
|
+
- 気づき・違和感・未解決は解決できなくても Issue に残す
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# デフォルト動作モード: worker-and-reviewer
|
|
2
|
-
# conductor は SDK 経由で暗黙起動、worker は profile 定義どおりセッション開始時に
|
|
3
|
-
# 詳細は team.md(3者共通)。役割別の起動文書は agents.<kind>.
|
|
2
|
+
# conductor は SDK 経由で暗黙起動、worker は profile 定義どおりセッション開始時に startWorkers で attach する。
|
|
3
|
+
# 詳細は team.md(3者共通)。役割別の起動文書は agents.<kind>.prompt / promptFile。
|
|
4
4
|
|
|
5
5
|
agents:
|
|
6
6
|
conductor:
|
|
7
|
-
|
|
7
|
+
promptFile: conductor.prompt.yaml
|
|
8
8
|
implementer:
|
|
9
|
-
|
|
9
|
+
promptFile: implementer.prompt.yaml
|
|
10
10
|
reviewer:
|
|
11
|
-
|
|
11
|
+
promptFile: reviewer.prompt.yaml
|
|
12
12
|
|
|
13
13
|
workers:
|
|
14
14
|
- name: implementer
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
persona:
|
|
2
|
+
- あなたは **reviewer** です。セッション開始時に起動し、conductor からの検証指示を待ちます。PR ができるまでは待機してよい。
|
|
3
|
+
instructions:
|
|
4
|
+
- type: subsection
|
|
5
|
+
title: 読み方
|
|
6
|
+
items:
|
|
7
|
+
- 同梱の `team.md`(標準動作モード)を読んでください。
|
|
8
|
+
- '**§5 reviewer** — 指示として従う'
|
|
9
|
+
- その他の章 — 相手(conductor / implementer)への期待として読む
|
|
10
|
+
- §1 全員の前提、§6 連携 — 全員共通のルール
|
|
11
|
+
- '`team.md` 全文は conductor の materials にも載る。検証のたびに **Issue / PR から読み直す**(会話の記憶や前回の approve を前提にしない)。'
|
|
12
|
+
- type: subsection
|
|
13
|
+
title: 起動時の立場
|
|
14
|
+
items:
|
|
15
|
+
- '**コードは書かない。** 成果物は判定と根拠(PR コメント)'
|
|
16
|
+
- implementer が作成した worktree に入って独立検証する
|
|
17
|
+
- implementer と直接会話しない
|
|
18
|
+
- conductor から PR URL とレビュー観点の指示を受けてから動く
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PromptModule } from '@modular-prompt/core';
|
|
1
2
|
import type { EnsembleSessionState } from '../profile/types.js';
|
|
2
3
|
export interface WorkerAttachPromptOptions {
|
|
3
4
|
issueUrl: string;
|
|
@@ -5,7 +6,7 @@ export interface WorkerAttachPromptOptions {
|
|
|
5
6
|
worktreePath?: string;
|
|
6
7
|
worktreeInRepo?: boolean;
|
|
7
8
|
sessionState: EnsembleSessionState;
|
|
8
|
-
|
|
9
|
+
agentModule?: PromptModule;
|
|
9
10
|
}
|
|
10
11
|
/** attach 時の待機 prompt(役割・permission・team.md。実作業は sendWorkerMessage 側)。 */
|
|
11
12
|
export declare function buildWorkerAttachPrompt(options: WorkerAttachPromptOptions): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-worker-attach-prompt.d.ts","sourceRoot":"","sources":["../../src/prompt/build-worker-attach-prompt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-worker-attach-prompt.d.ts","sourceRoot":"","sources":["../../src/prompt/build-worker-attach-prompt.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAOhE,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,oBAAoB,CAAC;IACnC,WAAW,CAAC,EAAE,YAAY,CAAC;CAC5B;AAiBD,0EAA0E;AAC1E,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,yBAAyB,GACjC,MAAM,CAaR"}
|
|
@@ -19,7 +19,7 @@ const workerAttachModule = {
|
|
|
19
19
|
/** attach 時の待機 prompt(役割・permission・team.md。実作業は sendWorkerMessage 側)。 */
|
|
20
20
|
export function buildWorkerAttachPrompt(options) {
|
|
21
21
|
const profileModule = profilePromptModule({
|
|
22
|
-
|
|
22
|
+
agentModule: options.agentModule,
|
|
23
23
|
materials: options.sessionState.materials,
|
|
24
24
|
});
|
|
25
25
|
const module = merge(mergeWorkerSystemPrompt(profileModule), workerAttachModule);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-worker-attach-prompt.js","sourceRoot":"","sources":["../../src/prompt/build-worker-attach-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAItD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAWnE,MAAM,kBAAkB,GAAwC;IAC9D,YAAY,EAAE;QACZ,CAAC,GAAG,EAAE,EAAE,CACN,GAAG,CAAC,cAAc;YAChB,CAAC,CAAC,sEAAsE;YACxE,CAAC,CAAC,GAAG,CAAC,YAAY;gBAChB,CAAC,CAAC,gBAAgB,GAAG,CAAC,YAAY,EAAE;gBACpC,CAAC,CAAC,IAAI;QACZ,gDAAgD;QAChD,iGAAiG;QACjG,4DAA4D;QAC5D,+DAA+D;KAChE;CACF,CAAC;AAEF,0EAA0E;AAC1E,MAAM,UAAU,uBAAuB,CACrC,OAAkC;IAElC,MAAM,aAAa,GAAG,mBAAmB,CAAC;QACxC,
|
|
1
|
+
{"version":3,"file":"build-worker-attach-prompt.js","sourceRoot":"","sources":["../../src/prompt/build-worker-attach-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAItD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAWnE,MAAM,kBAAkB,GAAwC;IAC9D,YAAY,EAAE;QACZ,CAAC,GAAG,EAAE,EAAE,CACN,GAAG,CAAC,cAAc;YAChB,CAAC,CAAC,sEAAsE;YACxE,CAAC,CAAC,GAAG,CAAC,YAAY;gBAChB,CAAC,CAAC,gBAAgB,GAAG,CAAC,YAAY,EAAE;gBACpC,CAAC,CAAC,IAAI;QACZ,gDAAgD;QAChD,iGAAiG;QACjG,4DAA4D;QAC5D,+DAA+D;KAChE;CACF,CAAC;AAEF,0EAA0E;AAC1E,MAAM,UAAU,uBAAuB,CACrC,OAAkC;IAElC,MAAM,aAAa,GAAG,mBAAmB,CAAC;QACxC,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,SAAS;KAC1C,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,KAAK,CAAC,uBAAuB,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAC,CAAC;IACjF,OAAO,oBAAoB,CACzB,OAAO,CAAC,MAAM,EAAE;QACd,GAAG,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC;QACxE,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,cAAc,EAAE,OAAO,CAAC,cAAc;KACvC,CAAC,CACH,CAAC;AACJ,CAAC"}
|