@cat-factory/kernel 0.6.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/LICENSE +21 -0
- package/dist/domain/catalog.d.ts +36 -0
- package/dist/domain/catalog.d.ts.map +1 -0
- package/dist/domain/catalog.js +55 -0
- package/dist/domain/catalog.js.map +1 -0
- package/dist/domain/errors.d.ts +57 -0
- package/dist/domain/errors.d.ts.map +1 -0
- package/dist/domain/errors.js +60 -0
- package/dist/domain/errors.js.map +1 -0
- package/dist/domain/models.d.ts +204 -0
- package/dist/domain/models.d.ts.map +1 -0
- package/dist/domain/models.js +522 -0
- package/dist/domain/models.js.map +1 -0
- package/dist/domain/pipeline-registry.d.ts +19 -0
- package/dist/domain/pipeline-registry.d.ts.map +1 -0
- package/dist/domain/pipeline-registry.js +48 -0
- package/dist/domain/pipeline-registry.js.map +1 -0
- package/dist/domain/seed.d.ts +14 -0
- package/dist/domain/seed.d.ts.map +1 -0
- package/dist/domain/seed.js +369 -0
- package/dist/domain/seed.js.map +1 -0
- package/dist/domain/service-registration.d.ts +31 -0
- package/dist/domain/service-registration.d.ts.map +1 -0
- package/dist/domain/service-registration.js +37 -0
- package/dist/domain/service-registration.js.map +1 -0
- package/dist/domain/subtasks.logic.d.ts +6 -0
- package/dist/domain/subtasks.logic.d.ts.map +1 -0
- package/dist/domain/subtasks.logic.js +20 -0
- package/dist/domain/subtasks.logic.js.map +1 -0
- package/dist/domain/types.d.ts +2 -0
- package/dist/domain/types.d.ts.map +1 -0
- package/dist/domain/types.js +2 -0
- package/dist/domain/types.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/ports/account-repositories.d.ts +46 -0
- package/dist/ports/account-repositories.d.ts.map +1 -0
- package/dist/ports/account-repositories.js +2 -0
- package/dist/ports/account-repositories.js.map +1 -0
- package/dist/ports/agent-executor.d.ts +361 -0
- package/dist/ports/agent-executor.d.ts.map +1 -0
- package/dist/ports/agent-executor.js +8 -0
- package/dist/ports/agent-executor.js.map +1 -0
- package/dist/ports/agent-runs.d.ts +28 -0
- package/dist/ports/agent-runs.d.ts.map +1 -0
- package/dist/ports/agent-runs.js +2 -0
- package/dist/ports/agent-runs.js.map +1 -0
- package/dist/ports/board-operations.d.ts +15 -0
- package/dist/ports/board-operations.d.ts.map +1 -0
- package/dist/ports/board-operations.js +2 -0
- package/dist/ports/board-operations.js.map +1 -0
- package/dist/ports/board-scan-repositories.d.ts +23 -0
- package/dist/ports/board-scan-repositories.d.ts.map +1 -0
- package/dist/ports/board-scan-repositories.js +2 -0
- package/dist/ports/board-scan-repositories.js.map +1 -0
- package/dist/ports/bootstrap-repositories.d.ts +71 -0
- package/dist/ports/bootstrap-repositories.d.ts.map +1 -0
- package/dist/ports/bootstrap-repositories.js +2 -0
- package/dist/ports/bootstrap-repositories.js.map +1 -0
- package/dist/ports/bootstrap-runner.d.ts +20 -0
- package/dist/ports/bootstrap-runner.d.ts.map +1 -0
- package/dist/ports/bootstrap-runner.js +12 -0
- package/dist/ports/bootstrap-runner.js.map +1 -0
- package/dist/ports/ci-status.d.ts +23 -0
- package/dist/ports/ci-status.d.ts.map +1 -0
- package/dist/ports/ci-status.js +8 -0
- package/dist/ports/ci-status.js.map +1 -0
- package/dist/ports/clarity-review-repositories.d.ts +12 -0
- package/dist/ports/clarity-review-repositories.d.ts.map +1 -0
- package/dist/ports/clarity-review-repositories.js +2 -0
- package/dist/ports/clarity-review-repositories.js.map +1 -0
- package/dist/ports/consensus-repositories.d.ts +12 -0
- package/dist/ports/consensus-repositories.d.ts.map +1 -0
- package/dist/ports/consensus-repositories.js +2 -0
- package/dist/ports/consensus-repositories.js.map +1 -0
- package/dist/ports/document-repositories.d.ts +55 -0
- package/dist/ports/document-repositories.d.ts.map +1 -0
- package/dist/ports/document-repositories.js +2 -0
- package/dist/ports/document-repositories.js.map +1 -0
- package/dist/ports/document-source.d.ts +55 -0
- package/dist/ports/document-source.d.ts.map +1 -0
- package/dist/ports/document-source.js +2 -0
- package/dist/ports/document-source.js.map +1 -0
- package/dist/ports/email-sender.d.ts +42 -0
- package/dist/ports/email-sender.d.ts.map +1 -0
- package/dist/ports/email-sender.js +7 -0
- package/dist/ports/email-sender.js.map +1 -0
- package/dist/ports/environment-provider.d.ts +67 -0
- package/dist/ports/environment-provider.d.ts.map +1 -0
- package/dist/ports/environment-provider.js +2 -0
- package/dist/ports/environment-provider.js.map +1 -0
- package/dist/ports/environment-repositories.d.ts +64 -0
- package/dist/ports/environment-repositories.d.ts.map +1 -0
- package/dist/ports/environment-repositories.js +2 -0
- package/dist/ports/environment-repositories.js.map +1 -0
- package/dist/ports/execution-events.d.ts +72 -0
- package/dist/ports/execution-events.d.ts.map +1 -0
- package/dist/ports/execution-events.js +16 -0
- package/dist/ports/execution-events.js.map +1 -0
- package/dist/ports/fragment-repositories.d.ts +65 -0
- package/dist/ports/fragment-repositories.d.ts.map +1 -0
- package/dist/ports/fragment-repositories.js +2 -0
- package/dist/ports/fragment-repositories.js.map +1 -0
- package/dist/ports/fragment-selector.d.ts +64 -0
- package/dist/ports/fragment-selector.d.ts.map +1 -0
- package/dist/ports/fragment-selector.js +2 -0
- package/dist/ports/fragment-selector.js.map +1 -0
- package/dist/ports/github-client.d.ts +226 -0
- package/dist/ports/github-client.d.ts.map +1 -0
- package/dist/ports/github-client.js +2 -0
- package/dist/ports/github-client.js.map +1 -0
- package/dist/ports/github-provisioning.d.ts +47 -0
- package/dist/ports/github-provisioning.d.ts.map +1 -0
- package/dist/ports/github-provisioning.js +12 -0
- package/dist/ports/github-provisioning.js.map +1 -0
- package/dist/ports/github-repositories.d.ts +136 -0
- package/dist/ports/github-repositories.d.ts.map +1 -0
- package/dist/ports/github-repositories.js +2 -0
- package/dist/ports/github-repositories.js.map +1 -0
- package/dist/ports/incident-enrichment.d.ts +40 -0
- package/dist/ports/incident-enrichment.d.ts.map +1 -0
- package/dist/ports/incident-enrichment.js +30 -0
- package/dist/ports/incident-enrichment.js.map +1 -0
- package/dist/ports/index.d.ts +68 -0
- package/dist/ports/index.d.ts.map +1 -0
- package/dist/ports/index.js +11 -0
- package/dist/ports/index.js.map +1 -0
- package/dist/ports/invitation-repositories.d.ts +28 -0
- package/dist/ports/invitation-repositories.d.ts.map +1 -0
- package/dist/ports/invitation-repositories.js +2 -0
- package/dist/ports/invitation-repositories.js.map +1 -0
- package/dist/ports/llm-metrics.d.ts +142 -0
- package/dist/ports/llm-metrics.d.ts.map +1 -0
- package/dist/ports/llm-metrics.js +16 -0
- package/dist/ports/llm-metrics.js.map +1 -0
- package/dist/ports/llm-trace-sink.d.ts +84 -0
- package/dist/ports/llm-trace-sink.d.ts.map +1 -0
- package/dist/ports/llm-trace-sink.js +55 -0
- package/dist/ports/llm-trace-sink.js.map +1 -0
- package/dist/ports/local-model-repositories.d.ts +29 -0
- package/dist/ports/local-model-repositories.d.ts.map +1 -0
- package/dist/ports/local-model-repositories.js +2 -0
- package/dist/ports/local-model-repositories.js.map +1 -0
- package/dist/ports/merge-preset-repositories.d.ts +14 -0
- package/dist/ports/merge-preset-repositories.d.ts.map +1 -0
- package/dist/ports/merge-preset-repositories.js +2 -0
- package/dist/ports/merge-preset-repositories.js.map +1 -0
- package/dist/ports/model-default-repositories.d.ts +9 -0
- package/dist/ports/model-default-repositories.d.ts.map +1 -0
- package/dist/ports/model-default-repositories.js +6 -0
- package/dist/ports/model-default-repositories.js.map +1 -0
- package/dist/ports/model-provider.d.ts +69 -0
- package/dist/ports/model-provider.d.ts.map +1 -0
- package/dist/ports/model-provider.js +16 -0
- package/dist/ports/model-provider.js.map +1 -0
- package/dist/ports/notification-channel.d.ts +16 -0
- package/dist/ports/notification-channel.d.ts.map +1 -0
- package/dist/ports/notification-channel.js +22 -0
- package/dist/ports/notification-channel.js.map +1 -0
- package/dist/ports/notification-repositories.d.ts +15 -0
- package/dist/ports/notification-repositories.d.ts.map +1 -0
- package/dist/ports/notification-repositories.js +2 -0
- package/dist/ports/notification-repositories.js.map +1 -0
- package/dist/ports/password-hasher.d.ts +14 -0
- package/dist/ports/password-hasher.d.ts.map +1 -0
- package/dist/ports/password-hasher.js +9 -0
- package/dist/ports/password-hasher.js.map +1 -0
- package/dist/ports/personal-secret-cipher.d.ts +7 -0
- package/dist/ports/personal-secret-cipher.d.ts.map +1 -0
- package/dist/ports/personal-secret-cipher.js +12 -0
- package/dist/ports/personal-secret-cipher.js.map +1 -0
- package/dist/ports/personal-subscription-repositories.d.ts +72 -0
- package/dist/ports/personal-subscription-repositories.d.ts.map +1 -0
- package/dist/ports/personal-subscription-repositories.js +2 -0
- package/dist/ports/personal-subscription-repositories.js.map +1 -0
- package/dist/ports/pr-mergeability.d.ts +24 -0
- package/dist/ports/pr-mergeability.d.ts.map +1 -0
- package/dist/ports/pr-mergeability.js +7 -0
- package/dist/ports/pr-mergeability.js.map +1 -0
- package/dist/ports/pr-merger.d.ts +10 -0
- package/dist/ports/pr-merger.d.ts.map +1 -0
- package/dist/ports/pr-merger.js +8 -0
- package/dist/ports/pr-merger.js.map +1 -0
- package/dist/ports/provider-api-key-repositories.d.ts +71 -0
- package/dist/ports/provider-api-key-repositories.d.ts.map +1 -0
- package/dist/ports/provider-api-key-repositories.js +15 -0
- package/dist/ports/provider-api-key-repositories.js.map +1 -0
- package/dist/ports/provider-subscription-repositories.d.ts +51 -0
- package/dist/ports/provider-subscription-repositories.d.ts.map +1 -0
- package/dist/ports/provider-subscription-repositories.js +15 -0
- package/dist/ports/provider-subscription-repositories.js.map +1 -0
- package/dist/ports/recurring-repositories.d.ts +46 -0
- package/dist/ports/recurring-repositories.d.ts.map +1 -0
- package/dist/ports/recurring-repositories.js +2 -0
- package/dist/ports/recurring-repositories.js.map +1 -0
- package/dist/ports/release-health-repositories.d.ts +42 -0
- package/dist/ports/release-health-repositories.d.ts.map +1 -0
- package/dist/ports/release-health-repositories.js +6 -0
- package/dist/ports/release-health-repositories.js.map +1 -0
- package/dist/ports/release-health.d.ts +59 -0
- package/dist/ports/release-health.d.ts.map +1 -0
- package/dist/ports/release-health.js +8 -0
- package/dist/ports/release-health.js.map +1 -0
- package/dist/ports/repo-bootstrapper.d.ts +80 -0
- package/dist/ports/repo-bootstrapper.d.ts.map +1 -0
- package/dist/ports/repo-bootstrapper.js +2 -0
- package/dist/ports/repo-bootstrapper.js.map +1 -0
- package/dist/ports/repo-scanner.d.ts +22 -0
- package/dist/ports/repo-scanner.d.ts.map +1 -0
- package/dist/ports/repo-scanner.js +2 -0
- package/dist/ports/repo-scanner.js.map +1 -0
- package/dist/ports/repositories.d.ts +131 -0
- package/dist/ports/repositories.d.ts.map +1 -0
- package/dist/ports/repositories.js +2 -0
- package/dist/ports/repositories.js.map +1 -0
- package/dist/ports/requirement-review-repositories.d.ts +16 -0
- package/dist/ports/requirement-review-repositories.d.ts.map +1 -0
- package/dist/ports/requirement-review-repositories.js +2 -0
- package/dist/ports/requirement-review-repositories.js.map +1 -0
- package/dist/ports/runner-pool-provider.d.ts +25 -0
- package/dist/ports/runner-pool-provider.d.ts.map +1 -0
- package/dist/ports/runner-pool-provider.js +2 -0
- package/dist/ports/runner-pool-provider.js.map +1 -0
- package/dist/ports/runner-pool-repositories.d.ts +27 -0
- package/dist/ports/runner-pool-repositories.d.ts.map +1 -0
- package/dist/ports/runner-pool-repositories.js +7 -0
- package/dist/ports/runner-pool-repositories.js.map +1 -0
- package/dist/ports/runner-transport.d.ts +119 -0
- package/dist/ports/runner-transport.d.ts.map +1 -0
- package/dist/ports/runner-transport.js +2 -0
- package/dist/ports/runner-transport.js.map +1 -0
- package/dist/ports/runtime.d.ts +9 -0
- package/dist/ports/runtime.d.ts.map +1 -0
- package/dist/ports/runtime.js +5 -0
- package/dist/ports/runtime.js.map +1 -0
- package/dist/ports/sandbox-repositories.d.ts +39 -0
- package/dist/ports/sandbox-repositories.d.ts.map +1 -0
- package/dist/ports/sandbox-repositories.js +2 -0
- package/dist/ports/sandbox-repositories.js.map +1 -0
- package/dist/ports/secret-cipher.d.ts +7 -0
- package/dist/ports/secret-cipher.d.ts.map +1 -0
- package/dist/ports/secret-cipher.js +7 -0
- package/dist/ports/secret-cipher.js.map +1 -0
- package/dist/ports/service-fragment-default-repositories.d.ts +7 -0
- package/dist/ports/service-fragment-default-repositories.d.ts.map +1 -0
- package/dist/ports/service-fragment-default-repositories.js +6 -0
- package/dist/ports/service-fragment-default-repositories.js.map +1 -0
- package/dist/ports/service-repositories.d.ts +68 -0
- package/dist/ports/service-repositories.d.ts.map +1 -0
- package/dist/ports/service-repositories.js +2 -0
- package/dist/ports/service-repositories.js.map +1 -0
- package/dist/ports/slack-repositories.d.ts +61 -0
- package/dist/ports/slack-repositories.d.ts.map +1 -0
- package/dist/ports/slack-repositories.js +2 -0
- package/dist/ports/slack-repositories.js.map +1 -0
- package/dist/ports/task-repositories.d.ts +61 -0
- package/dist/ports/task-repositories.d.ts.map +1 -0
- package/dist/ports/task-repositories.js +2 -0
- package/dist/ports/task-repositories.js.map +1 -0
- package/dist/ports/task-source.d.ts +69 -0
- package/dist/ports/task-source.d.ts.map +1 -0
- package/dist/ports/task-source.js +2 -0
- package/dist/ports/task-source.js.map +1 -0
- package/dist/ports/ticket-tracker.d.ts +19 -0
- package/dist/ports/ticket-tracker.d.ts.map +1 -0
- package/dist/ports/ticket-tracker.js +8 -0
- package/dist/ports/ticket-tracker.js.map +1 -0
- package/dist/ports/token-usage.d.ts +37 -0
- package/dist/ports/token-usage.d.ts.map +1 -0
- package/dist/ports/token-usage.js +6 -0
- package/dist/ports/token-usage.js.map +1 -0
- package/dist/ports/tracker-settings-repositories.d.ts +6 -0
- package/dist/ports/tracker-settings-repositories.d.ts.map +1 -0
- package/dist/ports/tracker-settings-repositories.js +2 -0
- package/dist/ports/tracker-settings-repositories.js.map +1 -0
- package/dist/ports/url-safety-policy.d.ts +15 -0
- package/dist/ports/url-safety-policy.d.ts.map +1 -0
- package/dist/ports/url-safety-policy.js +13 -0
- package/dist/ports/url-safety-policy.js.map +1 -0
- package/dist/ports/user-repositories.d.ts +52 -0
- package/dist/ports/user-repositories.d.ts.map +1 -0
- package/dist/ports/user-repositories.js +13 -0
- package/dist/ports/user-repositories.js.map +1 -0
- package/dist/ports/webhook-verifier.d.ts +9 -0
- package/dist/ports/webhook-verifier.d.ts.map +1 -0
- package/dist/ports/webhook-verifier.js +8 -0
- package/dist/ports/webhook-verifier.js.map +1 -0
- package/dist/ports/work-runner.d.ts +19 -0
- package/dist/ports/work-runner.d.ts.map +1 -0
- package/dist/ports/work-runner.js +19 -0
- package/dist/ports/work-runner.js.map +1 -0
- package/dist/ports/workspace-settings-repositories.d.ts +8 -0
- package/dist/ports/workspace-settings-repositories.d.ts.map +1 -0
- package/dist/ports/workspace-settings-repositories.js +2 -0
- package/dist/ports/workspace-settings-repositories.js.map +1 -0
- package/dist/shared/atlassian.logic.d.ts +11 -0
- package/dist/shared/atlassian.logic.d.ts.map +1 -0
- package/dist/shared/atlassian.logic.js +148 -0
- package/dist/shared/atlassian.logic.js.map +1 -0
- package/dist/shared/markdown.logic.d.ts +5 -0
- package/dist/shared/markdown.logic.d.ts.map +1 -0
- package/dist/shared/markdown.logic.js +21 -0
- package/dist/shared/markdown.logic.js.map +1 -0
- package/dist/shared/source-registry.logic.d.ts +10 -0
- package/dist/shared/source-registry.logic.d.ts.map +1 -0
- package/dist/shared/source-registry.logic.js +17 -0
- package/dist/shared/source-registry.logic.js.map +1 -0
- package/dist/shared/tasks-prompt.logic.d.ts +16 -0
- package/dist/shared/tasks-prompt.logic.d.ts.map +1 -0
- package/dist/shared/tasks-prompt.logic.js +29 -0
- package/dist/shared/tasks-prompt.logic.js.map +1 -0
- package/dist/workspace-guard.d.ts +4 -0
- package/dist/workspace-guard.d.ts.map +1 -0
- package/dist/workspace-guard.js +5 -0
- package/dist/workspace-guard.js.map +1 -0
- package/package.json +32 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { CloudProvider, InstanceSize, StepSubtasks } from '../domain/types.js';
|
|
2
|
+
import type { LlmToolSpan } from './llm-trace-sink.js';
|
|
3
|
+
/** Live subtask counts a running job reports (from the coding tool's todo list). */
|
|
4
|
+
export type RunnerJobProgress = StepSubtasks;
|
|
5
|
+
/** The structured work product a finished job records. */
|
|
6
|
+
export interface RunnerJobResult {
|
|
7
|
+
prUrl?: string;
|
|
8
|
+
branch?: string;
|
|
9
|
+
summary?: string;
|
|
10
|
+
error?: string;
|
|
11
|
+
/** A Blueprinter job's decomposition tree (the `/blueprint` endpoint's product). */
|
|
12
|
+
service?: unknown;
|
|
13
|
+
/** A spec-writer job's prescriptive specification doc (the `/spec` endpoint's product). */
|
|
14
|
+
spec?: unknown;
|
|
15
|
+
/** A bootstrap job's pushed default branch (the `/bootstrap` endpoint's product). */
|
|
16
|
+
defaultBranch?: string;
|
|
17
|
+
/** A `merger` job's PR assessment (the `/merge` endpoint's product). */
|
|
18
|
+
assessment?: unknown;
|
|
19
|
+
/** An `on-call` job's release-regression assessment (the `/on-call` endpoint's product). */
|
|
20
|
+
onCallAssessment?: unknown;
|
|
21
|
+
/** A `ci-fixer` job's outcome: whether it pushed a fix to the PR branch. */
|
|
22
|
+
pushed?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* A conflict-resolver job's outcome: whether the PR branch is now mergeable (the
|
|
25
|
+
* `/resolve-conflicts` endpoint's product). `false` means conflicts remain.
|
|
26
|
+
*/
|
|
27
|
+
resolved?: boolean;
|
|
28
|
+
/** A `tester` job's structured test report (the `/test` endpoint's product). */
|
|
29
|
+
report?: unknown;
|
|
30
|
+
/**
|
|
31
|
+
* Token usage the harness lifted from the agent CLI's own event stream. Reported
|
|
32
|
+
* by the subscription harnesses (Claude Code / Codex), whose traffic bypasses the
|
|
33
|
+
* LLM proxy — so this is the only usage signal for them. The dispatch path folds
|
|
34
|
+
* it into the leased subscription token's rolling-window counters (usage-aware
|
|
35
|
+
* rotation) and the telemetry sink. Absent for the proxy-metered Pi harness.
|
|
36
|
+
*/
|
|
37
|
+
usage?: {
|
|
38
|
+
inputTokens: number;
|
|
39
|
+
outputTokens: number;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Which harness agent a dispatch targets (a coding run, a blueprint run, a
|
|
44
|
+
* read-only repo exploration, a repo-bootstrap run, a CI fix, a merge-conflict
|
|
45
|
+
* resolution, or a merge assessment). All are dispatched + polled identically
|
|
46
|
+
* through this transport; `kind` travels in the job body to the harness's single
|
|
47
|
+
* `POST /jobs` endpoint, which reads it to pick the right agent. The Cloudflare
|
|
48
|
+
* backend serves all of them, and so does a self-hosted pool: it runs the same
|
|
49
|
+
* executor-harness image, and runtime parity is the default (the "keep the runtimes
|
|
50
|
+
* symmetric" guideline), so a pool serves every kind with no opt-in allow-list — a
|
|
51
|
+
* new harness kind reaches it automatically, never silently diverging from Cloudflare.
|
|
52
|
+
*/
|
|
53
|
+
export type RunnerDispatchKind = 'run' | 'blueprint' | 'spec' | 'explore' | 'bootstrap' | 'ci-fix' | 'resolve-conflicts' | 'merge' | 'on-call' | 'test' | 'fix-tests';
|
|
54
|
+
/**
|
|
55
|
+
* Optional, transport-level provisioning hints resolved per-service at dispatch.
|
|
56
|
+
* A self-hosted pool forwards `instanceTypeId` (and `provider`) so it can provision
|
|
57
|
+
* the right size on its own cloud; the local Docker backend maps `instanceSize` to
|
|
58
|
+
* container resource limits. The Cloudflare backend ignores these — its Container
|
|
59
|
+
* instance type is fixed per class by `wrangler.toml` (no per-dispatch sizing).
|
|
60
|
+
*/
|
|
61
|
+
export interface RunnerDispatchOptions {
|
|
62
|
+
/** Concrete instance-type id for the target (see `resolveInstanceTypeId`). */
|
|
63
|
+
instanceTypeId?: string;
|
|
64
|
+
/** The cloud provider the service selected, for a self-provisioning pool. */
|
|
65
|
+
provider?: CloudProvider;
|
|
66
|
+
/**
|
|
67
|
+
* The abstract t-shirt size the service selected, forwarded verbatim so a
|
|
68
|
+
* resource-sizing transport (the local Docker/Podman backend) can map it to
|
|
69
|
+
* concrete `--memory` / `--cpus` limits without reverse-engineering a cloud
|
|
70
|
+
* instance-type id.
|
|
71
|
+
*/
|
|
72
|
+
instanceSize?: InstanceSize;
|
|
73
|
+
}
|
|
74
|
+
/** A job's current state, as the harness/pool reports it. */
|
|
75
|
+
export interface RunnerJobView {
|
|
76
|
+
state: 'running' | 'done' | 'failed';
|
|
77
|
+
/** Present while running once the agent has touched its todo list. */
|
|
78
|
+
progress?: RunnerJobProgress;
|
|
79
|
+
result?: RunnerJobResult;
|
|
80
|
+
error?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Tool spans the harness buffered SINCE THE LAST POLL (drain-on-read): the executor
|
|
83
|
+
* forwards them to the optional trace sink as child spans under the run trace. Empty/
|
|
84
|
+
* absent on most polls. Best-effort observability — never affects the job lifecycle.
|
|
85
|
+
*/
|
|
86
|
+
spans?: LlmToolSpan[];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Addresses one runner job: the run (execution) it belongs to plus the job's own id.
|
|
90
|
+
* See the file header for why the two are distinct — `runId` scopes the per-run
|
|
91
|
+
* container, `jobId` identifies the step's job uniquely within that run.
|
|
92
|
+
*/
|
|
93
|
+
export interface RunnerJobRef {
|
|
94
|
+
/** The run (execution) the job belongs to; addresses the per-run container. */
|
|
95
|
+
runId: string;
|
|
96
|
+
/** The job's own id, unique within the run (one per pipeline step). */
|
|
97
|
+
jobId: string;
|
|
98
|
+
}
|
|
99
|
+
export interface RunnerTransport {
|
|
100
|
+
/**
|
|
101
|
+
* Start the job `ref.jobId` (in run `ref.runId`) with the harness job `spec`, or
|
|
102
|
+
* re-attach to one already running for that ref. Must be idempotent per ref so a
|
|
103
|
+
* replayed dispatch never starts a duplicate. `kind` selects which harness agent
|
|
104
|
+
* runs (`run` by default, `blueprint` for a Blueprinter job, `bootstrap` for a
|
|
105
|
+
* repo-bootstrap job, …) and is carried in the job body; all are polled identically
|
|
106
|
+
* via {@link poll}.
|
|
107
|
+
*/
|
|
108
|
+
dispatch(ref: RunnerJobRef, spec: Record<string, unknown>, kind?: RunnerDispatchKind, options?: RunnerDispatchOptions): Promise<void>;
|
|
109
|
+
/** Poll the job's current state. */
|
|
110
|
+
poll(ref: RunnerJobRef): Promise<RunnerJobView>;
|
|
111
|
+
/**
|
|
112
|
+
* Optionally reclaim a run's runner resources: the per-run container on backends
|
|
113
|
+
* that share one across the run (Cloudflare, local Docker), and any of the run's
|
|
114
|
+
* still-running jobs on a per-job backend (a self-hosted pool cancels `ref.jobId`).
|
|
115
|
+
* Best-effort and idempotent — releasing an already-gone run/job is a no-op.
|
|
116
|
+
*/
|
|
117
|
+
release?(ref: RunnerJobRef): Promise<void>;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=runner-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner-transport.d.ts","sourceRoot":"","sources":["../../src/ports/runner-transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACnF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAyBtD,oFAAoF;AACpF,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAA;AAE5C,0DAA0D;AAC1D,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oFAAoF;IACpF,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2FAA2F;IAC3F,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,qFAAqF;IACrF,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,wEAAwE;IACxE,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,4FAA4F;IAC5F,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B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kBAAkB,EACzB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAAA;IAChB,oCAAoC;IACpC,IAAI,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;IAC/C;;;;;OAKG;IACH,OAAO,CAAC,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner-transport.js","sourceRoot":"","sources":["../../src/ports/runner-transport.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/ports/runtime.ts"],"names":[],"mappings":"AAIA,+CAA+C;AAC/C,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAC9B;AAED,yBAAyB;AACzB,MAAM,WAAW,KAAK;IACpB,GAAG,IAAI,MAAM,CAAA;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/ports/runtime.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,iFAAiF;AACjF,4CAA4C"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { SandboxExperiment, SandboxExperimentStatus, SandboxFixture, SandboxGrade, SandboxPromptVersion, SandboxRun, SandboxRunStatus } from '../domain/types.js';
|
|
2
|
+
/** Stored candidate prompt-version lineages (baselines are NOT stored — see contracts). */
|
|
3
|
+
export interface SandboxPromptVersionRepository {
|
|
4
|
+
get(workspaceId: string, id: string): Promise<SandboxPromptVersion | null>;
|
|
5
|
+
/** All non-archived candidate versions for a workspace, newest first. */
|
|
6
|
+
list(workspaceId: string): Promise<SandboxPromptVersion[]>;
|
|
7
|
+
/** All non-archived candidate versions for one agent kind. */
|
|
8
|
+
listByKind(workspaceId: string, agentKind: string): Promise<SandboxPromptVersion[]>;
|
|
9
|
+
upsert(workspaceId: string, version: SandboxPromptVersion): Promise<void>;
|
|
10
|
+
/** Soft-archive a version (hidden from the default listing). */
|
|
11
|
+
archive(workspaceId: string, id: string, at: number): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export interface SandboxFixtureRepository {
|
|
14
|
+
get(workspaceId: string, id: string): Promise<SandboxFixture | null>;
|
|
15
|
+
list(workspaceId: string): Promise<SandboxFixture[]>;
|
|
16
|
+
upsert(workspaceId: string, fixture: SandboxFixture): Promise<void>;
|
|
17
|
+
remove(workspaceId: string, id: string): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export interface SandboxExperimentRepository {
|
|
20
|
+
get(workspaceId: string, id: string): Promise<SandboxExperiment | null>;
|
|
21
|
+
list(workspaceId: string): Promise<SandboxExperiment[]>;
|
|
22
|
+
upsert(workspaceId: string, experiment: SandboxExperiment): Promise<void>;
|
|
23
|
+
setStatus(workspaceId: string, id: string, status: SandboxExperimentStatus): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
export interface SandboxRunRepository {
|
|
26
|
+
get(workspaceId: string, id: string): Promise<SandboxRun | null>;
|
|
27
|
+
/** All cells of an experiment (the results grid). */
|
|
28
|
+
listByExperiment(workspaceId: string, experimentId: string): Promise<SandboxRun[]>;
|
|
29
|
+
/** Queued cells of an experiment, oldest first (for the durable fan-out driver). */
|
|
30
|
+
listQueued(workspaceId: string, experimentId: string): Promise<SandboxRun[]>;
|
|
31
|
+
upsert(workspaceId: string, run: SandboxRun): Promise<void>;
|
|
32
|
+
setStatus(workspaceId: string, id: string, status: SandboxRunStatus): Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
export interface SandboxGradeRepository {
|
|
35
|
+
getByRun(workspaceId: string, runId: string): Promise<SandboxGrade | null>;
|
|
36
|
+
listByExperiment(workspaceId: string, experimentId: string): Promise<SandboxGrade[]>;
|
|
37
|
+
upsert(workspaceId: string, grade: SandboxGrade): Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=sandbox-repositories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-repositories.d.ts","sourceRoot":"","sources":["../../src/ports/sandbox-repositories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACd,YAAY,EACZ,oBAAoB,EACpB,UAAU,EACV,gBAAgB,EACjB,MAAM,oBAAoB,CAAA;AAQ3B,2FAA2F;AAC3F,MAAM,WAAW,8BAA8B;IAC7C,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAA;IAC1E,yEAAyE;IACzE,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAA;IAC1D,8DAA8D;IAC9D,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAA;IACnF,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACzE,gEAAgE;IAChE,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACpE;AAED,MAAM,WAAW,wBAAwB;IACvC,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACpE,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAA;IACpD,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAA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K,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAA;IAC1E,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAA;IACpF,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAChE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-repositories.js","sourceRoot":"","sources":["../../src/ports/sandbox-repositories.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface SecretCipher {
|
|
2
|
+
/** Encrypt plaintext into an opaque, self-describing envelope string. */
|
|
3
|
+
encrypt(plaintext: string): Promise<string>;
|
|
4
|
+
/** Decrypt an envelope produced by {@link encrypt}. Throws if tampered/invalid. */
|
|
5
|
+
decrypt(envelope: string): Promise<string>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=secret-cipher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret-cipher.d.ts","sourceRoot":"","sources":["../../src/ports/secret-cipher.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,YAAY;IAC3B,yEAAyE;IACzE,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAC3C,mFAAmF;IACnF,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;CAC3C"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Port for authenticated encryption of credentials at rest. The core depends
|
|
2
|
+
// only on this interface; the worker supplies a Web Crypto (AES-256-GCM)
|
|
3
|
+
// implementation keyed by a service-level master secret. Used to protect the
|
|
4
|
+
// per-tenant management-API secret bundle and the per-environment access creds
|
|
5
|
+
// before they are written to D1, and to decrypt them in-memory at call time.
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=secret-cipher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret-cipher.js","sourceRoot":"","sources":["../../src/ports/secret-cipher.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,yEAAyE;AACzE,6EAA6E;AAC7E,+EAA+E;AAC/E,6EAA6E"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface ServiceFragmentDefaultsRepository {
|
|
2
|
+
/** The workspace's default fragment ids (empty array when none set). */
|
|
3
|
+
get(workspaceId: string): Promise<string[]>;
|
|
4
|
+
/** Replace the workspace's default fragment ids wholesale. */
|
|
5
|
+
set(workspaceId: string, fragmentIds: string[]): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=service-fragment-default-repositories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-fragment-default-repositories.d.ts","sourceRoot":"","sources":["../../src/ports/service-fragment-default-repositories.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,iCAAiC;IAChD,wEAAwE;IACxE,GAAG,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;IAC3C,8DAA8D;IAC9D,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC/D"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Persistence port for a workspace's default service-fragment selection — the
|
|
2
|
+
// best-practice prompt fragment ids that new services inherit. The Cloudflare facade
|
|
3
|
+
// implements it against D1, the Node facade against Postgres; tests supply an
|
|
4
|
+
// in-memory fake. Stored as one list per workspace; empty when none set.
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=service-fragment-default-repositories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-fragment-default-repositories.js","sourceRoot":"","sources":["../../src/ports/service-fragment-default-repositories.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,qFAAqF;AACrF,8EAA8E;AAC9E,yEAAyE"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Service, WorkspaceMount } from '../domain/types.js';
|
|
2
|
+
/** Fields of a service that may be patched (its id and frame are immutable). */
|
|
3
|
+
export type ServicePatch = Partial<Pick<Service, 'accountId' | 'installationId' | 'repoGithubId' | 'directory'>>;
|
|
4
|
+
export interface ServiceRepository {
|
|
5
|
+
get(id: string): Promise<Service | null>;
|
|
6
|
+
/** The service that owns a given frame block, or null. */
|
|
7
|
+
getByFrameBlock(frameBlockId: string): Promise<Service | null>;
|
|
8
|
+
/**
|
|
9
|
+
* Every service owned by an account (the org catalog a workspace mounts from).
|
|
10
|
+
* `null` lists the legacy/unscoped org (the auth-disabled path), matching services
|
|
11
|
+
* whose `accountId` is NULL.
|
|
12
|
+
*/
|
|
13
|
+
listByAccount(accountId: string | null): Promise<Service[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Services by id, in a single (chunked) query. Used to resolve every service a workspace
|
|
16
|
+
* mounts when composing its board, without one round-trip per mount. Empty input → empty.
|
|
17
|
+
*/
|
|
18
|
+
listByIds(ids: string[]): Promise<Service[]>;
|
|
19
|
+
/** The service linked to a repo (installation + github id), or null. */
|
|
20
|
+
getByRepo(installationId: number, repoGithubId: number): Promise<Service | null>;
|
|
21
|
+
insert(service: Service): Promise<void>;
|
|
22
|
+
update(id: string, patch: ServicePatch): Promise<void>;
|
|
23
|
+
delete(id: string): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Delete a set of services in a single (chunked) query — the batched form of
|
|
26
|
+
* {@link ServiceRepository.delete} used when a frame deletion dooms one or more services at
|
|
27
|
+
* once. Empty input → no-op.
|
|
28
|
+
*/
|
|
29
|
+
deleteMany(ids: string[]): Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
/** Fields of a mount that may be patched (the per-workspace layout override). */
|
|
32
|
+
export type WorkspaceMountPatch = Partial<Pick<WorkspaceMount, 'position' | 'size'>>;
|
|
33
|
+
export interface WorkspaceMountRepository {
|
|
34
|
+
/** Services mounted onto a workspace board (with their layout overrides). */
|
|
35
|
+
listByWorkspace(workspaceId: string): Promise<WorkspaceMount[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Workspaces a service is mounted onto — used to fan real-time events out to
|
|
38
|
+
* every board that shows the changed service.
|
|
39
|
+
*/
|
|
40
|
+
listByService(serviceId: string): Promise<WorkspaceMount[]>;
|
|
41
|
+
/**
|
|
42
|
+
* The workspace ids that mount the service owning `blockId` (homed in `originWorkspaceId`),
|
|
43
|
+
* resolved in a SINGLE join — the real-time fan-out's hot path. Folds the
|
|
44
|
+
* "block → its service → the workspaces mounting it" lookup into one query instead of
|
|
45
|
+
* resolving the block's service and then its mounts on every event. Empty when the block has
|
|
46
|
+
* no service (the caller then delivers to the origin only). The origin is NOT implied — the
|
|
47
|
+
* caller unions it in.
|
|
48
|
+
*/
|
|
49
|
+
listWorkspaceIdsMountingBlock(originWorkspaceId: string, blockId: string): Promise<string[]>;
|
|
50
|
+
/**
|
|
51
|
+
* Mount counts for a set of services in a single query, keyed by service id (services with
|
|
52
|
+
* no mounts are absent). Backs the org catalog's "Shared" badge without an N+1
|
|
53
|
+
* {@link WorkspaceMountRepository.listByService} per service on the snapshot hot path.
|
|
54
|
+
*/
|
|
55
|
+
countByServiceIds(serviceIds: string[]): Promise<Record<string, number>>;
|
|
56
|
+
get(workspaceId: string, serviceId: string): Promise<WorkspaceMount | null>;
|
|
57
|
+
upsert(mount: WorkspaceMount): Promise<void>;
|
|
58
|
+
update(workspaceId: string, serviceId: string, patch: WorkspaceMountPatch): Promise<void>;
|
|
59
|
+
/** Remove a service from a workspace board (does NOT delete the service). */
|
|
60
|
+
remove(workspaceId: string, serviceId: string): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Remove EVERY workspace's mount of the given services in a single (chunked) query — the
|
|
63
|
+
* batched form of {@link WorkspaceMountRepository.remove} used when a frame deletion dooms a
|
|
64
|
+
* service: its mounts must be cleaned off every board at once. Empty input → no-op.
|
|
65
|
+
*/
|
|
66
|
+
removeByServices(serviceIds: string[]): Promise<void>;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=service-repositories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-repositories.d.ts","sourceRoot":"","sources":["../../src/ports/service-repositories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAYjE,gFAAgF;AAChF,MAAM,MAAM,YAAY,GAAG,OAAO,CAChC,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,gBAAgB,GAAG,cAAc,GAAG,WAAW,CAAC,CAC7E,CAAA;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAA;IACxC,0DAA0D;IAC1D,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAA;IAC9D;;;;OAIG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;IAC3D;;;OAGG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;IAC5C,wEAAwE;IACxE,SAAS,CAAC,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAA;IAChF,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACvC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,I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EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-repositories.js","sourceRoot":"","sources":["../../src/ports/service-repositories.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { SlackMemberMappingEntry, SlackNotificationSettings } from '../domain/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* An account's Slack connection: the installed team metadata + the encrypted bot
|
|
4
|
+
* token. The token is decrypted only in-memory, at delivery time, by the channel.
|
|
5
|
+
*/
|
|
6
|
+
export interface SlackConnectionRecord {
|
|
7
|
+
accountId: string;
|
|
8
|
+
teamId: string;
|
|
9
|
+
teamName: string;
|
|
10
|
+
teamIconUrl: string | null;
|
|
11
|
+
botUserId: string | null;
|
|
12
|
+
/** OAuth scopes granted to the bot token, as a JSON array string (or null). */
|
|
13
|
+
scopesJson: string | null;
|
|
14
|
+
/** Ciphertext of the bot token (SecretCipher envelope); never plaintext. */
|
|
15
|
+
tokenCipher: string;
|
|
16
|
+
createdAt: number;
|
|
17
|
+
/** Set when the account disconnects Slack (tombstone). */
|
|
18
|
+
deletedAt: number | null;
|
|
19
|
+
}
|
|
20
|
+
export interface SlackConnectionRepository {
|
|
21
|
+
/** The account's live connection, or null if not connected. */
|
|
22
|
+
getByAccount(accountId: string): Promise<SlackConnectionRecord | null>;
|
|
23
|
+
/**
|
|
24
|
+
* The live connection bound to a Slack team, or null — used to guard against a
|
|
25
|
+
* team being claimed by a second account (mirrors the GitHub-installation guard).
|
|
26
|
+
*/
|
|
27
|
+
getByTeam(teamId: string): Promise<SlackConnectionRecord | null>;
|
|
28
|
+
/** Create or replace the live connection for an account. */
|
|
29
|
+
upsert(record: SlackConnectionRecord): Promise<void>;
|
|
30
|
+
/** Tombstone the account's connection. */
|
|
31
|
+
softDelete(accountId: string, at: number): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
/** A workspace's Slack notification routing (persisted settings). */
|
|
34
|
+
export interface SlackSettingsRecord {
|
|
35
|
+
workspaceId: string;
|
|
36
|
+
/** The `SlackNotificationSettings.routes` map, serialized as JSON. */
|
|
37
|
+
routesJson: string;
|
|
38
|
+
/** Whether to resolve @-mentions from the account member map (0/1 on D1). */
|
|
39
|
+
mentionsEnabled: boolean;
|
|
40
|
+
updatedAt: number;
|
|
41
|
+
}
|
|
42
|
+
export interface SlackSettingsRepository {
|
|
43
|
+
/** A workspace's settings, or null when never configured (defaults apply). */
|
|
44
|
+
getByWorkspace(workspaceId: string): Promise<SlackSettingsRecord | null>;
|
|
45
|
+
/** Create or replace a workspace's settings. */
|
|
46
|
+
upsert(record: SlackSettingsRecord): Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* An account's opt-in GitHub-user-id → Slack-member-id map. The repository returns
|
|
50
|
+
* the decoded `SlackMemberMappingEntry[]` directly (each store serializes it to its
|
|
51
|
+
* own JSON column), so there is no separate persisted-record shape here.
|
|
52
|
+
*/
|
|
53
|
+
export interface SlackMemberMappingRepository {
|
|
54
|
+
/** An account's mapping entries (empty when none configured). */
|
|
55
|
+
getByAccount(accountId: string): Promise<SlackMemberMappingEntry[]>;
|
|
56
|
+
/** Create or replace an account's mapping. */
|
|
57
|
+
upsert(accountId: string, entries: SlackMemberMappingEntry[], at: number): Promise<void>;
|
|
58
|
+
}
|
|
59
|
+
/** Re-exported for repository implementations that map the persisted settings. */
|
|
60
|
+
export type { SlackNotificationSettings };
|
|
61
|
+
//# sourceMappingURL=slack-repositories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-repositories.d.ts","sourceRoot":"","sources":["../../src/ports/slack-repositories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAW5F;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAA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BAA4B;IAC3C,iEAAiE;IACjE,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAAA;IACnE,8CAA8C;IAC9C,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,EAAE,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACzF;AAED,kFAAkF;AAClF,YAAY,EAAE,yBAAyB,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-repositories.js","sourceRoot":"","sources":["../../src/ports/slack-repositories.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { TaskSourceKind, TaskComment } from '../domain/types.js';
|
|
2
|
+
import type { TaskCredentials } from './task-source.js';
|
|
3
|
+
/**
|
|
4
|
+
* A workspace's connection to one task source, including its credential bag.
|
|
5
|
+
* Credentials are infrastructure detail (never sent on the wire); they live here
|
|
6
|
+
* so the import path can authenticate against the source for this workspace.
|
|
7
|
+
*/
|
|
8
|
+
export interface TaskConnectionRecord {
|
|
9
|
+
workspaceId: string;
|
|
10
|
+
source: TaskSourceKind;
|
|
11
|
+
credentials: TaskCredentials;
|
|
12
|
+
/** Human-friendly label for the connection (site URL). */
|
|
13
|
+
label: string;
|
|
14
|
+
createdAt: number;
|
|
15
|
+
/** Set when the workspace disconnects (tombstone). */
|
|
16
|
+
deletedAt: number | null;
|
|
17
|
+
}
|
|
18
|
+
export interface TaskConnectionRepository {
|
|
19
|
+
/** The workspace's live connection for a source, or null if not connected. */
|
|
20
|
+
getByWorkspace(workspaceId: string, source: TaskSourceKind): Promise<TaskConnectionRecord | null>;
|
|
21
|
+
/** Every live connection the workspace holds, across sources. */
|
|
22
|
+
listByWorkspace(workspaceId: string): Promise<TaskConnectionRecord[]>;
|
|
23
|
+
/** Create or replace the live connection for a (workspace, source). */
|
|
24
|
+
upsert(record: TaskConnectionRecord): Promise<void>;
|
|
25
|
+
/** Tombstone the workspace's connection to a source. */
|
|
26
|
+
softDelete(workspaceId: string, source: TaskSourceKind, at: number): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* An issue projected locally for a workspace as a structured record. The cached
|
|
30
|
+
* fields back both the agent-context injection and the list/preview rendering;
|
|
31
|
+
* `linkedBlockId` records the board block this issue is attached to, if any.
|
|
32
|
+
*/
|
|
33
|
+
export interface TaskRecord {
|
|
34
|
+
workspaceId: string;
|
|
35
|
+
source: TaskSourceKind;
|
|
36
|
+
externalId: string;
|
|
37
|
+
title: string;
|
|
38
|
+
url: string;
|
|
39
|
+
status: string;
|
|
40
|
+
type: string;
|
|
41
|
+
assignee: string | null;
|
|
42
|
+
priority: string | null;
|
|
43
|
+
labels: string[];
|
|
44
|
+
description: string;
|
|
45
|
+
comments: TaskComment[];
|
|
46
|
+
excerpt: string;
|
|
47
|
+
linkedBlockId: string | null;
|
|
48
|
+
syncedAt: number;
|
|
49
|
+
deletedAt: number | null;
|
|
50
|
+
}
|
|
51
|
+
export interface TaskRepository {
|
|
52
|
+
upsert(record: TaskRecord): Promise<void>;
|
|
53
|
+
get(workspaceId: string, source: TaskSourceKind, externalId: string): Promise<TaskRecord | null>;
|
|
54
|
+
/** Every live issue imported into the workspace, across sources. */
|
|
55
|
+
listByWorkspace(workspaceId: string): Promise<TaskRecord[]>;
|
|
56
|
+
/** Live issues attached to a board block (resolved during execution). */
|
|
57
|
+
listByBlock(workspaceId: string, blockId: string): Promise<TaskRecord[]>;
|
|
58
|
+
/** Attach an issue to a board block (or detach with null). */
|
|
59
|
+
linkBlock(workspaceId: string, source: TaskSourceKind, externalId: string, blockId: string | null): Promise<void>;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=task-repositories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-repositories.d.ts","sourceRoot":"","sources":["../../src/ports/task-repositories.ts"],"names":[],"m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EAAE,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,WAAW,EAAE,CAAA;IACvB,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACzC,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAA;IAChG,oEAAoE;IACpE,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IAC3D,yEAAyE;IACzE,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IACxE,8DAA8D;IAC9D,SAAS,CACP,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,cAAc,EACtB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GAAG,IAAI,GACrB,OAAO,CAAC,IAAI,CAAC,CAAA;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-repositories.js","sourceRoot":"","sources":["../../src/ports/task-repositories.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { TaskSourceKind, TaskSourceDescriptor, TaskComment, TaskSearchResult } from '../domain/types.js';
|
|
2
|
+
/** A source's per-workspace credentials, as a flat key→value bag. */
|
|
3
|
+
export type TaskCredentials = Record<string, string>;
|
|
4
|
+
export type { TaskComment };
|
|
5
|
+
/** An issue fetched from a source, as a structured record. */
|
|
6
|
+
export interface TaskContent {
|
|
7
|
+
/** The source's canonical key for the issue (e.g. `PROJ-123`). */
|
|
8
|
+
externalId: string;
|
|
9
|
+
/** Canonical web URL of the issue. */
|
|
10
|
+
url: string;
|
|
11
|
+
/** Issue summary / title. */
|
|
12
|
+
title: string;
|
|
13
|
+
/** Workflow status name, e.g. `In Progress`. */
|
|
14
|
+
status: string;
|
|
15
|
+
/** Issue type name, e.g. `Bug`. */
|
|
16
|
+
type: string;
|
|
17
|
+
/** Assignee display name, or null when unassigned. */
|
|
18
|
+
assignee: string | null;
|
|
19
|
+
/** Priority name, or null when none. */
|
|
20
|
+
priority: string | null;
|
|
21
|
+
/** Issue labels. */
|
|
22
|
+
labels: string[];
|
|
23
|
+
/** Description normalized to lightweight Markdown. */
|
|
24
|
+
description: string;
|
|
25
|
+
/** Recent comments (oldest→newest), bodies normalized to Markdown. */
|
|
26
|
+
comments: TaskComment[];
|
|
27
|
+
}
|
|
28
|
+
/** The result of validating + normalizing connect credentials. */
|
|
29
|
+
export interface NormalizedTaskConnection {
|
|
30
|
+
/** The credential bag to persist (trimmed/normalized). */
|
|
31
|
+
credentials: TaskCredentials;
|
|
32
|
+
/** A human-friendly label for the connection (site URL). */
|
|
33
|
+
label: string;
|
|
34
|
+
}
|
|
35
|
+
export interface TaskSourceProvider {
|
|
36
|
+
/** Which source this provider serves. */
|
|
37
|
+
readonly kind: TaskSourceKind;
|
|
38
|
+
/** Self-description so the UI can render the connect/import forms generically. */
|
|
39
|
+
readonly descriptor: TaskSourceDescriptor;
|
|
40
|
+
/**
|
|
41
|
+
* Validate the supplied credentials and return the bag to persist plus a
|
|
42
|
+
* display label. Throws a ValidationError on anything missing/unsafe.
|
|
43
|
+
*/
|
|
44
|
+
normalizeConnection(input: TaskCredentials): NormalizedTaskConnection;
|
|
45
|
+
/** Resolve a stable issue key from raw user input (a bare key or an issue URL); null if unparseable. */
|
|
46
|
+
parseRef(input: string): string | null;
|
|
47
|
+
/** Fetch a single issue by its key using the connection credentials. */
|
|
48
|
+
fetchTask(credentials: TaskCredentials, externalId: string): Promise<TaskContent>;
|
|
49
|
+
/**
|
|
50
|
+
* Search the tracker by free text and return lean hits (no description/
|
|
51
|
+
* comments). Optional: a provider that only supports paste-a-URL import omits
|
|
52
|
+
* it (and its descriptor sets `searchable: false`). The provider builds the
|
|
53
|
+
* query and maps the response; the returned `externalId`s are valid import refs.
|
|
54
|
+
*
|
|
55
|
+
* `workspaceId` is the workspace whose connection is searching, so a provider
|
|
56
|
+
* that authenticates per-workspace out-of-band (e.g. the GitHub App, which
|
|
57
|
+
* ignores `credentials`) can scope the search to that workspace's installation
|
|
58
|
+
* instead of leaking across tenants.
|
|
59
|
+
*/
|
|
60
|
+
search?(credentials: TaskCredentials, query: string, workspaceId: string): Promise<TaskSearchResult[]>;
|
|
61
|
+
}
|
|
62
|
+
/** A lookup of the providers wired for this deployment, keyed by source. */
|
|
63
|
+
export interface TaskSourceRegistry {
|
|
64
|
+
/** The provider for a source, or undefined if that source isn't configured. */
|
|
65
|
+
get(kind: TaskSourceKind): TaskSourceProvider | undefined;
|
|
66
|
+
/** Every configured provider (drives the source list exposed to the UI). */
|
|
67
|
+
list(): TaskSourceProvider[];
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=task-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-source.d.ts","sourceRoot":"","sources":["../../src/ports/task-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACpB,WAAW,EACX,gBAAgB,EACjB,MAAM,oBAAoB,CAAA;AAe3B,qEAAqE;AACrE,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAEpD,YAAY,EAAE,WAAW,EAAE,CAAA;AAE3B,8DAA8D;AAC9D,MAAM,WAAW,WAAW;IAC1B,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAA;IAClB,sCAAsC;IACtC,GAAG,EAAE,MAAM,CAAA;IACX,6B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4EAA4E;IAC5E,IAAI,IAAI,kBAAkB,EAAE,CAAA;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-source.js","sourceRoot":"","sources":["../../src/ports/task-source.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface CreateTicketRequest {
|
|
2
|
+
workspaceId: string;
|
|
3
|
+
/** The service frame the run belongs to (used to resolve the GitHub repo). */
|
|
4
|
+
frameId: string;
|
|
5
|
+
title: string;
|
|
6
|
+
/** Markdown body (the analysis report). */
|
|
7
|
+
body: string;
|
|
8
|
+
}
|
|
9
|
+
/** The filed ticket. */
|
|
10
|
+
export interface CreatedTicket {
|
|
11
|
+
/** Canonical external id (e.g. "owner/repo#123" or "ENG-42"). */
|
|
12
|
+
externalId: string;
|
|
13
|
+
url: string;
|
|
14
|
+
}
|
|
15
|
+
export interface TicketTrackerProvider {
|
|
16
|
+
/** File a ticket, or return null when no tracker is configured for the workspace. */
|
|
17
|
+
createTicket(request: CreateTicketRequest): Promise<CreatedTicket | null>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=ticket-tracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ticket-tracker.d.ts","sourceRoot":"","sources":["../../src/ports/ticket-tracker.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAA;CACb;AAED,wBAAwB;AACxB,MAAM,WAAW,aAAa;IAC5B,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAA;IAClB,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,qBAAqB;IACpC,qFAAqF;IACrF,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAA;CAC1E"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Issue-tracker write port. The tech-debt recurring pipeline's `tracker` step
|
|
2
|
+
// asks this provider to file a ticket (a GitHub issue or a Jira ticket) for the
|
|
3
|
+
// analysis it just produced, before implementation starts. The concrete provider
|
|
4
|
+
// resolves the workspace's tracker selection, credentials and (for GitHub) the
|
|
5
|
+
// service's repository itself; it returns null when no tracker is configured, so
|
|
6
|
+
// the step passes through.
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=ticket-tracker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ticket-tracker.js","sourceRoot":"","sources":["../../src/ports/ticket-tracker.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,gFAAgF;AAChF,iFAAiF;AACjF,+EAA+E;AAC/E,iFAAiF;AACjF,2BAA2B"}
|