import { ActionResponse } from '../../content/content.type'; import { PeopleActionOpts } from '../shared.types'; import { InvokeDeps } from '../_invoke'; import { PeopleProcessDefinition, PeopleRequestTypeDefinition } from './ct.types'; /** `edit_request_type` — draft/validated only; replaces `definition` and * re-stamps the canonical hash (validated → draft). */ export interface PeopleEditRequestTypeParams { definition: PeopleRequestTypeDefinition; } /** `safe_test_request_type` — sandbox scenario through the pure S1–S14 * chain with simulated capabilities; no production mutation, no git effect, * no row state change. */ export interface PeopleSafeTestRequestTypeParams { scenario?: Record; } /** `edit_policy` — human face takes title/body; machine face takes `artifact`. */ export interface PeopleEditPolicyParams { kind?: 'document' | 'process-composition' | 'cross-domain-automation' | 'settings-guardrails' | (string & {}); policyKey?: string; /** Human face (`kind: document`). */ title?: string; body?: Record; audience?: string; scope?: string; /** Machine face — the authored artifact tree (rides the row, drift D-5). */ artifact?: Record; /** Effective window — ISO-8601 timestamps (SP-10 rejects anything else). */ effectiveFrom?: string; effectiveTo?: string; /** Git-plane meta (spine §10): `repo_ref` engages the publisher — * requires `processSlug` (the owning process directory) or the edit * fails with `process_slug_required`. */ repoRef?: string; processSlug?: string; } /** `publish_policy` — `confirmImpact: true` required when consumers hold the * old version (impact warning). */ export interface PeoplePublishPolicyParams { confirmImpact?: boolean; } /** `archive_policy` — `purge: true` on a referenced version ⇒ * `PEOPLE_POLICY_VERSION_REFERENCED`. */ export interface PeopleArchivePolicyParams { purge?: boolean; } /** `toggle_policy` — machine face only: artifact-level `enabled` OR one * composition entry override. Structural fields ⇒ `PEOPLE_POLICY_TOGGLE_INVALID`. */ export interface PeopleTogglePolicyParams { enabled: boolean; entryKey?: string; } /** `toggle_glue_rule` — the ONLY instant operational toggle (DC-06): next * event reads the new state; structural fields would be rejected upstream * (this is glue-rule, not the policy toggle — no `entry_overrides` shape). * `reason` is recorded on disable for incident bookkeeping. */ export interface PeopleToggleGlueRuleParams { enabled: boolean; reason?: string; } /** `runtime_request.create` — 7-step creation; snapshot pin at creation; * idempotent by `idempotencyKey` (RC-10 — pass a FRESH key per user submit). */ export interface PeopleRuntimeRequestCreateParams { input: unknown; subjectRef: string; requesterRef?: string; idempotencyKey?: string; } /** `edit_process` — draft rows only (published immutable, DC-06); replaces * the authored tree and re-stamps the canonical hash. */ export interface PeopleEditProcessParams { definition: PeopleProcessDefinition; repoRef?: string; artifactPath?: string; } /** `publish_process` — `confirmImpact: true` required when instances still * pin the previous version (RT-21 impact warning). */ export interface PeoplePublishProcessParams { confirmImpact?: boolean; repoRef?: string; } /** `supersede_process` — same impact belt as publish. */ export interface PeopleSupersedeProcessParams { confirmImpact?: boolean; reason?: string; } /** `decommission_process` — tombstone after supersede (DC-05). */ export interface PeopleDecommissionProcessParams { reason?: string; } /** `reconcile_from_repo_*` (PIP-005 WS-D) — repo-wins drift resolution: * read the repo's authored artifact back and seed a NEW DRAFT version * from it. `force` bypasses the DRIFT-badge gate (operator override). */ export interface PeopleReconcileFromRepoParams { force?: boolean; } /** `register_process_repo` (PIP-005 WS-C rev 2) — create or update one * managed git source (idempotent by normalized repo URL). */ export interface PeopleRegisterProcessRepoParams { repo_url: string; name: string; repo_key?: string; description?: string; domain?: string; branch?: string; /** Curated predefined process directories. */ processes?: Array<{ slug: string; name?: string; description?: string; }>; } /** `set_process_repo_state` — toggle a registered git source on/off. */ export interface PeopleSetProcessRepoStateParams { enabled: boolean; } /** `sync_from_repo` params — snake_case per the handler contract. Fields * outside this whitelist are rejected with `invalid_params`. `dry_run` * and `skip_conflicts` MUST be real booleans (never "true"/"null"). */ export interface PeopleSyncFromRepoParams { /** Default true (preview/plan only, nothing saved). */ dry_run?: boolean; /** Apply lane only — save the valid created/changed items despite * errors/conflicts (skipped ones return in `skipped[]`). */ skip_conflicts?: boolean; /** Optional scope filters — omit for whole-repo scan. When present, * MUST be non-empty arrays, and MUST match between preview and apply. */ process_slugs?: string[]; lanes?: Array<'request_type' | 'policy'>; /** Apply lane only — copied from the preview response `sourceSha`. */ source_sha?: string; /** Apply lane only — copied from the preview response `planHash`. */ plan_hash?: string; } /** One lane item in a sync plan (created/changed/unchanged/conflicts/ * errors/missingInGit). Fields are optional — not every item carries * every field. */ export interface PeopleGitSyncPlanItem { lane: 'request_type' | 'policy'; key: string; processSlug?: string; path?: string; sourceHash?: string; /** Validation findings for human review (warnings do not block save). */ findings?: Array>; /** Expected mutation for created/changed — `create_draft`, `update_draft`, * or `create_review_draft`. */ operation?: string; [k: string]: unknown; } /** One saved draft in an apply response (`applied[]`/`skipped[]`). */ export interface PeopleGitSyncAppliedItem { path?: string; lane?: 'request_type' | 'policy'; draftUuid?: string; operationId?: string; [k: string]: unknown; } /** The `output` payload of `sync_from_repo` — camelCase (CMS response * casing middleware). `applied`/`skipped` are empty in preview. */ export interface PeopleGitSyncPlan { success?: boolean; dryRun?: boolean; skipConflicts?: boolean; sourceSha?: string; planHash?: string; created?: PeopleGitSyncPlanItem[]; changed?: PeopleGitSyncPlanItem[]; unchanged?: PeopleGitSyncPlanItem[]; conflicts?: PeopleGitSyncPlanItem[]; missingInGit?: PeopleGitSyncPlanItem[]; errors?: PeopleGitSyncPlanItem[]; applied?: PeopleGitSyncAppliedItem[]; skipped?: PeopleGitSyncAppliedItem[]; error?: string | null; [k: string]: unknown; } /** `create_process` FACTORY — draft instance under the one-active-per- * (type, subject) guard; deferrals recordable only BEFORE start (US2). */ export interface PeopleCreateProcessParams { typeKey: string; subjectRef: string; deferDecisions?: Record; } /** `cancel_process` — US6 controlled cancel; everything produced LISTED. */ export interface PeopleCancelProcessParams { reason?: string; } export interface ProcessActions { /** FEAT-010 — request_type authoring: edit → validate → safe-test → publish. */ readonly reqType: { edit(uuid: string, params: PeopleEditRequestTypeParams, opts?: PeopleActionOpts): Promise; validate(uuid: string, opts?: PeopleActionOpts): Promise; safeTest(uuid: string, params?: PeopleSafeTestRequestTypeParams, opts?: PeopleActionOpts): Promise; publish(uuid: string, opts?: PeopleActionOpts): Promise; supersede(uuid: string, opts?: PeopleActionOpts): Promise; decommission(uuid: string, opts?: PeopleActionOpts): Promise; verify(uuid: string, opts?: PeopleActionOpts): Promise; /** PIP-005 WS-D — repo-wins drift resolution (new draft from repo). */ reconcileFromRepo(uuid: string, params?: PeopleReconcileFromRepoParams, opts?: PeopleActionOpts): Promise; }; /** FEAT-010 — registered capability catalogue (9-field contract guard). */ readonly capability: { publish(uuid: string, opts?: PeopleActionOpts): Promise; supersede(uuid: string, opts?: PeopleActionOpts): Promise; }; /** FEAT-011 — policy registry handle (two faces, one artifact, one version). */ readonly policy: { edit(uuid: string, params: PeopleEditPolicyParams, opts?: PeopleActionOpts): Promise; validate(uuid: string, opts?: PeopleActionOpts): Promise; publish(uuid: string, params?: PeoplePublishPolicyParams, opts?: PeopleActionOpts): Promise; supersede(uuid: string, opts?: PeopleActionOpts): Promise; archive(uuid: string, params?: PeopleArchivePolicyParams, opts?: PeopleActionOpts): Promise; restore(uuid: string, opts?: PeopleActionOpts): Promise; toggle(uuid: string, params: PeopleTogglePolicyParams, opts?: PeopleActionOpts): Promise; verify(uuid: string, opts?: PeopleActionOpts): Promise; /** PIP-005 WS-D — repo-wins drift resolution (new draft from repo). */ reconcileFromRepo(uuid: string, params?: PeopleReconcileFromRepoParams, opts?: PeopleActionOpts): Promise; }; /** FEAT-011 — glue_rule handle: the ONLY instant operational toggle (DC-06). */ readonly glueRule: { toggle(uuid: string, params?: PeopleToggleGlueRuleParams, opts?: PeopleActionOpts): Promise; verify(uuid: string, opts?: PeopleActionOpts): Promise; }; /** FEAT-010 runtime on GENERATED per-flow CTs — needs the FEAT-015 * registration path before row-scoped invocation works end-to-end. */ readonly runtimeRequest: { /** Factory via the meta-CT alias: `POST * /content/types/request_type/actions/runtime_request.create`. */ create(typeKey: string, params: PeopleRuntimeRequestCreateParams, opts?: PeopleActionOpts): Promise; /** Row action with a DYNAMIC key authored in the definition — runs the * canonical S1–S14 chain (RT-01..07 ⇒ `PEOPLE_REQ_*`). */ invokeAction(uuid: string, actionKey: string, params?: Record, opts?: PeopleActionOpts): Promise; }; /** FEAT-014 — process_type definition lane (US1): edit → validate → * publish → supersede/decommission, plus the verify badge (US10). */ readonly processType: { edit(uuid: string, params: PeopleEditProcessParams, opts?: PeopleActionOpts): Promise; validate(uuid: string, opts?: PeopleActionOpts): Promise; publish(uuid: string, params?: PeoplePublishProcessParams, opts?: PeopleActionOpts): Promise; supersede(uuid: string, params?: PeopleSupersedeProcessParams, opts?: PeopleActionOpts): Promise; decommission(uuid: string, params?: PeopleDecommissionProcessParams, opts?: PeopleActionOpts): Promise; verify(uuid: string, opts?: PeopleActionOpts): Promise; /** PIP-005 WS-D — repo-wins drift resolution (new draft from repo). */ reconcileFromRepo(uuid: string, params?: PeopleReconcileFromRepoParams, opts?: PeopleActionOpts): Promise; }; /** FEAT-014 — process_instance lifecycle (US2/US4/US6): create (factory) * → start → cancel; retry/retry-spawn are the human-only recovery pair. */ readonly processInstance: { /** FACTORY `create_process` on the process_instance CT. */ create(params: PeopleCreateProcessParams, opts?: PeopleActionOpts): Promise; start(uuid: string, opts?: PeopleActionOpts): Promise; cancel(uuid: string, params?: PeopleCancelProcessParams, opts?: PeopleActionOpts): Promise; retry(uuid: string, opts?: PeopleActionOpts): Promise; /** Degraded recovery — only the missing spawn part (PC-06). */ retrySpawn(uuid: string, opts?: PeopleActionOpts): Promise; }; /** PIP-005 WS-C rev 2 — the managed git-source registry (process_repo): * register (idempotent create-or-update) + state toggle. The pickers * read the catalog projection; these actions curate it. */ readonly processRepo: { /** FACTORY — no row needed: register resolves identity from the URL. */ register(params: PeopleRegisterProcessRepoParams, opts?: PeopleActionOpts): Promise; setState(uuid: string, params: PeopleSetProcessRepoStateParams, opts?: PeopleActionOpts): Promise; /** PIP-005 — sync Git definitions into People drafts: `dry_run: true` * computes the plan (preview); `dry_run: false` with the preview's * `source_sha` + `plan_hash` (+ matching filters) saves drafts. */ syncFromRepo(uuid: string, params?: PeopleSyncFromRepoParams, opts?: PeopleActionOpts): Promise; }; } export declare function buildProcessActions(deps: InvokeDeps): ProcessActions; //# sourceMappingURL=actions.d.ts.map