@codeam/shared 2.61.91 → 2.61.92
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/index.d.mts +118 -1
- package/dist/index.d.ts +118 -1
- package/dist/index.js +171 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +160 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -865,6 +865,118 @@ declare function normalizeGuardrailPolicy(raw: unknown): GuardrailPolicy;
|
|
|
865
865
|
/** The wire command that pushes a live policy update to a running session. */
|
|
866
866
|
declare const GUARDRAIL_CONFIGURE_COMMAND = "guardrail_configure";
|
|
867
867
|
|
|
868
|
+
/** Curated packs shipped with the client. Grows over time. */
|
|
869
|
+
type PackId = 'quick-pack' | 'full-pack';
|
|
870
|
+
/** A role inside a pack — one pipeline stage. */
|
|
871
|
+
interface PackStageDef {
|
|
872
|
+
/** Stable role key (also the commit byline: `By <role>.`). */
|
|
873
|
+
role: string;
|
|
874
|
+
/** Display name for the pipeline UI. */
|
|
875
|
+
name: string;
|
|
876
|
+
/** One line: what this specialist does — shown on the pack card. */
|
|
877
|
+
description: string;
|
|
878
|
+
/** Curated skills mounted for this stage (skillFile rail, best-effort). */
|
|
879
|
+
skillIds: string[];
|
|
880
|
+
/** The full role prompt sent (with the pack workflow article + task +
|
|
881
|
+
* previous handoff) as the stage's opening prompt. Read-only in the app. */
|
|
882
|
+
prompt: string;
|
|
883
|
+
}
|
|
884
|
+
interface PackDefinition {
|
|
885
|
+
id: PackId;
|
|
886
|
+
name: string;
|
|
887
|
+
/** One line for the pack card. */
|
|
888
|
+
tagline: string;
|
|
889
|
+
/** Plan gate — 'free' or 'pro' (enforced backend-side on pack_start). */
|
|
890
|
+
gate: 'free' | 'pro';
|
|
891
|
+
stages: PackStageDef[];
|
|
892
|
+
}
|
|
893
|
+
type PackRunStatus = 'running' | 'paused' | 'stalled' | 'completed' | 'aborted' | 'failed';
|
|
894
|
+
type PackStageStatus = 'pending' | 'active' | 'done' | 'failed' | 'skipped';
|
|
895
|
+
/** Mechanically captured proof of what a stage delivered. */
|
|
896
|
+
interface PackHandoffRecord {
|
|
897
|
+
/** Canonical 10-hex commit abbreviation (git-validated, never model-claimed). */
|
|
898
|
+
commit: string;
|
|
899
|
+
/** Short summary of the stage's reply (first lines, capped). */
|
|
900
|
+
summary: string;
|
|
901
|
+
/** `git diff --stat` summary line between the stage's start and end commits. */
|
|
902
|
+
diffStat: string;
|
|
903
|
+
/** Project checks captured at the stage boundary, when a command was available. */
|
|
904
|
+
checks?: {
|
|
905
|
+
command: string;
|
|
906
|
+
passed: boolean;
|
|
907
|
+
tail: string;
|
|
908
|
+
};
|
|
909
|
+
durationMs: number;
|
|
910
|
+
}
|
|
911
|
+
interface PackStageState {
|
|
912
|
+
role: string;
|
|
913
|
+
name: string;
|
|
914
|
+
status: PackStageStatus;
|
|
915
|
+
/** ACP conversation id for this stage — mobile deep-links the stage chat. */
|
|
916
|
+
conversationId?: string;
|
|
917
|
+
handoff?: PackHandoffRecord;
|
|
918
|
+
/** Populated when status === 'failed' (or the run stalled on this stage). */
|
|
919
|
+
error?: string;
|
|
920
|
+
}
|
|
921
|
+
interface PackRunState {
|
|
922
|
+
runId: string;
|
|
923
|
+
packId: PackId;
|
|
924
|
+
/** The user's task, verbatim. */
|
|
925
|
+
task: string;
|
|
926
|
+
status: PackRunStatus;
|
|
927
|
+
/** Index into `stages` of the stage currently active/next. */
|
|
928
|
+
currentStage: number;
|
|
929
|
+
stages: PackStageState[];
|
|
930
|
+
/** Set when status is 'stalled' | 'failed' — the honest reason. */
|
|
931
|
+
stalledReason?: string;
|
|
932
|
+
startedAt: string;
|
|
933
|
+
updatedAt: string;
|
|
934
|
+
}
|
|
935
|
+
/** Relay command: start a pack run on the session. */
|
|
936
|
+
interface PackStartPayload {
|
|
937
|
+
packId: PackId;
|
|
938
|
+
task: string;
|
|
939
|
+
}
|
|
940
|
+
type PackActionKind = 'pause' | 'resume' | 'retry_stage' | 'skip_stage' | 'abort';
|
|
941
|
+
/** Relay command: mutate the active run. */
|
|
942
|
+
interface PackActionPayload {
|
|
943
|
+
action: PackActionKind;
|
|
944
|
+
}
|
|
945
|
+
declare const PACK_START_COMMAND = "pack_start";
|
|
946
|
+
declare const PACK_ACTION_COMMAND = "pack_action";
|
|
947
|
+
declare const PACK_STATUS_COMMAND = "pack_status";
|
|
948
|
+
|
|
949
|
+
/**
|
|
950
|
+
* The curated pack registry — same model as SKILL_REGISTRY: bundled content
|
|
951
|
+
* selected by id. Adding a pack = a stages list here + widening `PackId`.
|
|
952
|
+
* Role prompts are shared building blocks (roles.ts); a pack is a pipeline
|
|
953
|
+
* of roles. v1 ships two presets; the custom builder is a fast-follow.
|
|
954
|
+
*/
|
|
955
|
+
declare const PACK_REGISTRY: Record<PackId, PackDefinition>;
|
|
956
|
+
declare function isPackId(id: string): id is PackId;
|
|
957
|
+
declare function getPackDefinition(id: string): PackDefinition | null;
|
|
958
|
+
|
|
959
|
+
/**
|
|
960
|
+
* Curated role prompts — shared across packs. Each is the specialist's full
|
|
961
|
+
* working brief: mission, method, and the handoff bar it must clear. Kept
|
|
962
|
+
* role-scoped and repo-agnostic; the pipeline rules ride separately
|
|
963
|
+
* (PACK_WORKFLOW_ARTICLE) and the task + previous handoff are appended by the
|
|
964
|
+
* runner at stage start.
|
|
965
|
+
*/
|
|
966
|
+
declare const SPECIFIER_PROMPT = "# Role: Specifier\n\nYou turn the user's task into a precise, testable specification the rest of the pipeline implements against. You do NOT write implementation code.\n\nMethod:\n1. Read the task and explore the relevant parts of the codebase until you understand the real problem, the desired outcome, and the constraints the code imposes.\n2. Write the specification to `SPEC.pack.md` at the repo root:\n - **Problem** \u2014 what is wrong or missing, and for whom.\n - **Outcome** \u2014 what must be true when this is done.\n - **Acceptance criteria** \u2014 a numbered checklist of observable, testable conditions. Each criterion must be verifiable by a test or a concrete manual check. They must fully cover the outcome.\n - **Out of scope** \u2014 what this task deliberately does not touch.\n - **Verification plan** \u2014 for each criterion, the level that proves it (unit / integration / manual) and why.\n3. Right-size: if the task is clearly too large for one pipeline run, narrow the criteria to a coherent first slice and record the rest under \"Out of scope / next\".\n\nHandoff bar: the spec file is committed; every acceptance criterion is testable as written; a competent implementer could start without asking you anything.";
|
|
967
|
+
declare const CODER_PROMPT = "# Role: Coder\n\nYou implement the task with test-driven discipline. You are the only stage that adds behavior.\n\nMethod:\n1. Read the task \u2014 and `SPEC.pack.md` if a Specifier stage produced one; its acceptance criteria are your contract. Without a spec, derive the minimal criteria from the task itself before coding.\n2. Test-first where it fits: write the test that proves a criterion, watch it fail, implement until it passes. Where strict test-first doesn't fit, still land tests alongside the change.\n3. Match the project's existing style, structure, and conventions. Simplest design that fully solves the problem \u2014 no speculative abstractions, no \"while I'm here\" changes.\n4. Run the project's tests / linters / build and make them pass.\n\nHandoff bar: every acceptance criterion is implemented and covered by a test; the project's checks pass; the work is committed in focused commits.";
|
|
968
|
+
declare const REVIEWER_PROMPT = "# Role: Reviewer\n\nYou are a skeptical senior reviewer with fresh eyes \u2014 you did NOT write this code, and your job is to find what's wrong, not to approve it. You also own architectural cleanliness for this change.\n\nMethod:\n1. Read the task, `SPEC.pack.md` (when present), and the diff of the pipeline's commits (`git log` + `git diff` against the state before the pipeline's first commit). Read enough surrounding code to judge in context.\n2. Audit, in priority order:\n - **Correctness** \u2014 logic, edge cases, error paths. For each acceptance criterion: point to the test that proves it, and check the test would FAIL if the behavior broke.\n - **Scope** \u2014 anything beyond the task is flagged and reverted unless it is load-bearing.\n - **Design** \u2014 duplication, dead code, needless complexity, dependency direction, encapsulation. Verify every API/library call actually exists in the project's dependencies.\n - **Conventions & naming** \u2014 matches the surrounding code; names say what things are.\n - **Safety** \u2014 no secrets, credentials, or debugging remnants in code, tests, or fixtures.\n3. Fix what is justified \u2014 smallest change that resolves the finding, keeping behavior. Re-run the checks after material fixes.\n4. Record your findings honestly in your closing summary: what you found, what you fixed, what you deliberately left, and what you could not verify.\n\nHandoff bar: checks pass on YOUR final commit; every fix is committed; your summary lists findings \u2192 resolutions (an empty findings list must say what you checked).";
|
|
969
|
+
declare const QA_PROMPT = "# Role: QA\n\nYou are the final gate. You verify the delivered work against the acceptance criteria as a whole \u2014 end to end, the way a demanding user would \u2014 and produce the run's closing report.\n\nMethod:\n1. Read the task and `SPEC.pack.md` (when present). Your contract is the acceptance criteria; without a spec, derive them from the task.\n2. For EACH criterion, verify it against the real project: run the relevant tests, execute the code paths where feasible, inspect actual behavior/output. Do not take earlier stages' word for anything.\n3. Run the project's full checks (tests, lint, types, build) one final time.\n4. Write `QA-REPORT.pack.md` at the repo root: per-criterion verdict (\u2705 verified / \u26A0\uFE0F partially / \u274C failed \u2014 with evidence for each), the checks' results, anything not verifiable in this environment (stated plainly), and a short \"ready to ship?\" conclusion.\n5. If a criterion FAILS: fix it only when the fix is small and unambiguous; otherwise mark it failed with exact evidence \u2014 the user decides. Never paper over a failure.\n\nHandoff bar: the report is committed; every verdict carries evidence; the conclusion is honest about anything unverified.";
|
|
970
|
+
|
|
971
|
+
/**
|
|
972
|
+
* The pack **workflow article** — the shared constitution layer every stage
|
|
973
|
+
* prompt carries (on top of the always-on Agent Standard the session already
|
|
974
|
+
* has). It encodes the handoff discipline that makes the pipeline auditable:
|
|
975
|
+
* commit per stage with the role byline, stay in stage scope, never touch the
|
|
976
|
+
* run ledger. Layered-constitution model adapted from swarm-forge.
|
|
977
|
+
*/
|
|
978
|
+
declare const PACK_WORKFLOW_ARTICLE = "## Pipeline rules (you are one stage of an assembly line)\n\nYou are ONE specialist role in a multi-role pipeline running on this repository. Other specialist roles ran before you and/or run after you, each in a separate conversation. Follow these rules exactly:\n\n- **Do only your role's job.** The next stage exists for a reason \u2014 don't do its work, and don't redo a previous stage's work unless your role explicitly calls for correcting it.\n- **Work from the handoff.** The previous stage's handoff (commit + summary) is your input. Start by reading the current state of the working tree \u2014 it already contains all prior stages' work.\n- **Commit your work when your stage is complete.** One or more focused commits; the final state of the tree IS your handoff to the next stage. End every commit message with your role byline on its own line: `By <role>.`\n- **Never leave the tree broken.** Run the project's checks before finishing when the project has them; your stage ends with a working tree the next role can build on.\n- **Do not push, force-push, or touch remotes** \u2014 the pipeline works locally; publishing is the user's call at the end.\n- **Never read, edit, or commit anything under `.codeam/`** \u2014 that is the pipeline's own ledger, not project code.\n- **Finish decisively.** When your stage's job is done and committed, say so in 2-4 lines (what you did, what you verified, anything the next stage should know) and stop. Don't ask \"should I continue?\" \u2014 the pipeline advances automatically.\n- **If you are genuinely blocked** (contradictory requirements, missing access), say exactly what is blocking you and stop \u2014 the user is supervising and will decide.";
|
|
979
|
+
|
|
868
980
|
/**
|
|
869
981
|
* Wire-shape types for the CLI / IDE-plugin → backend producer endpoints
|
|
870
982
|
* that feed the mobile Files screen and the Pending Review Queue:
|
|
@@ -1682,6 +1794,11 @@ declare const USER_EVENTS: {
|
|
|
1682
1794
|
* produced by api-v2 (the CLI neither produces nor consumes it). Mirrored in
|
|
1683
1795
|
* repo A. */
|
|
1684
1796
|
readonly PR_REVIEW_LAUNCH: "pr_review_launch";
|
|
1797
|
+
/** Agent Packs — full `PackRunState` republished by the backend on every
|
|
1798
|
+
* pipeline transition (stage start/done, pause, stall, completion). CLI
|
|
1799
|
+
* posts to /api/packs/events; mobile's pack.store renders the pipeline.
|
|
1800
|
+
* Mirrored in repo A's app-shared events.ts. */
|
|
1801
|
+
readonly PACK_STATE: "pack_state";
|
|
1685
1802
|
};
|
|
1686
1803
|
type UserEventName = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
|
|
1687
1804
|
|
|
@@ -1697,4 +1814,4 @@ type UserEventName = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
|
|
|
1697
1814
|
*/
|
|
1698
1815
|
declare const PREVIEW_DETECT_PROMPT: string;
|
|
1699
1816
|
|
|
1700
|
-
export { AGENT_REGISTRY, AGENT_STANDARD_BLOCK, AGENT_STANDARD_MARKER, AGENT_STANDARD_TEXT, type AgentAuth, type AgentAuthKind, type AgentId, type AgentMetadata, type AgentMode, type AgentModel, type AgentReviewFinding, type AgentReviewPlan, type AgentReviewReport, type AnswerResolvedEvent, type AwaitingAnswerEvent, type BeadsActionCommand, type BeadsActionKind, type BeadsActionPayload, type BeadsActionRequest, type BeadsActionType, type BeadsConfigureAction, type BeadsDependencyDto, type BeadsDependencyKind, type BeadsIngestPayload, type BeadsIssueDto, type BeadsIssueStatus, type BeadsMemoryDto, type BeadsProjectDto, type BeadsProvisioningPayload, type BeadsProvisioningStatus, type BeadsSnapshotDto, type BeadsStatus, type BeadsStatusState, type BeadsStatusSummary, type BlameLineWire, type BrokeredIntegrationToken, type ChromeStep, type ChromeToolType, type CommitEntryWire, DEFAULT_API_BASE_URL, DEFAULT_GUARDRAIL_POLICY, DEP_TO_INTEGRATION, DEV_API_BASE_URL, type DerivedCredentialSource, type EnvVar, type FileBlameEvent, type FileChangeStatus, type FileChangedEvent, type FileHistoryEvent, type FileReviewStatus, GUARDRAIL_CATEGORIES, GUARDRAIL_CATEGORY_META, GUARDRAIL_CONFIGURE_COMMAND, GUARDRAIL_DISPOSITIONS, type GuardrailCategory, type GuardrailCategoryMeta, type GuardrailDisposition, type GuardrailPolicy, HEADROOM_BACKEND_ENV, HEADROOM_EXTRAS_BY_SURFACE, HEADROOM_MODELS, HEADROOM_PIP_COMPANIONS, HEADROOM_PROXY_PORT, HEARTBEAT_INTERVAL_MS_DEFAULT, HOUSE_AGENT_ID, HOUSE_AGENT_NAME, HOUSE_AGENT_PROVIDER, HOUSE_AGENT_SUBTITLE, HOUSE_AGENT_VENDOR, type HeadroomBudgetCommand, type HeadroomBudgetPeriod, type HeadroomBudgetUsage, type HeadroomKind, type HeadroomModelSpec, type HeadroomPythonRenderOpts, type HeadroomStatus, type HeadroomStep, type HeadroomSurface, type HunkLineType, INTEGRATION_BRANDING, INTEGRATION_REGISTRY, INTERNAL_TO_PUBLIC, type InputSuggestionChunk, type IntegrationApiKeyField, type IntegrationAuthKind, type IntegrationBranding, type IntegrationCategory, type IntegrationDefinition, type IntegrationDelivery, type IntegrationHealth, type IntegrationId, type IntegrationMcpDelivery, type IntegrationStatus, type IntegrationsManifest, type IntegrationsManifestEntry, LINKED_AGENT_IDS, type LinkedAgentId, MODEL_CONTEXT_WINDOW, MODEL_PRICING, type ModelPricing, type NormalizedMessage, OBSERVER_BRIDGE_PORT, PREVIEW_DETECT_PROMPT, PROTOCOL_VERSION, PUBLIC_TO_INTERNAL, type PendingReviewHunkEvent, type PendingReviewHunkLine, type PrCheck, type PrRef, type PrReviewEntry, type PrReviewVerdict, type PreviewDetection, type PreviewErrorStage, type PreviewState, type PreviewStatus, type PullRequestDetail, type PullRequestSummary, type RemoteCommand, type RepoStack, type RepoStackDetection, SKILL_REGISTRY, SSE_SOCKET_TIMEOUT_MS, STACK_TO_RECOMMENDED, type SelectPrompt, type SkillDefinition, type SkillDelivery, type SkillFileDelivery, type SkillId, type SkillRail, type SkillsManifest, type SkillsManifestEntry, type StreamingChunkEvent, type StreamingChunkKind, TERMINAL_AGENT_PREFIX, UNKNOWN_MODEL_PRICING, UPCOMING_INTEGRATION_IDS, USER_EVENTS, type UserEventName, classifyStack, detectedIntegrationsFromDeps, getAgent, getContextWindow, getEnabledAgents, getEnabledIntegrations, getIntegration, getIntegrationBranding, getIntegrationsByCategory, getPricing, getSkillDefinition, headroomKindFor, headroomModelPredownloadScript, headroomPipPackage, headroomSnapshotDownloadLine, internalToPublic, isGuardrailDisposition, isHeadroomWrappable, isKnownAgentId, isKnownIntegrationId, isKnownModel, isLinkedAgentId, isSkillId, normalizeAgentId, normalizeGuardrailPolicy, publicToInternal, recommendForDeps, renderToLines, resolveApiBaseUrl, skillHasRail, toRemoteCommand, tryGetContextWindow };
|
|
1817
|
+
export { AGENT_REGISTRY, AGENT_STANDARD_BLOCK, AGENT_STANDARD_MARKER, AGENT_STANDARD_TEXT, type AgentAuth, type AgentAuthKind, type AgentId, type AgentMetadata, type AgentMode, type AgentModel, type AgentReviewFinding, type AgentReviewPlan, type AgentReviewReport, type AnswerResolvedEvent, type AwaitingAnswerEvent, type BeadsActionCommand, type BeadsActionKind, type BeadsActionPayload, type BeadsActionRequest, type BeadsActionType, type BeadsConfigureAction, type BeadsDependencyDto, type BeadsDependencyKind, type BeadsIngestPayload, type BeadsIssueDto, type BeadsIssueStatus, type BeadsMemoryDto, type BeadsProjectDto, type BeadsProvisioningPayload, type BeadsProvisioningStatus, type BeadsSnapshotDto, type BeadsStatus, type BeadsStatusState, type BeadsStatusSummary, type BlameLineWire, type BrokeredIntegrationToken, CODER_PROMPT, type ChromeStep, type ChromeToolType, type CommitEntryWire, DEFAULT_API_BASE_URL, DEFAULT_GUARDRAIL_POLICY, DEP_TO_INTEGRATION, DEV_API_BASE_URL, type DerivedCredentialSource, type EnvVar, type FileBlameEvent, type FileChangeStatus, type FileChangedEvent, type FileHistoryEvent, type FileReviewStatus, GUARDRAIL_CATEGORIES, GUARDRAIL_CATEGORY_META, GUARDRAIL_CONFIGURE_COMMAND, GUARDRAIL_DISPOSITIONS, type GuardrailCategory, type GuardrailCategoryMeta, type GuardrailDisposition, type GuardrailPolicy, HEADROOM_BACKEND_ENV, HEADROOM_EXTRAS_BY_SURFACE, HEADROOM_MODELS, HEADROOM_PIP_COMPANIONS, HEADROOM_PROXY_PORT, HEARTBEAT_INTERVAL_MS_DEFAULT, HOUSE_AGENT_ID, HOUSE_AGENT_NAME, HOUSE_AGENT_PROVIDER, HOUSE_AGENT_SUBTITLE, HOUSE_AGENT_VENDOR, type HeadroomBudgetCommand, type HeadroomBudgetPeriod, type HeadroomBudgetUsage, type HeadroomKind, type HeadroomModelSpec, type HeadroomPythonRenderOpts, type HeadroomStatus, type HeadroomStep, type HeadroomSurface, type HunkLineType, INTEGRATION_BRANDING, INTEGRATION_REGISTRY, INTERNAL_TO_PUBLIC, type InputSuggestionChunk, type IntegrationApiKeyField, type IntegrationAuthKind, type IntegrationBranding, type IntegrationCategory, type IntegrationDefinition, type IntegrationDelivery, type IntegrationHealth, type IntegrationId, type IntegrationMcpDelivery, type IntegrationStatus, type IntegrationsManifest, type IntegrationsManifestEntry, LINKED_AGENT_IDS, type LinkedAgentId, MODEL_CONTEXT_WINDOW, MODEL_PRICING, type ModelPricing, type NormalizedMessage, OBSERVER_BRIDGE_PORT, PACK_ACTION_COMMAND, PACK_REGISTRY, PACK_START_COMMAND, PACK_STATUS_COMMAND, PACK_WORKFLOW_ARTICLE, PREVIEW_DETECT_PROMPT, PROTOCOL_VERSION, PUBLIC_TO_INTERNAL, type PackActionKind, type PackActionPayload, type PackDefinition, type PackHandoffRecord, type PackId, type PackRunState, type PackRunStatus, type PackStageDef, type PackStageState, type PackStageStatus, type PackStartPayload, type PendingReviewHunkEvent, type PendingReviewHunkLine, type PrCheck, type PrRef, type PrReviewEntry, type PrReviewVerdict, type PreviewDetection, type PreviewErrorStage, type PreviewState, type PreviewStatus, type PullRequestDetail, type PullRequestSummary, QA_PROMPT, REVIEWER_PROMPT, type RemoteCommand, type RepoStack, type RepoStackDetection, SKILL_REGISTRY, SPECIFIER_PROMPT, SSE_SOCKET_TIMEOUT_MS, STACK_TO_RECOMMENDED, type SelectPrompt, type SkillDefinition, type SkillDelivery, type SkillFileDelivery, type SkillId, type SkillRail, type SkillsManifest, type SkillsManifestEntry, type StreamingChunkEvent, type StreamingChunkKind, TERMINAL_AGENT_PREFIX, UNKNOWN_MODEL_PRICING, UPCOMING_INTEGRATION_IDS, USER_EVENTS, type UserEventName, classifyStack, detectedIntegrationsFromDeps, getAgent, getContextWindow, getEnabledAgents, getEnabledIntegrations, getIntegration, getIntegrationBranding, getIntegrationsByCategory, getPackDefinition, getPricing, getSkillDefinition, headroomKindFor, headroomModelPredownloadScript, headroomPipPackage, headroomSnapshotDownloadLine, internalToPublic, isGuardrailDisposition, isHeadroomWrappable, isKnownAgentId, isKnownIntegrationId, isKnownModel, isLinkedAgentId, isPackId, isSkillId, normalizeAgentId, normalizeGuardrailPolicy, publicToInternal, recommendForDeps, renderToLines, resolveApiBaseUrl, skillHasRail, toRemoteCommand, tryGetContextWindow };
|
package/dist/index.d.ts
CHANGED
|
@@ -865,6 +865,118 @@ declare function normalizeGuardrailPolicy(raw: unknown): GuardrailPolicy;
|
|
|
865
865
|
/** The wire command that pushes a live policy update to a running session. */
|
|
866
866
|
declare const GUARDRAIL_CONFIGURE_COMMAND = "guardrail_configure";
|
|
867
867
|
|
|
868
|
+
/** Curated packs shipped with the client. Grows over time. */
|
|
869
|
+
type PackId = 'quick-pack' | 'full-pack';
|
|
870
|
+
/** A role inside a pack — one pipeline stage. */
|
|
871
|
+
interface PackStageDef {
|
|
872
|
+
/** Stable role key (also the commit byline: `By <role>.`). */
|
|
873
|
+
role: string;
|
|
874
|
+
/** Display name for the pipeline UI. */
|
|
875
|
+
name: string;
|
|
876
|
+
/** One line: what this specialist does — shown on the pack card. */
|
|
877
|
+
description: string;
|
|
878
|
+
/** Curated skills mounted for this stage (skillFile rail, best-effort). */
|
|
879
|
+
skillIds: string[];
|
|
880
|
+
/** The full role prompt sent (with the pack workflow article + task +
|
|
881
|
+
* previous handoff) as the stage's opening prompt. Read-only in the app. */
|
|
882
|
+
prompt: string;
|
|
883
|
+
}
|
|
884
|
+
interface PackDefinition {
|
|
885
|
+
id: PackId;
|
|
886
|
+
name: string;
|
|
887
|
+
/** One line for the pack card. */
|
|
888
|
+
tagline: string;
|
|
889
|
+
/** Plan gate — 'free' or 'pro' (enforced backend-side on pack_start). */
|
|
890
|
+
gate: 'free' | 'pro';
|
|
891
|
+
stages: PackStageDef[];
|
|
892
|
+
}
|
|
893
|
+
type PackRunStatus = 'running' | 'paused' | 'stalled' | 'completed' | 'aborted' | 'failed';
|
|
894
|
+
type PackStageStatus = 'pending' | 'active' | 'done' | 'failed' | 'skipped';
|
|
895
|
+
/** Mechanically captured proof of what a stage delivered. */
|
|
896
|
+
interface PackHandoffRecord {
|
|
897
|
+
/** Canonical 10-hex commit abbreviation (git-validated, never model-claimed). */
|
|
898
|
+
commit: string;
|
|
899
|
+
/** Short summary of the stage's reply (first lines, capped). */
|
|
900
|
+
summary: string;
|
|
901
|
+
/** `git diff --stat` summary line between the stage's start and end commits. */
|
|
902
|
+
diffStat: string;
|
|
903
|
+
/** Project checks captured at the stage boundary, when a command was available. */
|
|
904
|
+
checks?: {
|
|
905
|
+
command: string;
|
|
906
|
+
passed: boolean;
|
|
907
|
+
tail: string;
|
|
908
|
+
};
|
|
909
|
+
durationMs: number;
|
|
910
|
+
}
|
|
911
|
+
interface PackStageState {
|
|
912
|
+
role: string;
|
|
913
|
+
name: string;
|
|
914
|
+
status: PackStageStatus;
|
|
915
|
+
/** ACP conversation id for this stage — mobile deep-links the stage chat. */
|
|
916
|
+
conversationId?: string;
|
|
917
|
+
handoff?: PackHandoffRecord;
|
|
918
|
+
/** Populated when status === 'failed' (or the run stalled on this stage). */
|
|
919
|
+
error?: string;
|
|
920
|
+
}
|
|
921
|
+
interface PackRunState {
|
|
922
|
+
runId: string;
|
|
923
|
+
packId: PackId;
|
|
924
|
+
/** The user's task, verbatim. */
|
|
925
|
+
task: string;
|
|
926
|
+
status: PackRunStatus;
|
|
927
|
+
/** Index into `stages` of the stage currently active/next. */
|
|
928
|
+
currentStage: number;
|
|
929
|
+
stages: PackStageState[];
|
|
930
|
+
/** Set when status is 'stalled' | 'failed' — the honest reason. */
|
|
931
|
+
stalledReason?: string;
|
|
932
|
+
startedAt: string;
|
|
933
|
+
updatedAt: string;
|
|
934
|
+
}
|
|
935
|
+
/** Relay command: start a pack run on the session. */
|
|
936
|
+
interface PackStartPayload {
|
|
937
|
+
packId: PackId;
|
|
938
|
+
task: string;
|
|
939
|
+
}
|
|
940
|
+
type PackActionKind = 'pause' | 'resume' | 'retry_stage' | 'skip_stage' | 'abort';
|
|
941
|
+
/** Relay command: mutate the active run. */
|
|
942
|
+
interface PackActionPayload {
|
|
943
|
+
action: PackActionKind;
|
|
944
|
+
}
|
|
945
|
+
declare const PACK_START_COMMAND = "pack_start";
|
|
946
|
+
declare const PACK_ACTION_COMMAND = "pack_action";
|
|
947
|
+
declare const PACK_STATUS_COMMAND = "pack_status";
|
|
948
|
+
|
|
949
|
+
/**
|
|
950
|
+
* The curated pack registry — same model as SKILL_REGISTRY: bundled content
|
|
951
|
+
* selected by id. Adding a pack = a stages list here + widening `PackId`.
|
|
952
|
+
* Role prompts are shared building blocks (roles.ts); a pack is a pipeline
|
|
953
|
+
* of roles. v1 ships two presets; the custom builder is a fast-follow.
|
|
954
|
+
*/
|
|
955
|
+
declare const PACK_REGISTRY: Record<PackId, PackDefinition>;
|
|
956
|
+
declare function isPackId(id: string): id is PackId;
|
|
957
|
+
declare function getPackDefinition(id: string): PackDefinition | null;
|
|
958
|
+
|
|
959
|
+
/**
|
|
960
|
+
* Curated role prompts — shared across packs. Each is the specialist's full
|
|
961
|
+
* working brief: mission, method, and the handoff bar it must clear. Kept
|
|
962
|
+
* role-scoped and repo-agnostic; the pipeline rules ride separately
|
|
963
|
+
* (PACK_WORKFLOW_ARTICLE) and the task + previous handoff are appended by the
|
|
964
|
+
* runner at stage start.
|
|
965
|
+
*/
|
|
966
|
+
declare const SPECIFIER_PROMPT = "# Role: Specifier\n\nYou turn the user's task into a precise, testable specification the rest of the pipeline implements against. You do NOT write implementation code.\n\nMethod:\n1. Read the task and explore the relevant parts of the codebase until you understand the real problem, the desired outcome, and the constraints the code imposes.\n2. Write the specification to `SPEC.pack.md` at the repo root:\n - **Problem** \u2014 what is wrong or missing, and for whom.\n - **Outcome** \u2014 what must be true when this is done.\n - **Acceptance criteria** \u2014 a numbered checklist of observable, testable conditions. Each criterion must be verifiable by a test or a concrete manual check. They must fully cover the outcome.\n - **Out of scope** \u2014 what this task deliberately does not touch.\n - **Verification plan** \u2014 for each criterion, the level that proves it (unit / integration / manual) and why.\n3. Right-size: if the task is clearly too large for one pipeline run, narrow the criteria to a coherent first slice and record the rest under \"Out of scope / next\".\n\nHandoff bar: the spec file is committed; every acceptance criterion is testable as written; a competent implementer could start without asking you anything.";
|
|
967
|
+
declare const CODER_PROMPT = "# Role: Coder\n\nYou implement the task with test-driven discipline. You are the only stage that adds behavior.\n\nMethod:\n1. Read the task \u2014 and `SPEC.pack.md` if a Specifier stage produced one; its acceptance criteria are your contract. Without a spec, derive the minimal criteria from the task itself before coding.\n2. Test-first where it fits: write the test that proves a criterion, watch it fail, implement until it passes. Where strict test-first doesn't fit, still land tests alongside the change.\n3. Match the project's existing style, structure, and conventions. Simplest design that fully solves the problem \u2014 no speculative abstractions, no \"while I'm here\" changes.\n4. Run the project's tests / linters / build and make them pass.\n\nHandoff bar: every acceptance criterion is implemented and covered by a test; the project's checks pass; the work is committed in focused commits.";
|
|
968
|
+
declare const REVIEWER_PROMPT = "# Role: Reviewer\n\nYou are a skeptical senior reviewer with fresh eyes \u2014 you did NOT write this code, and your job is to find what's wrong, not to approve it. You also own architectural cleanliness for this change.\n\nMethod:\n1. Read the task, `SPEC.pack.md` (when present), and the diff of the pipeline's commits (`git log` + `git diff` against the state before the pipeline's first commit). Read enough surrounding code to judge in context.\n2. Audit, in priority order:\n - **Correctness** \u2014 logic, edge cases, error paths. For each acceptance criterion: point to the test that proves it, and check the test would FAIL if the behavior broke.\n - **Scope** \u2014 anything beyond the task is flagged and reverted unless it is load-bearing.\n - **Design** \u2014 duplication, dead code, needless complexity, dependency direction, encapsulation. Verify every API/library call actually exists in the project's dependencies.\n - **Conventions & naming** \u2014 matches the surrounding code; names say what things are.\n - **Safety** \u2014 no secrets, credentials, or debugging remnants in code, tests, or fixtures.\n3. Fix what is justified \u2014 smallest change that resolves the finding, keeping behavior. Re-run the checks after material fixes.\n4. Record your findings honestly in your closing summary: what you found, what you fixed, what you deliberately left, and what you could not verify.\n\nHandoff bar: checks pass on YOUR final commit; every fix is committed; your summary lists findings \u2192 resolutions (an empty findings list must say what you checked).";
|
|
969
|
+
declare const QA_PROMPT = "# Role: QA\n\nYou are the final gate. You verify the delivered work against the acceptance criteria as a whole \u2014 end to end, the way a demanding user would \u2014 and produce the run's closing report.\n\nMethod:\n1. Read the task and `SPEC.pack.md` (when present). Your contract is the acceptance criteria; without a spec, derive them from the task.\n2. For EACH criterion, verify it against the real project: run the relevant tests, execute the code paths where feasible, inspect actual behavior/output. Do not take earlier stages' word for anything.\n3. Run the project's full checks (tests, lint, types, build) one final time.\n4. Write `QA-REPORT.pack.md` at the repo root: per-criterion verdict (\u2705 verified / \u26A0\uFE0F partially / \u274C failed \u2014 with evidence for each), the checks' results, anything not verifiable in this environment (stated plainly), and a short \"ready to ship?\" conclusion.\n5. If a criterion FAILS: fix it only when the fix is small and unambiguous; otherwise mark it failed with exact evidence \u2014 the user decides. Never paper over a failure.\n\nHandoff bar: the report is committed; every verdict carries evidence; the conclusion is honest about anything unverified.";
|
|
970
|
+
|
|
971
|
+
/**
|
|
972
|
+
* The pack **workflow article** — the shared constitution layer every stage
|
|
973
|
+
* prompt carries (on top of the always-on Agent Standard the session already
|
|
974
|
+
* has). It encodes the handoff discipline that makes the pipeline auditable:
|
|
975
|
+
* commit per stage with the role byline, stay in stage scope, never touch the
|
|
976
|
+
* run ledger. Layered-constitution model adapted from swarm-forge.
|
|
977
|
+
*/
|
|
978
|
+
declare const PACK_WORKFLOW_ARTICLE = "## Pipeline rules (you are one stage of an assembly line)\n\nYou are ONE specialist role in a multi-role pipeline running on this repository. Other specialist roles ran before you and/or run after you, each in a separate conversation. Follow these rules exactly:\n\n- **Do only your role's job.** The next stage exists for a reason \u2014 don't do its work, and don't redo a previous stage's work unless your role explicitly calls for correcting it.\n- **Work from the handoff.** The previous stage's handoff (commit + summary) is your input. Start by reading the current state of the working tree \u2014 it already contains all prior stages' work.\n- **Commit your work when your stage is complete.** One or more focused commits; the final state of the tree IS your handoff to the next stage. End every commit message with your role byline on its own line: `By <role>.`\n- **Never leave the tree broken.** Run the project's checks before finishing when the project has them; your stage ends with a working tree the next role can build on.\n- **Do not push, force-push, or touch remotes** \u2014 the pipeline works locally; publishing is the user's call at the end.\n- **Never read, edit, or commit anything under `.codeam/`** \u2014 that is the pipeline's own ledger, not project code.\n- **Finish decisively.** When your stage's job is done and committed, say so in 2-4 lines (what you did, what you verified, anything the next stage should know) and stop. Don't ask \"should I continue?\" \u2014 the pipeline advances automatically.\n- **If you are genuinely blocked** (contradictory requirements, missing access), say exactly what is blocking you and stop \u2014 the user is supervising and will decide.";
|
|
979
|
+
|
|
868
980
|
/**
|
|
869
981
|
* Wire-shape types for the CLI / IDE-plugin → backend producer endpoints
|
|
870
982
|
* that feed the mobile Files screen and the Pending Review Queue:
|
|
@@ -1682,6 +1794,11 @@ declare const USER_EVENTS: {
|
|
|
1682
1794
|
* produced by api-v2 (the CLI neither produces nor consumes it). Mirrored in
|
|
1683
1795
|
* repo A. */
|
|
1684
1796
|
readonly PR_REVIEW_LAUNCH: "pr_review_launch";
|
|
1797
|
+
/** Agent Packs — full `PackRunState` republished by the backend on every
|
|
1798
|
+
* pipeline transition (stage start/done, pause, stall, completion). CLI
|
|
1799
|
+
* posts to /api/packs/events; mobile's pack.store renders the pipeline.
|
|
1800
|
+
* Mirrored in repo A's app-shared events.ts. */
|
|
1801
|
+
readonly PACK_STATE: "pack_state";
|
|
1685
1802
|
};
|
|
1686
1803
|
type UserEventName = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
|
|
1687
1804
|
|
|
@@ -1697,4 +1814,4 @@ type UserEventName = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
|
|
|
1697
1814
|
*/
|
|
1698
1815
|
declare const PREVIEW_DETECT_PROMPT: string;
|
|
1699
1816
|
|
|
1700
|
-
export { AGENT_REGISTRY, AGENT_STANDARD_BLOCK, AGENT_STANDARD_MARKER, AGENT_STANDARD_TEXT, type AgentAuth, type AgentAuthKind, type AgentId, type AgentMetadata, type AgentMode, type AgentModel, type AgentReviewFinding, type AgentReviewPlan, type AgentReviewReport, type AnswerResolvedEvent, type AwaitingAnswerEvent, type BeadsActionCommand, type BeadsActionKind, type BeadsActionPayload, type BeadsActionRequest, type BeadsActionType, type BeadsConfigureAction, type BeadsDependencyDto, type BeadsDependencyKind, type BeadsIngestPayload, type BeadsIssueDto, type BeadsIssueStatus, type BeadsMemoryDto, type BeadsProjectDto, type BeadsProvisioningPayload, type BeadsProvisioningStatus, type BeadsSnapshotDto, type BeadsStatus, type BeadsStatusState, type BeadsStatusSummary, type BlameLineWire, type BrokeredIntegrationToken, type ChromeStep, type ChromeToolType, type CommitEntryWire, DEFAULT_API_BASE_URL, DEFAULT_GUARDRAIL_POLICY, DEP_TO_INTEGRATION, DEV_API_BASE_URL, type DerivedCredentialSource, type EnvVar, type FileBlameEvent, type FileChangeStatus, type FileChangedEvent, type FileHistoryEvent, type FileReviewStatus, GUARDRAIL_CATEGORIES, GUARDRAIL_CATEGORY_META, GUARDRAIL_CONFIGURE_COMMAND, GUARDRAIL_DISPOSITIONS, type GuardrailCategory, type GuardrailCategoryMeta, type GuardrailDisposition, type GuardrailPolicy, HEADROOM_BACKEND_ENV, HEADROOM_EXTRAS_BY_SURFACE, HEADROOM_MODELS, HEADROOM_PIP_COMPANIONS, HEADROOM_PROXY_PORT, HEARTBEAT_INTERVAL_MS_DEFAULT, HOUSE_AGENT_ID, HOUSE_AGENT_NAME, HOUSE_AGENT_PROVIDER, HOUSE_AGENT_SUBTITLE, HOUSE_AGENT_VENDOR, type HeadroomBudgetCommand, type HeadroomBudgetPeriod, type HeadroomBudgetUsage, type HeadroomKind, type HeadroomModelSpec, type HeadroomPythonRenderOpts, type HeadroomStatus, type HeadroomStep, type HeadroomSurface, type HunkLineType, INTEGRATION_BRANDING, INTEGRATION_REGISTRY, INTERNAL_TO_PUBLIC, type InputSuggestionChunk, type IntegrationApiKeyField, type IntegrationAuthKind, type IntegrationBranding, type IntegrationCategory, type IntegrationDefinition, type IntegrationDelivery, type IntegrationHealth, type IntegrationId, type IntegrationMcpDelivery, type IntegrationStatus, type IntegrationsManifest, type IntegrationsManifestEntry, LINKED_AGENT_IDS, type LinkedAgentId, MODEL_CONTEXT_WINDOW, MODEL_PRICING, type ModelPricing, type NormalizedMessage, OBSERVER_BRIDGE_PORT, PREVIEW_DETECT_PROMPT, PROTOCOL_VERSION, PUBLIC_TO_INTERNAL, type PendingReviewHunkEvent, type PendingReviewHunkLine, type PrCheck, type PrRef, type PrReviewEntry, type PrReviewVerdict, type PreviewDetection, type PreviewErrorStage, type PreviewState, type PreviewStatus, type PullRequestDetail, type PullRequestSummary, type RemoteCommand, type RepoStack, type RepoStackDetection, SKILL_REGISTRY, SSE_SOCKET_TIMEOUT_MS, STACK_TO_RECOMMENDED, type SelectPrompt, type SkillDefinition, type SkillDelivery, type SkillFileDelivery, type SkillId, type SkillRail, type SkillsManifest, type SkillsManifestEntry, type StreamingChunkEvent, type StreamingChunkKind, TERMINAL_AGENT_PREFIX, UNKNOWN_MODEL_PRICING, UPCOMING_INTEGRATION_IDS, USER_EVENTS, type UserEventName, classifyStack, detectedIntegrationsFromDeps, getAgent, getContextWindow, getEnabledAgents, getEnabledIntegrations, getIntegration, getIntegrationBranding, getIntegrationsByCategory, getPricing, getSkillDefinition, headroomKindFor, headroomModelPredownloadScript, headroomPipPackage, headroomSnapshotDownloadLine, internalToPublic, isGuardrailDisposition, isHeadroomWrappable, isKnownAgentId, isKnownIntegrationId, isKnownModel, isLinkedAgentId, isSkillId, normalizeAgentId, normalizeGuardrailPolicy, publicToInternal, recommendForDeps, renderToLines, resolveApiBaseUrl, skillHasRail, toRemoteCommand, tryGetContextWindow };
|
|
1817
|
+
export { AGENT_REGISTRY, AGENT_STANDARD_BLOCK, AGENT_STANDARD_MARKER, AGENT_STANDARD_TEXT, type AgentAuth, type AgentAuthKind, type AgentId, type AgentMetadata, type AgentMode, type AgentModel, type AgentReviewFinding, type AgentReviewPlan, type AgentReviewReport, type AnswerResolvedEvent, type AwaitingAnswerEvent, type BeadsActionCommand, type BeadsActionKind, type BeadsActionPayload, type BeadsActionRequest, type BeadsActionType, type BeadsConfigureAction, type BeadsDependencyDto, type BeadsDependencyKind, type BeadsIngestPayload, type BeadsIssueDto, type BeadsIssueStatus, type BeadsMemoryDto, type BeadsProjectDto, type BeadsProvisioningPayload, type BeadsProvisioningStatus, type BeadsSnapshotDto, type BeadsStatus, type BeadsStatusState, type BeadsStatusSummary, type BlameLineWire, type BrokeredIntegrationToken, CODER_PROMPT, type ChromeStep, type ChromeToolType, type CommitEntryWire, DEFAULT_API_BASE_URL, DEFAULT_GUARDRAIL_POLICY, DEP_TO_INTEGRATION, DEV_API_BASE_URL, type DerivedCredentialSource, type EnvVar, type FileBlameEvent, type FileChangeStatus, type FileChangedEvent, type FileHistoryEvent, type FileReviewStatus, GUARDRAIL_CATEGORIES, GUARDRAIL_CATEGORY_META, GUARDRAIL_CONFIGURE_COMMAND, GUARDRAIL_DISPOSITIONS, type GuardrailCategory, type GuardrailCategoryMeta, type GuardrailDisposition, type GuardrailPolicy, HEADROOM_BACKEND_ENV, HEADROOM_EXTRAS_BY_SURFACE, HEADROOM_MODELS, HEADROOM_PIP_COMPANIONS, HEADROOM_PROXY_PORT, HEARTBEAT_INTERVAL_MS_DEFAULT, HOUSE_AGENT_ID, HOUSE_AGENT_NAME, HOUSE_AGENT_PROVIDER, HOUSE_AGENT_SUBTITLE, HOUSE_AGENT_VENDOR, type HeadroomBudgetCommand, type HeadroomBudgetPeriod, type HeadroomBudgetUsage, type HeadroomKind, type HeadroomModelSpec, type HeadroomPythonRenderOpts, type HeadroomStatus, type HeadroomStep, type HeadroomSurface, type HunkLineType, INTEGRATION_BRANDING, INTEGRATION_REGISTRY, INTERNAL_TO_PUBLIC, type InputSuggestionChunk, type IntegrationApiKeyField, type IntegrationAuthKind, type IntegrationBranding, type IntegrationCategory, type IntegrationDefinition, type IntegrationDelivery, type IntegrationHealth, type IntegrationId, type IntegrationMcpDelivery, type IntegrationStatus, type IntegrationsManifest, type IntegrationsManifestEntry, LINKED_AGENT_IDS, type LinkedAgentId, MODEL_CONTEXT_WINDOW, MODEL_PRICING, type ModelPricing, type NormalizedMessage, OBSERVER_BRIDGE_PORT, PACK_ACTION_COMMAND, PACK_REGISTRY, PACK_START_COMMAND, PACK_STATUS_COMMAND, PACK_WORKFLOW_ARTICLE, PREVIEW_DETECT_PROMPT, PROTOCOL_VERSION, PUBLIC_TO_INTERNAL, type PackActionKind, type PackActionPayload, type PackDefinition, type PackHandoffRecord, type PackId, type PackRunState, type PackRunStatus, type PackStageDef, type PackStageState, type PackStageStatus, type PackStartPayload, type PendingReviewHunkEvent, type PendingReviewHunkLine, type PrCheck, type PrRef, type PrReviewEntry, type PrReviewVerdict, type PreviewDetection, type PreviewErrorStage, type PreviewState, type PreviewStatus, type PullRequestDetail, type PullRequestSummary, QA_PROMPT, REVIEWER_PROMPT, type RemoteCommand, type RepoStack, type RepoStackDetection, SKILL_REGISTRY, SPECIFIER_PROMPT, SSE_SOCKET_TIMEOUT_MS, STACK_TO_RECOMMENDED, type SelectPrompt, type SkillDefinition, type SkillDelivery, type SkillFileDelivery, type SkillId, type SkillRail, type SkillsManifest, type SkillsManifestEntry, type StreamingChunkEvent, type StreamingChunkKind, TERMINAL_AGENT_PREFIX, UNKNOWN_MODEL_PRICING, UPCOMING_INTEGRATION_IDS, USER_EVENTS, type UserEventName, classifyStack, detectedIntegrationsFromDeps, getAgent, getContextWindow, getEnabledAgents, getEnabledIntegrations, getIntegration, getIntegrationBranding, getIntegrationsByCategory, getPackDefinition, getPricing, getSkillDefinition, headroomKindFor, headroomModelPredownloadScript, headroomPipPackage, headroomSnapshotDownloadLine, internalToPublic, isGuardrailDisposition, isHeadroomWrappable, isKnownAgentId, isKnownIntegrationId, isKnownModel, isLinkedAgentId, isPackId, isSkillId, normalizeAgentId, normalizeGuardrailPolicy, publicToInternal, recommendForDeps, renderToLines, resolveApiBaseUrl, skillHasRail, toRemoteCommand, tryGetContextWindow };
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __export(index_exports, {
|
|
|
24
24
|
AGENT_STANDARD_BLOCK: () => AGENT_STANDARD_BLOCK,
|
|
25
25
|
AGENT_STANDARD_MARKER: () => AGENT_STANDARD_MARKER,
|
|
26
26
|
AGENT_STANDARD_TEXT: () => AGENT_STANDARD_TEXT,
|
|
27
|
+
CODER_PROMPT: () => CODER_PROMPT,
|
|
27
28
|
DEFAULT_API_BASE_URL: () => DEFAULT_API_BASE_URL,
|
|
28
29
|
DEFAULT_GUARDRAIL_POLICY: () => DEFAULT_GUARDRAIL_POLICY,
|
|
29
30
|
DEP_TO_INTEGRATION: () => DEP_TO_INTEGRATION,
|
|
@@ -50,10 +51,18 @@ __export(index_exports, {
|
|
|
50
51
|
MODEL_CONTEXT_WINDOW: () => MODEL_CONTEXT_WINDOW,
|
|
51
52
|
MODEL_PRICING: () => MODEL_PRICING,
|
|
52
53
|
OBSERVER_BRIDGE_PORT: () => OBSERVER_BRIDGE_PORT,
|
|
54
|
+
PACK_ACTION_COMMAND: () => PACK_ACTION_COMMAND,
|
|
55
|
+
PACK_REGISTRY: () => PACK_REGISTRY,
|
|
56
|
+
PACK_START_COMMAND: () => PACK_START_COMMAND,
|
|
57
|
+
PACK_STATUS_COMMAND: () => PACK_STATUS_COMMAND,
|
|
58
|
+
PACK_WORKFLOW_ARTICLE: () => PACK_WORKFLOW_ARTICLE,
|
|
53
59
|
PREVIEW_DETECT_PROMPT: () => PREVIEW_DETECT_PROMPT,
|
|
54
60
|
PROTOCOL_VERSION: () => PROTOCOL_VERSION,
|
|
55
61
|
PUBLIC_TO_INTERNAL: () => PUBLIC_TO_INTERNAL,
|
|
62
|
+
QA_PROMPT: () => QA_PROMPT,
|
|
63
|
+
REVIEWER_PROMPT: () => REVIEWER_PROMPT,
|
|
56
64
|
SKILL_REGISTRY: () => SKILL_REGISTRY,
|
|
65
|
+
SPECIFIER_PROMPT: () => SPECIFIER_PROMPT,
|
|
57
66
|
SSE_SOCKET_TIMEOUT_MS: () => SSE_SOCKET_TIMEOUT_MS,
|
|
58
67
|
STACK_TO_RECOMMENDED: () => STACK_TO_RECOMMENDED,
|
|
59
68
|
TERMINAL_AGENT_PREFIX: () => TERMINAL_AGENT_PREFIX,
|
|
@@ -69,6 +78,7 @@ __export(index_exports, {
|
|
|
69
78
|
getIntegration: () => getIntegration,
|
|
70
79
|
getIntegrationBranding: () => getIntegrationBranding,
|
|
71
80
|
getIntegrationsByCategory: () => getIntegrationsByCategory,
|
|
81
|
+
getPackDefinition: () => getPackDefinition,
|
|
72
82
|
getPricing: () => getPricing,
|
|
73
83
|
getSkillDefinition: () => getSkillDefinition,
|
|
74
84
|
headroomKindFor: () => headroomKindFor,
|
|
@@ -82,6 +92,7 @@ __export(index_exports, {
|
|
|
82
92
|
isKnownIntegrationId: () => isKnownIntegrationId,
|
|
83
93
|
isKnownModel: () => isKnownModel,
|
|
84
94
|
isLinkedAgentId: () => isLinkedAgentId,
|
|
95
|
+
isPackId: () => isPackId,
|
|
85
96
|
isSkillId: () => isSkillId,
|
|
86
97
|
normalizeAgentId: () => normalizeAgentId,
|
|
87
98
|
normalizeGuardrailPolicy: () => normalizeGuardrailPolicy,
|
|
@@ -2522,6 +2533,149 @@ function normalizeGuardrailPolicy(raw) {
|
|
|
2522
2533
|
}
|
|
2523
2534
|
var GUARDRAIL_CONFIGURE_COMMAND = "guardrail_configure";
|
|
2524
2535
|
|
|
2536
|
+
// src/packs/types.ts
|
|
2537
|
+
var PACK_START_COMMAND = "pack_start";
|
|
2538
|
+
var PACK_ACTION_COMMAND = "pack_action";
|
|
2539
|
+
var PACK_STATUS_COMMAND = "pack_status";
|
|
2540
|
+
|
|
2541
|
+
// src/packs/roles.ts
|
|
2542
|
+
var SPECIFIER_PROMPT = `# Role: Specifier
|
|
2543
|
+
|
|
2544
|
+
You turn the user's task into a precise, testable specification the rest of the pipeline implements against. You do NOT write implementation code.
|
|
2545
|
+
|
|
2546
|
+
Method:
|
|
2547
|
+
1. Read the task and explore the relevant parts of the codebase until you understand the real problem, the desired outcome, and the constraints the code imposes.
|
|
2548
|
+
2. Write the specification to \`SPEC.pack.md\` at the repo root:
|
|
2549
|
+
- **Problem** \u2014 what is wrong or missing, and for whom.
|
|
2550
|
+
- **Outcome** \u2014 what must be true when this is done.
|
|
2551
|
+
- **Acceptance criteria** \u2014 a numbered checklist of observable, testable conditions. Each criterion must be verifiable by a test or a concrete manual check. They must fully cover the outcome.
|
|
2552
|
+
- **Out of scope** \u2014 what this task deliberately does not touch.
|
|
2553
|
+
- **Verification plan** \u2014 for each criterion, the level that proves it (unit / integration / manual) and why.
|
|
2554
|
+
3. Right-size: if the task is clearly too large for one pipeline run, narrow the criteria to a coherent first slice and record the rest under "Out of scope / next".
|
|
2555
|
+
|
|
2556
|
+
Handoff bar: the spec file is committed; every acceptance criterion is testable as written; a competent implementer could start without asking you anything.`;
|
|
2557
|
+
var CODER_PROMPT = `# Role: Coder
|
|
2558
|
+
|
|
2559
|
+
You implement the task with test-driven discipline. You are the only stage that adds behavior.
|
|
2560
|
+
|
|
2561
|
+
Method:
|
|
2562
|
+
1. Read the task \u2014 and \`SPEC.pack.md\` if a Specifier stage produced one; its acceptance criteria are your contract. Without a spec, derive the minimal criteria from the task itself before coding.
|
|
2563
|
+
2. Test-first where it fits: write the test that proves a criterion, watch it fail, implement until it passes. Where strict test-first doesn't fit, still land tests alongside the change.
|
|
2564
|
+
3. Match the project's existing style, structure, and conventions. Simplest design that fully solves the problem \u2014 no speculative abstractions, no "while I'm here" changes.
|
|
2565
|
+
4. Run the project's tests / linters / build and make them pass.
|
|
2566
|
+
|
|
2567
|
+
Handoff bar: every acceptance criterion is implemented and covered by a test; the project's checks pass; the work is committed in focused commits.`;
|
|
2568
|
+
var REVIEWER_PROMPT = `# Role: Reviewer
|
|
2569
|
+
|
|
2570
|
+
You are a skeptical senior reviewer with fresh eyes \u2014 you did NOT write this code, and your job is to find what's wrong, not to approve it. You also own architectural cleanliness for this change.
|
|
2571
|
+
|
|
2572
|
+
Method:
|
|
2573
|
+
1. Read the task, \`SPEC.pack.md\` (when present), and the diff of the pipeline's commits (\`git log\` + \`git diff\` against the state before the pipeline's first commit). Read enough surrounding code to judge in context.
|
|
2574
|
+
2. Audit, in priority order:
|
|
2575
|
+
- **Correctness** \u2014 logic, edge cases, error paths. For each acceptance criterion: point to the test that proves it, and check the test would FAIL if the behavior broke.
|
|
2576
|
+
- **Scope** \u2014 anything beyond the task is flagged and reverted unless it is load-bearing.
|
|
2577
|
+
- **Design** \u2014 duplication, dead code, needless complexity, dependency direction, encapsulation. Verify every API/library call actually exists in the project's dependencies.
|
|
2578
|
+
- **Conventions & naming** \u2014 matches the surrounding code; names say what things are.
|
|
2579
|
+
- **Safety** \u2014 no secrets, credentials, or debugging remnants in code, tests, or fixtures.
|
|
2580
|
+
3. Fix what is justified \u2014 smallest change that resolves the finding, keeping behavior. Re-run the checks after material fixes.
|
|
2581
|
+
4. Record your findings honestly in your closing summary: what you found, what you fixed, what you deliberately left, and what you could not verify.
|
|
2582
|
+
|
|
2583
|
+
Handoff bar: checks pass on YOUR final commit; every fix is committed; your summary lists findings \u2192 resolutions (an empty findings list must say what you checked).`;
|
|
2584
|
+
var QA_PROMPT = `# Role: QA
|
|
2585
|
+
|
|
2586
|
+
You are the final gate. You verify the delivered work against the acceptance criteria as a whole \u2014 end to end, the way a demanding user would \u2014 and produce the run's closing report.
|
|
2587
|
+
|
|
2588
|
+
Method:
|
|
2589
|
+
1. Read the task and \`SPEC.pack.md\` (when present). Your contract is the acceptance criteria; without a spec, derive them from the task.
|
|
2590
|
+
2. For EACH criterion, verify it against the real project: run the relevant tests, execute the code paths where feasible, inspect actual behavior/output. Do not take earlier stages' word for anything.
|
|
2591
|
+
3. Run the project's full checks (tests, lint, types, build) one final time.
|
|
2592
|
+
4. Write \`QA-REPORT.pack.md\` at the repo root: per-criterion verdict (\u2705 verified / \u26A0\uFE0F partially / \u274C failed \u2014 with evidence for each), the checks' results, anything not verifiable in this environment (stated plainly), and a short "ready to ship?" conclusion.
|
|
2593
|
+
5. If a criterion FAILS: fix it only when the fix is small and unambiguous; otherwise mark it failed with exact evidence \u2014 the user decides. Never paper over a failure.
|
|
2594
|
+
|
|
2595
|
+
Handoff bar: the report is committed; every verdict carries evidence; the conclusion is honest about anything unverified.`;
|
|
2596
|
+
|
|
2597
|
+
// src/packs/registry.ts
|
|
2598
|
+
var PACK_REGISTRY = {
|
|
2599
|
+
"quick-pack": {
|
|
2600
|
+
id: "quick-pack",
|
|
2601
|
+
name: "Quick Pack",
|
|
2602
|
+
tagline: "Implement, then a fresh-eyes review \u2014 the tight loop.",
|
|
2603
|
+
gate: "free",
|
|
2604
|
+
stages: [
|
|
2605
|
+
{
|
|
2606
|
+
role: "coder",
|
|
2607
|
+
name: "Coder",
|
|
2608
|
+
description: "Implements the task with tests, TDD-first.",
|
|
2609
|
+
skillIds: ["spec-driven-development"],
|
|
2610
|
+
prompt: CODER_PROMPT
|
|
2611
|
+
},
|
|
2612
|
+
{
|
|
2613
|
+
role: "reviewer",
|
|
2614
|
+
name: "Reviewer",
|
|
2615
|
+
description: "Skeptical review in a fresh context \u2014 finds and fixes what the coder missed.",
|
|
2616
|
+
skillIds: ["code-review", "code-naming"],
|
|
2617
|
+
prompt: REVIEWER_PROMPT
|
|
2618
|
+
}
|
|
2619
|
+
]
|
|
2620
|
+
},
|
|
2621
|
+
"full-pack": {
|
|
2622
|
+
id: "full-pack",
|
|
2623
|
+
name: "Full Pack",
|
|
2624
|
+
tagline: "Spec \u2192 implement \u2192 review \u2192 verify. Every quality gate, one run.",
|
|
2625
|
+
gate: "pro",
|
|
2626
|
+
stages: [
|
|
2627
|
+
{
|
|
2628
|
+
role: "specifier",
|
|
2629
|
+
name: "Specifier",
|
|
2630
|
+
description: "Turns the task into testable acceptance criteria before any code.",
|
|
2631
|
+
skillIds: ["spec-driven-development"],
|
|
2632
|
+
prompt: SPECIFIER_PROMPT
|
|
2633
|
+
},
|
|
2634
|
+
{
|
|
2635
|
+
role: "coder",
|
|
2636
|
+
name: "Coder",
|
|
2637
|
+
description: "Implements the acceptance criteria with tests, TDD-first.",
|
|
2638
|
+
skillIds: [],
|
|
2639
|
+
prompt: CODER_PROMPT
|
|
2640
|
+
},
|
|
2641
|
+
{
|
|
2642
|
+
role: "reviewer",
|
|
2643
|
+
name: "Reviewer",
|
|
2644
|
+
description: "Audits correctness, scope, design, and conventions with fresh eyes.",
|
|
2645
|
+
skillIds: ["code-review", "code-naming"],
|
|
2646
|
+
prompt: REVIEWER_PROMPT
|
|
2647
|
+
},
|
|
2648
|
+
{
|
|
2649
|
+
role: "qa",
|
|
2650
|
+
name: "QA",
|
|
2651
|
+
description: "Verifies every acceptance criterion end to end and writes the final report.",
|
|
2652
|
+
skillIds: [],
|
|
2653
|
+
prompt: QA_PROMPT
|
|
2654
|
+
}
|
|
2655
|
+
]
|
|
2656
|
+
}
|
|
2657
|
+
};
|
|
2658
|
+
function isPackId(id) {
|
|
2659
|
+
return Object.prototype.hasOwnProperty.call(PACK_REGISTRY, id);
|
|
2660
|
+
}
|
|
2661
|
+
function getPackDefinition(id) {
|
|
2662
|
+
return isPackId(id) ? PACK_REGISTRY[id] : null;
|
|
2663
|
+
}
|
|
2664
|
+
|
|
2665
|
+
// src/packs/workflow-article.ts
|
|
2666
|
+
var PACK_WORKFLOW_ARTICLE = `## Pipeline rules (you are one stage of an assembly line)
|
|
2667
|
+
|
|
2668
|
+
You are ONE specialist role in a multi-role pipeline running on this repository. Other specialist roles ran before you and/or run after you, each in a separate conversation. Follow these rules exactly:
|
|
2669
|
+
|
|
2670
|
+
- **Do only your role's job.** The next stage exists for a reason \u2014 don't do its work, and don't redo a previous stage's work unless your role explicitly calls for correcting it.
|
|
2671
|
+
- **Work from the handoff.** The previous stage's handoff (commit + summary) is your input. Start by reading the current state of the working tree \u2014 it already contains all prior stages' work.
|
|
2672
|
+
- **Commit your work when your stage is complete.** One or more focused commits; the final state of the tree IS your handoff to the next stage. End every commit message with your role byline on its own line: \`By <role>.\`
|
|
2673
|
+
- **Never leave the tree broken.** Run the project's checks before finishing when the project has them; your stage ends with a working tree the next role can build on.
|
|
2674
|
+
- **Do not push, force-push, or touch remotes** \u2014 the pipeline works locally; publishing is the user's call at the end.
|
|
2675
|
+
- **Never read, edit, or commit anything under \`.codeam/\`** \u2014 that is the pipeline's own ledger, not project code.
|
|
2676
|
+
- **Finish decisively.** When your stage's job is done and committed, say so in 2-4 lines (what you did, what you verified, anything the next stage should know) and stop. Don't ask "should I continue?" \u2014 the pipeline advances automatically.
|
|
2677
|
+
- **If you are genuinely blocked** (contradictory requirements, missing access), say exactly what is blocking you and stop \u2014 the user is supervising and will decide.`;
|
|
2678
|
+
|
|
2525
2679
|
// src/api-url.ts
|
|
2526
2680
|
var DEFAULT_API_BASE_URL = "https://api.codeagent-mobile.com";
|
|
2527
2681
|
var DEV_API_BASE_URL = "https://dev-api.codeagent-mobile.com";
|
|
@@ -2672,7 +2826,12 @@ var USER_EVENTS = {
|
|
|
2672
2826
|
* toast when the review runs server-side (Inngest). Mobile-only surface,
|
|
2673
2827
|
* produced by api-v2 (the CLI neither produces nor consumes it). Mirrored in
|
|
2674
2828
|
* repo A. */
|
|
2675
|
-
PR_REVIEW_LAUNCH: "pr_review_launch"
|
|
2829
|
+
PR_REVIEW_LAUNCH: "pr_review_launch",
|
|
2830
|
+
/** Agent Packs — full `PackRunState` republished by the backend on every
|
|
2831
|
+
* pipeline transition (stage start/done, pause, stall, completion). CLI
|
|
2832
|
+
* posts to /api/packs/events; mobile's pack.store renders the pipeline.
|
|
2833
|
+
* Mirrored in repo A's app-shared events.ts. */
|
|
2834
|
+
PACK_STATE: "pack_state"
|
|
2676
2835
|
};
|
|
2677
2836
|
|
|
2678
2837
|
// src/preview-prompts.ts
|
|
@@ -2727,6 +2886,7 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
|
|
|
2727
2886
|
AGENT_STANDARD_BLOCK,
|
|
2728
2887
|
AGENT_STANDARD_MARKER,
|
|
2729
2888
|
AGENT_STANDARD_TEXT,
|
|
2889
|
+
CODER_PROMPT,
|
|
2730
2890
|
DEFAULT_API_BASE_URL,
|
|
2731
2891
|
DEFAULT_GUARDRAIL_POLICY,
|
|
2732
2892
|
DEP_TO_INTEGRATION,
|
|
@@ -2753,10 +2913,18 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
|
|
|
2753
2913
|
MODEL_CONTEXT_WINDOW,
|
|
2754
2914
|
MODEL_PRICING,
|
|
2755
2915
|
OBSERVER_BRIDGE_PORT,
|
|
2916
|
+
PACK_ACTION_COMMAND,
|
|
2917
|
+
PACK_REGISTRY,
|
|
2918
|
+
PACK_START_COMMAND,
|
|
2919
|
+
PACK_STATUS_COMMAND,
|
|
2920
|
+
PACK_WORKFLOW_ARTICLE,
|
|
2756
2921
|
PREVIEW_DETECT_PROMPT,
|
|
2757
2922
|
PROTOCOL_VERSION,
|
|
2758
2923
|
PUBLIC_TO_INTERNAL,
|
|
2924
|
+
QA_PROMPT,
|
|
2925
|
+
REVIEWER_PROMPT,
|
|
2759
2926
|
SKILL_REGISTRY,
|
|
2927
|
+
SPECIFIER_PROMPT,
|
|
2760
2928
|
SSE_SOCKET_TIMEOUT_MS,
|
|
2761
2929
|
STACK_TO_RECOMMENDED,
|
|
2762
2930
|
TERMINAL_AGENT_PREFIX,
|
|
@@ -2772,6 +2940,7 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
|
|
|
2772
2940
|
getIntegration,
|
|
2773
2941
|
getIntegrationBranding,
|
|
2774
2942
|
getIntegrationsByCategory,
|
|
2943
|
+
getPackDefinition,
|
|
2775
2944
|
getPricing,
|
|
2776
2945
|
getSkillDefinition,
|
|
2777
2946
|
headroomKindFor,
|
|
@@ -2785,6 +2954,7 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
|
|
|
2785
2954
|
isKnownIntegrationId,
|
|
2786
2955
|
isKnownModel,
|
|
2787
2956
|
isLinkedAgentId,
|
|
2957
|
+
isPackId,
|
|
2788
2958
|
isSkillId,
|
|
2789
2959
|
normalizeAgentId,
|
|
2790
2960
|
normalizeGuardrailPolicy,
|