@asc-agent/runtime 0.1.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 +15 -0
- package/README.md +22 -0
- package/dist/adapters/claude-code/binding.d.ts +5 -0
- package/dist/adapters/claude-code/binding.js +14 -0
- package/dist/adapters/claude-code/guard.d.ts +54 -0
- package/dist/adapters/claude-code/guard.js +295 -0
- package/dist/adapters/claude-code/install.d.ts +67 -0
- package/dist/adapters/claude-code/install.js +231 -0
- package/dist/adapters/claude-code/observer.d.ts +38 -0
- package/dist/adapters/claude-code/observer.js +77 -0
- package/dist/adapters/claude-code/probe.d.ts +53 -0
- package/dist/adapters/claude-code/probe.js +129 -0
- package/dist/adapters/claude-code/skill.d.ts +8 -0
- package/dist/adapters/claude-code/skill.js +267 -0
- package/dist/adapters/fixture-work/index.d.ts +34 -0
- package/dist/adapters/fixture-work/index.js +78 -0
- package/dist/adapters/github/adapter.d.ts +32 -0
- package/dist/adapters/github/adapter.js +95 -0
- package/dist/adapters/github/client.d.ts +30 -0
- package/dist/adapters/github/client.js +90 -0
- package/dist/adapters/github/context.d.ts +44 -0
- package/dist/adapters/github/context.js +170 -0
- package/dist/adapters/github/event-source.d.ts +55 -0
- package/dist/adapters/github/event-source.js +183 -0
- package/dist/adapters/github/scm.d.ts +50 -0
- package/dist/adapters/github/scm.js +104 -0
- package/dist/adapters/gitlab/adapter.d.ts +36 -0
- package/dist/adapters/gitlab/adapter.js +117 -0
- package/dist/adapters/gitlab/client.d.ts +30 -0
- package/dist/adapters/gitlab/client.js +47 -0
- package/dist/adapters/gitlab/ports.d.ts +40 -0
- package/dist/adapters/gitlab/ports.js +186 -0
- package/dist/adapters/jam/adapter.d.ts +53 -0
- package/dist/adapters/jam/adapter.js +144 -0
- package/dist/adapters/jam/event-source.d.ts +28 -0
- package/dist/adapters/jam/event-source.js +65 -0
- package/dist/adapters/jam/mcp-client.d.ts +50 -0
- package/dist/adapters/jam/mcp-client.js +218 -0
- package/dist/adapters/jam/ports.d.ts +51 -0
- package/dist/adapters/jam/ports.js +167 -0
- package/dist/adapters/local/identity.d.ts +27 -0
- package/dist/adapters/local/identity.js +40 -0
- package/dist/adapters/local/presentation.d.ts +14 -0
- package/dist/adapters/local/presentation.js +42 -0
- package/dist/adapters/markdown/layout.d.ts +15 -0
- package/dist/adapters/markdown/layout.js +49 -0
- package/dist/adapters/markdown/serialize.d.ts +9 -0
- package/dist/adapters/markdown/serialize.js +120 -0
- package/dist/adapters/markdown/state-store.d.ts +23 -0
- package/dist/adapters/markdown/state-store.js +316 -0
- package/dist/adapters/mattermost/client.d.ts +23 -0
- package/dist/adapters/mattermost/client.js +54 -0
- package/dist/adapters/mattermost/presentation.d.ts +43 -0
- package/dist/adapters/mattermost/presentation.js +88 -0
- package/dist/adapters/memory/mocks.d.ts +87 -0
- package/dist/adapters/memory/mocks.js +163 -0
- package/dist/adapters/memory/runtime-binding.d.ts +23 -0
- package/dist/adapters/memory/runtime-binding.js +118 -0
- package/dist/adapters/memory/state-store.d.ts +17 -0
- package/dist/adapters/memory/state-store.js +125 -0
- package/dist/adapters/text/renderer.d.ts +7 -0
- package/dist/adapters/text/renderer.js +81 -0
- package/dist/adapters/webhook/ingress.d.ts +103 -0
- package/dist/adapters/webhook/ingress.js +150 -0
- package/dist/cli/asc.d.ts +16 -0
- package/dist/cli/asc.js +2914 -0
- package/dist/cli/identity-config.d.ts +7 -0
- package/dist/cli/identity-config.js +31 -0
- package/dist/composition/observe.d.ts +21 -0
- package/dist/composition/observe.js +72 -0
- package/dist/composition/registry.d.ts +33 -0
- package/dist/composition/registry.js +62 -0
- package/dist/composition/runtime.d.ts +63 -0
- package/dist/composition/runtime.js +155 -0
- package/dist/core/approval/service.d.ts +17 -0
- package/dist/core/approval/service.js +129 -0
- package/dist/core/attach/bootstrap.d.ts +102 -0
- package/dist/core/attach/bootstrap.js +178 -0
- package/dist/core/attach/init.d.ts +29 -0
- package/dist/core/attach/init.js +100 -0
- package/dist/core/attach/setup-plan.d.ts +125 -0
- package/dist/core/attach/setup-plan.js +177 -0
- package/dist/core/attach/setup.d.ts +40 -0
- package/dist/core/attach/setup.js +140 -0
- package/dist/core/binding/types.d.ts +93 -0
- package/dist/core/binding/types.js +74 -0
- package/dist/core/distribution/release.d.ts +15 -0
- package/dist/core/distribution/release.js +27 -0
- package/dist/core/distribution/runtime-install.d.ts +50 -0
- package/dist/core/distribution/runtime-install.js +90 -0
- package/dist/core/distribution/runtime-select.d.ts +74 -0
- package/dist/core/distribution/runtime-select.js +149 -0
- package/dist/core/execution/executor.d.ts +51 -0
- package/dist/core/execution/executor.js +106 -0
- package/dist/core/execution/grant.d.ts +42 -0
- package/dist/core/execution/grant.js +78 -0
- package/dist/core/model/entities.d.ts +872 -0
- package/dist/core/model/entities.js +285 -0
- package/dist/core/model/ids.d.ts +41 -0
- package/dist/core/model/ids.js +50 -0
- package/dist/core/model/transitions.d.ts +26 -0
- package/dist/core/model/transitions.js +124 -0
- package/dist/core/monitor/coverage.d.ts +111 -0
- package/dist/core/monitor/coverage.js +129 -0
- package/dist/core/monitor/engine.d.ts +134 -0
- package/dist/core/monitor/engine.js +574 -0
- package/dist/core/monitor/health-alerts.d.ts +35 -0
- package/dist/core/monitor/health-alerts.js +88 -0
- package/dist/core/monitor/investigation.d.ts +82 -0
- package/dist/core/monitor/investigation.js +232 -0
- package/dist/core/monitor/observation.d.ts +79 -0
- package/dist/core/monitor/observation.js +110 -0
- package/dist/core/monitor/relevance.d.ts +47 -0
- package/dist/core/monitor/relevance.js +100 -0
- package/dist/core/monitor/signals.d.ts +59 -0
- package/dist/core/monitor/signals.js +105 -0
- package/dist/core/operator/local-operator.d.ts +60 -0
- package/dist/core/operator/local-operator.js +82 -0
- package/dist/core/operator/preflight.d.ts +60 -0
- package/dist/core/operator/preflight.js +139 -0
- package/dist/core/operator/proceed.d.ts +98 -0
- package/dist/core/operator/proceed.js +167 -0
- package/dist/core/operator/progress.d.ts +124 -0
- package/dist/core/operator/progress.js +135 -0
- package/dist/core/operator/render.d.ts +34 -0
- package/dist/core/operator/render.js +170 -0
- package/dist/core/operator/runtime-binding.d.ts +61 -0
- package/dist/core/operator/runtime-binding.js +22 -0
- package/dist/core/policy/ownership.d.ts +44 -0
- package/dist/core/policy/ownership.js +46 -0
- package/dist/core/policy/policy.d.ts +99 -0
- package/dist/core/policy/policy.js +147 -0
- package/dist/core/policy/remote-freeze.d.ts +101 -0
- package/dist/core/policy/remote-freeze.js +151 -0
- package/dist/core/policy/scope.d.ts +23 -0
- package/dist/core/policy/scope.js +93 -0
- package/dist/core/presentation/digest.d.ts +98 -0
- package/dist/core/presentation/digest.js +160 -0
- package/dist/core/resolver/load.d.ts +121 -0
- package/dist/core/resolver/load.js +246 -0
- package/dist/core/resolver/render.d.ts +4 -0
- package/dist/core/resolver/render.js +62 -0
- package/dist/core/resolver/resolve.d.ts +42 -0
- package/dist/core/resolver/resolve.js +51 -0
- package/dist/core/resolver/version.d.ts +22 -0
- package/dist/core/resolver/version.js +49 -0
- package/dist/core/runtime/audit.d.ts +374 -0
- package/dist/core/runtime/audit.js +454 -0
- package/dist/core/runtime/claims.d.ts +115 -0
- package/dist/core/runtime/claims.js +153 -0
- package/dist/core/runtime/closure.d.ts +73 -0
- package/dist/core/runtime/closure.js +162 -0
- package/dist/core/runtime/controller.d.ts +40 -0
- package/dist/core/runtime/controller.js +121 -0
- package/dist/core/runtime/escalation.d.ts +188 -0
- package/dist/core/runtime/escalation.js +322 -0
- package/dist/core/runtime/execution-state.d.ts +43 -0
- package/dist/core/runtime/execution-state.js +81 -0
- package/dist/core/runtime/front.d.ts +95 -0
- package/dist/core/runtime/front.js +144 -0
- package/dist/core/runtime/orchestrator.d.ts +54 -0
- package/dist/core/runtime/orchestrator.js +98 -0
- package/dist/core/runtime/query.d.ts +184 -0
- package/dist/core/runtime/query.js +213 -0
- package/dist/core/runtime/report.d.ts +33 -0
- package/dist/core/runtime/report.js +108 -0
- package/dist/core/runtime/session.d.ts +156 -0
- package/dist/core/runtime/session.js +281 -0
- package/dist/core/runtime/store-ops.d.ts +22 -0
- package/dist/core/runtime/store-ops.js +26 -0
- package/dist/core/view/build-view.d.ts +36 -0
- package/dist/core/view/build-view.js +131 -0
- package/dist/core/view/decision-view.d.ts +564 -0
- package/dist/core/view/decision-view.js +103 -0
- package/dist/core/workspace/identity.d.ts +82 -0
- package/dist/core/workspace/identity.js +133 -0
- package/dist/core/workspace/index-store.d.ts +140 -0
- package/dist/core/workspace/index-store.js +125 -0
- package/dist/core/workspace/migrate.d.ts +73 -0
- package/dist/core/workspace/migrate.js +123 -0
- package/dist/core/workspace/resolve.d.ts +34 -0
- package/dist/core/workspace/resolve.js +89 -0
- package/dist/ports/adapter.d.ts +35 -0
- package/dist/ports/adapter.js +12 -0
- package/dist/ports/approval.d.ts +98 -0
- package/dist/ports/approval.js +7 -0
- package/dist/ports/change-context.d.ts +22 -0
- package/dist/ports/change-context.js +8 -0
- package/dist/ports/event-source.d.ts +42 -0
- package/dist/ports/event-source.js +6 -0
- package/dist/ports/inventory.d.ts +53 -0
- package/dist/ports/inventory.js +12 -0
- package/dist/ports/presentation.d.ts +62 -0
- package/dist/ports/presentation.js +13 -0
- package/dist/ports/renderer.d.ts +23 -0
- package/dist/ports/renderer.js +7 -0
- package/dist/ports/resource-context.d.ts +51 -0
- package/dist/ports/resource-context.js +9 -0
- package/dist/ports/scm.d.ts +40 -0
- package/dist/ports/scm.js +6 -0
- package/dist/ports/state-store.d.ts +97 -0
- package/dist/ports/state-store.js +12 -0
- package/dist/presets/balanced.json +8 -0
- package/dist/presets/conservative.json +9 -0
- package/dist/presets/lightweight.json +8 -0
- package/dist/profiles/example-team/profile.json +101 -0
- package/dist/profiles/pilot-local/profile.json +56 -0
- package/dist/schemas/profile.d.ts +631 -0
- package/dist/schemas/profile.js +287 -0
- package/package.json +55 -0
|
@@ -0,0 +1,872 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** 전이를 수행할 수 있는 주체. Writer 규칙(OM §7.2)과 상태 전이 권한의 기준. */
|
|
3
|
+
export declare const ActorRole: z.ZodEnum<["controller", "monitor", "executor", "session"]>;
|
|
4
|
+
export type ActorRole = z.infer<typeof ActorRole>;
|
|
5
|
+
export declare const Priority: z.ZodEnum<["P0", "P1", "P2"]>;
|
|
6
|
+
export type Priority = z.infer<typeof Priority>;
|
|
7
|
+
/**
|
|
8
|
+
* 이벤트 유형 — Phase B 조사 깊이를 결정한다 (OM §10.3).
|
|
9
|
+
* informational 정보형 / actionable 대응형 / work 작업형.
|
|
10
|
+
*/
|
|
11
|
+
export declare const EventType: z.ZodEnum<["informational", "actionable", "work"]>;
|
|
12
|
+
export type EventType = z.infer<typeof EventType>;
|
|
13
|
+
/**
|
|
14
|
+
* Canonical source별 baseline. Project는 canonical 하나가 아니라 Session이 소비하는
|
|
15
|
+
* source 집합을 갖는다 (OM §8) — snapshot도 단일 commit이 아니라 source별로 기록한다.
|
|
16
|
+
*/
|
|
17
|
+
export declare const CanonicalSnapshot: z.ZodObject<{
|
|
18
|
+
sourceId: z.ZodString;
|
|
19
|
+
baseline: z.ZodString;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
sourceId: string;
|
|
22
|
+
baseline: string;
|
|
23
|
+
}, {
|
|
24
|
+
sourceId: string;
|
|
25
|
+
baseline: string;
|
|
26
|
+
}>;
|
|
27
|
+
export type CanonicalSnapshot = z.infer<typeof CanonicalSnapshot>;
|
|
28
|
+
/** Logical Session 상태 (OM §6.2). Physical Run과 1:1이 아니다. */
|
|
29
|
+
export declare const SessionStatus: z.ZodEnum<["READY", "ACTIVE", "PAUSED", "BLOCKED", "DONE", "FAILED"]>;
|
|
30
|
+
export type SessionStatus = z.infer<typeof SessionStatus>;
|
|
31
|
+
export declare const SessionRole: z.ZodEnum<["planner", "researcher", "implementer", "verifier"]>;
|
|
32
|
+
export type SessionRole = z.infer<typeof SessionRole>;
|
|
33
|
+
/** 중단 시 남기는 Run 승계 정보 — 다른 Physical Run이 같은 Logical Session을 이어받는다. */
|
|
34
|
+
export declare const Checkpoint: z.ZodObject<{
|
|
35
|
+
position: z.ZodString;
|
|
36
|
+
completedTasks: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
37
|
+
nextAction: z.ZodString;
|
|
38
|
+
uncommittedChanges: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
39
|
+
/**
|
|
40
|
+
* 의미 있는 전환을 남기기 위한 필드들 (C-10 §2.1). 시간 경과는 전환이 아니다 —
|
|
41
|
+
* "지금 무엇이 사실이라고 보는가"와 "그 판단의 근거"가 있어야 다음 사람이 이어받는다.
|
|
42
|
+
*
|
|
43
|
+
* 전부 optional·default다: 기존 세션 파일이 그대로 읽혀야 한다 (doneCriteria 선례).
|
|
44
|
+
* 퍼센트는 여기 없다 — 필요하면 렌더가 만드는 projection이지 기록이 아니다.
|
|
45
|
+
*/
|
|
46
|
+
currentJudgment: z.ZodOptional<z.ZodString>;
|
|
47
|
+
blockers: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
48
|
+
risks: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
49
|
+
evidenceRefs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
50
|
+
/** 누가 적었는가 (execution principal). 소유권 검사와 함께 의미를 갖는다. */
|
|
51
|
+
writtenBy: z.ZodOptional<z.ZodString>;
|
|
52
|
+
recordedAt: z.ZodString;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
position: string;
|
|
55
|
+
completedTasks: string[];
|
|
56
|
+
nextAction: string;
|
|
57
|
+
uncommittedChanges: string[];
|
|
58
|
+
blockers: string[];
|
|
59
|
+
risks: string[];
|
|
60
|
+
evidenceRefs: string[];
|
|
61
|
+
recordedAt: string;
|
|
62
|
+
currentJudgment?: string | undefined;
|
|
63
|
+
writtenBy?: string | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
position: string;
|
|
66
|
+
nextAction: string;
|
|
67
|
+
recordedAt: string;
|
|
68
|
+
completedTasks?: string[] | undefined;
|
|
69
|
+
uncommittedChanges?: string[] | undefined;
|
|
70
|
+
currentJudgment?: string | undefined;
|
|
71
|
+
blockers?: string[] | undefined;
|
|
72
|
+
risks?: string[] | undefined;
|
|
73
|
+
evidenceRefs?: string[] | undefined;
|
|
74
|
+
writtenBy?: string | undefined;
|
|
75
|
+
}>;
|
|
76
|
+
export type Checkpoint = z.infer<typeof Checkpoint>;
|
|
77
|
+
/** 세션 종료 산출물. 계약↔결과 짝이 어긋나지 않도록 Session entity 안에 둔다 (OM §7.1). */
|
|
78
|
+
export declare const Handoff: z.ZodObject<{
|
|
79
|
+
done: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
80
|
+
changed: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
81
|
+
verified: z.ZodString;
|
|
82
|
+
unresolved: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
83
|
+
next: z.ZodString;
|
|
84
|
+
snapshot: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
85
|
+
sourceId: z.ZodString;
|
|
86
|
+
baseline: z.ZodString;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
sourceId: string;
|
|
89
|
+
baseline: string;
|
|
90
|
+
}, {
|
|
91
|
+
sourceId: string;
|
|
92
|
+
baseline: string;
|
|
93
|
+
}>, "many">>;
|
|
94
|
+
recordedAt: z.ZodString;
|
|
95
|
+
}, "strip", z.ZodTypeAny, {
|
|
96
|
+
recordedAt: string;
|
|
97
|
+
done: string[];
|
|
98
|
+
changed: string[];
|
|
99
|
+
verified: string;
|
|
100
|
+
unresolved: string[];
|
|
101
|
+
next: string;
|
|
102
|
+
snapshot: {
|
|
103
|
+
sourceId: string;
|
|
104
|
+
baseline: string;
|
|
105
|
+
}[];
|
|
106
|
+
}, {
|
|
107
|
+
recordedAt: string;
|
|
108
|
+
verified: string;
|
|
109
|
+
next: string;
|
|
110
|
+
done?: string[] | undefined;
|
|
111
|
+
changed?: string[] | undefined;
|
|
112
|
+
unresolved?: string[] | undefined;
|
|
113
|
+
snapshot?: {
|
|
114
|
+
sourceId: string;
|
|
115
|
+
baseline: string;
|
|
116
|
+
}[] | undefined;
|
|
117
|
+
}>;
|
|
118
|
+
export type Handoff = z.infer<typeof Handoff>;
|
|
119
|
+
export declare const Session: z.ZodObject<{
|
|
120
|
+
id: z.ZodString;
|
|
121
|
+
version: z.ZodNumber;
|
|
122
|
+
status: z.ZodEnum<["READY", "ACTIVE", "PAUSED", "BLOCKED", "DONE", "FAILED"]>;
|
|
123
|
+
role: z.ZodEnum<["planner", "researcher", "implementer", "verifier"]>;
|
|
124
|
+
blockId: z.ZodOptional<z.ZodString>;
|
|
125
|
+
goal: z.ZodString;
|
|
126
|
+
/**
|
|
127
|
+
* 검증 가능한 완료조건 (C-03 §2). "무엇을 할지"(goal)와 "언제 끝인지"를 분리한다 —
|
|
128
|
+
* Host completion loop projection과 Verifier test plan의 근거가 된다.
|
|
129
|
+
* default([])라 기존 entity 파일이 그대로 읽힌다.
|
|
130
|
+
*/
|
|
131
|
+
doneCriteria: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
132
|
+
/**
|
|
133
|
+
* 이 일을 끝까지 끌고 갈 주체 (C-04 §1.1). 다른 파트에 무언가를 물었다는 이유로
|
|
134
|
+
* 바뀌지 않는다 — 바꾸는 경로 자체를 두지 않는다.
|
|
135
|
+
*/
|
|
136
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
137
|
+
/**
|
|
138
|
+
* 이 일에 걸린 결정 영역. "무엇을 정해야 하는가"의 목록이며 결정권자는 아니다.
|
|
139
|
+
* 비어 있는 것이 정상이다 — 대부분의 구현 세션은 cross-part 결정을 요구하지 않는다.
|
|
140
|
+
*/
|
|
141
|
+
decisionDomains: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
142
|
+
/**
|
|
143
|
+
* 이번 세션에 한해 정한 결정권자 (domain → role). Profile ownership으로 풀리지 않는
|
|
144
|
+
* 영역을 여기서 명시한다. OM §7.5의 `Authority:`(실행 자율도)와 다른 축이라 이름을
|
|
145
|
+
* 나눴다 — 저쪽은 "이 세션이 무엇을 자율로 해도 되는가", 이쪽은 "이 결정이 누구 것인가".
|
|
146
|
+
*/
|
|
147
|
+
decisionAuthority: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
148
|
+
/** 외부에서 받아야 할 입력. 받는다는 사실이지 ownership 이전이 아니다 (C-04 §1.2). */
|
|
149
|
+
dependencies: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
150
|
+
taskPointer: z.ZodOptional<z.ZodString>;
|
|
151
|
+
canonicalSources: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
152
|
+
sourceId: z.ZodString;
|
|
153
|
+
baseline: z.ZodString;
|
|
154
|
+
}, "strip", z.ZodTypeAny, {
|
|
155
|
+
sourceId: string;
|
|
156
|
+
baseline: string;
|
|
157
|
+
}, {
|
|
158
|
+
sourceId: string;
|
|
159
|
+
baseline: string;
|
|
160
|
+
}>, "many">>;
|
|
161
|
+
readScope: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
162
|
+
writeBoundary: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
163
|
+
outOfScope: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
164
|
+
/** Controller가 이 세션에 한해 허용한 SOFT DENY 항목 (OM §5.1 Policy Exception). */
|
|
165
|
+
policyExceptions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
166
|
+
checkpoint: z.ZodOptional<z.ZodObject<{
|
|
167
|
+
position: z.ZodString;
|
|
168
|
+
completedTasks: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
169
|
+
nextAction: z.ZodString;
|
|
170
|
+
uncommittedChanges: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
171
|
+
/**
|
|
172
|
+
* 의미 있는 전환을 남기기 위한 필드들 (C-10 §2.1). 시간 경과는 전환이 아니다 —
|
|
173
|
+
* "지금 무엇이 사실이라고 보는가"와 "그 판단의 근거"가 있어야 다음 사람이 이어받는다.
|
|
174
|
+
*
|
|
175
|
+
* 전부 optional·default다: 기존 세션 파일이 그대로 읽혀야 한다 (doneCriteria 선례).
|
|
176
|
+
* 퍼센트는 여기 없다 — 필요하면 렌더가 만드는 projection이지 기록이 아니다.
|
|
177
|
+
*/
|
|
178
|
+
currentJudgment: z.ZodOptional<z.ZodString>;
|
|
179
|
+
blockers: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
180
|
+
risks: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
181
|
+
evidenceRefs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
182
|
+
/** 누가 적었는가 (execution principal). 소유권 검사와 함께 의미를 갖는다. */
|
|
183
|
+
writtenBy: z.ZodOptional<z.ZodString>;
|
|
184
|
+
recordedAt: z.ZodString;
|
|
185
|
+
}, "strip", z.ZodTypeAny, {
|
|
186
|
+
position: string;
|
|
187
|
+
completedTasks: string[];
|
|
188
|
+
nextAction: string;
|
|
189
|
+
uncommittedChanges: string[];
|
|
190
|
+
blockers: string[];
|
|
191
|
+
risks: string[];
|
|
192
|
+
evidenceRefs: string[];
|
|
193
|
+
recordedAt: string;
|
|
194
|
+
currentJudgment?: string | undefined;
|
|
195
|
+
writtenBy?: string | undefined;
|
|
196
|
+
}, {
|
|
197
|
+
position: string;
|
|
198
|
+
nextAction: string;
|
|
199
|
+
recordedAt: string;
|
|
200
|
+
completedTasks?: string[] | undefined;
|
|
201
|
+
uncommittedChanges?: string[] | undefined;
|
|
202
|
+
currentJudgment?: string | undefined;
|
|
203
|
+
blockers?: string[] | undefined;
|
|
204
|
+
risks?: string[] | undefined;
|
|
205
|
+
evidenceRefs?: string[] | undefined;
|
|
206
|
+
writtenBy?: string | undefined;
|
|
207
|
+
}>>;
|
|
208
|
+
handoff: z.ZodOptional<z.ZodObject<{
|
|
209
|
+
done: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
210
|
+
changed: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
211
|
+
verified: z.ZodString;
|
|
212
|
+
unresolved: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
213
|
+
next: z.ZodString;
|
|
214
|
+
snapshot: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
215
|
+
sourceId: z.ZodString;
|
|
216
|
+
baseline: z.ZodString;
|
|
217
|
+
}, "strip", z.ZodTypeAny, {
|
|
218
|
+
sourceId: string;
|
|
219
|
+
baseline: string;
|
|
220
|
+
}, {
|
|
221
|
+
sourceId: string;
|
|
222
|
+
baseline: string;
|
|
223
|
+
}>, "many">>;
|
|
224
|
+
recordedAt: z.ZodString;
|
|
225
|
+
}, "strip", z.ZodTypeAny, {
|
|
226
|
+
recordedAt: string;
|
|
227
|
+
done: string[];
|
|
228
|
+
changed: string[];
|
|
229
|
+
verified: string;
|
|
230
|
+
unresolved: string[];
|
|
231
|
+
next: string;
|
|
232
|
+
snapshot: {
|
|
233
|
+
sourceId: string;
|
|
234
|
+
baseline: string;
|
|
235
|
+
}[];
|
|
236
|
+
}, {
|
|
237
|
+
recordedAt: string;
|
|
238
|
+
verified: string;
|
|
239
|
+
next: string;
|
|
240
|
+
done?: string[] | undefined;
|
|
241
|
+
changed?: string[] | undefined;
|
|
242
|
+
unresolved?: string[] | undefined;
|
|
243
|
+
snapshot?: {
|
|
244
|
+
sourceId: string;
|
|
245
|
+
baseline: string;
|
|
246
|
+
}[] | undefined;
|
|
247
|
+
}>>;
|
|
248
|
+
}, "strip", z.ZodTypeAny, {
|
|
249
|
+
status: "READY" | "ACTIVE" | "PAUSED" | "BLOCKED" | "DONE" | "FAILED";
|
|
250
|
+
id: string;
|
|
251
|
+
version: number;
|
|
252
|
+
role: "planner" | "researcher" | "implementer" | "verifier";
|
|
253
|
+
goal: string;
|
|
254
|
+
doneCriteria: string[];
|
|
255
|
+
decisionDomains: string[];
|
|
256
|
+
decisionAuthority: Record<string, string>;
|
|
257
|
+
dependencies: string[];
|
|
258
|
+
canonicalSources: {
|
|
259
|
+
sourceId: string;
|
|
260
|
+
baseline: string;
|
|
261
|
+
}[];
|
|
262
|
+
readScope: string[];
|
|
263
|
+
writeBoundary: string[];
|
|
264
|
+
outOfScope: string[];
|
|
265
|
+
policyExceptions: string[];
|
|
266
|
+
blockId?: string | undefined;
|
|
267
|
+
owner?: string | undefined;
|
|
268
|
+
taskPointer?: string | undefined;
|
|
269
|
+
checkpoint?: {
|
|
270
|
+
position: string;
|
|
271
|
+
completedTasks: string[];
|
|
272
|
+
nextAction: string;
|
|
273
|
+
uncommittedChanges: string[];
|
|
274
|
+
blockers: string[];
|
|
275
|
+
risks: string[];
|
|
276
|
+
evidenceRefs: string[];
|
|
277
|
+
recordedAt: string;
|
|
278
|
+
currentJudgment?: string | undefined;
|
|
279
|
+
writtenBy?: string | undefined;
|
|
280
|
+
} | undefined;
|
|
281
|
+
handoff?: {
|
|
282
|
+
recordedAt: string;
|
|
283
|
+
done: string[];
|
|
284
|
+
changed: string[];
|
|
285
|
+
verified: string;
|
|
286
|
+
unresolved: string[];
|
|
287
|
+
next: string;
|
|
288
|
+
snapshot: {
|
|
289
|
+
sourceId: string;
|
|
290
|
+
baseline: string;
|
|
291
|
+
}[];
|
|
292
|
+
} | undefined;
|
|
293
|
+
}, {
|
|
294
|
+
status: "READY" | "ACTIVE" | "PAUSED" | "BLOCKED" | "DONE" | "FAILED";
|
|
295
|
+
id: string;
|
|
296
|
+
version: number;
|
|
297
|
+
role: "planner" | "researcher" | "implementer" | "verifier";
|
|
298
|
+
goal: string;
|
|
299
|
+
blockId?: string | undefined;
|
|
300
|
+
doneCriteria?: string[] | undefined;
|
|
301
|
+
owner?: string | undefined;
|
|
302
|
+
decisionDomains?: string[] | undefined;
|
|
303
|
+
decisionAuthority?: Record<string, string> | undefined;
|
|
304
|
+
dependencies?: string[] | undefined;
|
|
305
|
+
taskPointer?: string | undefined;
|
|
306
|
+
canonicalSources?: {
|
|
307
|
+
sourceId: string;
|
|
308
|
+
baseline: string;
|
|
309
|
+
}[] | undefined;
|
|
310
|
+
readScope?: string[] | undefined;
|
|
311
|
+
writeBoundary?: string[] | undefined;
|
|
312
|
+
outOfScope?: string[] | undefined;
|
|
313
|
+
policyExceptions?: string[] | undefined;
|
|
314
|
+
checkpoint?: {
|
|
315
|
+
position: string;
|
|
316
|
+
nextAction: string;
|
|
317
|
+
recordedAt: string;
|
|
318
|
+
completedTasks?: string[] | undefined;
|
|
319
|
+
uncommittedChanges?: string[] | undefined;
|
|
320
|
+
currentJudgment?: string | undefined;
|
|
321
|
+
blockers?: string[] | undefined;
|
|
322
|
+
risks?: string[] | undefined;
|
|
323
|
+
evidenceRefs?: string[] | undefined;
|
|
324
|
+
writtenBy?: string | undefined;
|
|
325
|
+
} | undefined;
|
|
326
|
+
handoff?: {
|
|
327
|
+
recordedAt: string;
|
|
328
|
+
verified: string;
|
|
329
|
+
next: string;
|
|
330
|
+
done?: string[] | undefined;
|
|
331
|
+
changed?: string[] | undefined;
|
|
332
|
+
unresolved?: string[] | undefined;
|
|
333
|
+
snapshot?: {
|
|
334
|
+
sourceId: string;
|
|
335
|
+
baseline: string;
|
|
336
|
+
}[] | undefined;
|
|
337
|
+
} | undefined;
|
|
338
|
+
}>;
|
|
339
|
+
export type Session = z.infer<typeof Session>;
|
|
340
|
+
/** Inbox lifecycle (OM §11.2). APPROVED는 승인 완료일 뿐 외부 write 권한이 아니다. */
|
|
341
|
+
export declare const RequestStatus: z.ZodEnum<["AWAITING_APPROVAL", "APPROVED", "QUEUED", "DEFERRED", "DISMISSED", "DONE"]>;
|
|
342
|
+
export type RequestStatus = z.infer<typeof RequestStatus>;
|
|
343
|
+
export declare const DecisionKind: z.ZodEnum<["approve", "revise", "defer", "dismiss", "queue"]>;
|
|
344
|
+
export type DecisionKind = z.infer<typeof DecisionKind>;
|
|
345
|
+
/**
|
|
346
|
+
* Controller가 원 Thread를 다시 읽지 않고 판단할 수 있도록 Monitor가 준비한 Decision
|
|
347
|
+
* Packet (OM §11.1). 이 내용은 생성 시점의 분석 snapshot이며, 조회 시점의 현재 상태와
|
|
348
|
+
* 섞지 않는다 — 현재 맥락은 Derived View로 따로 만든다 (C-01 §6).
|
|
349
|
+
*/
|
|
350
|
+
export declare const ApprovalRequest: z.ZodObject<{
|
|
351
|
+
id: z.ZodString;
|
|
352
|
+
version: z.ZodNumber;
|
|
353
|
+
status: z.ZodEnum<["AWAITING_APPROVAL", "APPROVED", "QUEUED", "DEFERRED", "DISMISSED", "DONE"]>;
|
|
354
|
+
type: z.ZodEnum<["informational", "actionable", "work"]>;
|
|
355
|
+
priority: z.ZodEnum<["P0", "P1", "P2"]>;
|
|
356
|
+
title: z.ZodString;
|
|
357
|
+
detectedAt: z.ZodString;
|
|
358
|
+
source: z.ZodObject<{
|
|
359
|
+
eventKey: z.ZodString;
|
|
360
|
+
reference: z.ZodString;
|
|
361
|
+
threadLastEventId: z.ZodOptional<z.ZodString>;
|
|
362
|
+
}, "strip", z.ZodTypeAny, {
|
|
363
|
+
eventKey: string;
|
|
364
|
+
reference: string;
|
|
365
|
+
threadLastEventId?: string | undefined;
|
|
366
|
+
}, {
|
|
367
|
+
eventKey: string;
|
|
368
|
+
reference: string;
|
|
369
|
+
threadLastEventId?: string | undefined;
|
|
370
|
+
}>;
|
|
371
|
+
situation: z.ZodString;
|
|
372
|
+
context: z.ZodDefault<z.ZodString>;
|
|
373
|
+
impact: z.ZodObject<{
|
|
374
|
+
interruptRequired: z.ZodBoolean;
|
|
375
|
+
affectedSessions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
376
|
+
rationale: z.ZodDefault<z.ZodString>;
|
|
377
|
+
}, "strip", z.ZodTypeAny, {
|
|
378
|
+
interruptRequired: boolean;
|
|
379
|
+
affectedSessions: string[];
|
|
380
|
+
rationale: string;
|
|
381
|
+
}, {
|
|
382
|
+
interruptRequired: boolean;
|
|
383
|
+
affectedSessions?: string[] | undefined;
|
|
384
|
+
rationale?: string | undefined;
|
|
385
|
+
}>;
|
|
386
|
+
recommendation: z.ZodDefault<z.ZodString>;
|
|
387
|
+
draft: z.ZodOptional<z.ZodString>;
|
|
388
|
+
snapshot: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
389
|
+
sourceId: z.ZodString;
|
|
390
|
+
baseline: z.ZodString;
|
|
391
|
+
}, "strip", z.ZodTypeAny, {
|
|
392
|
+
sourceId: string;
|
|
393
|
+
baseline: string;
|
|
394
|
+
}, {
|
|
395
|
+
sourceId: string;
|
|
396
|
+
baseline: string;
|
|
397
|
+
}>, "many">>;
|
|
398
|
+
/** 이 요청을 결정할 수 있는 Controller identity (OM §11.6). */
|
|
399
|
+
authorizedApprover: z.ZodString;
|
|
400
|
+
allowedDecisions: z.ZodArray<z.ZodEnum<["approve", "revise", "defer", "dismiss", "queue"]>, "atleastone">;
|
|
401
|
+
expiresAt: z.ZodOptional<z.ZodString>;
|
|
402
|
+
/**
|
|
403
|
+
* 이 요청이 Agent의 상신에서 왔다면 그 근거 (C-13 §2).
|
|
404
|
+
*
|
|
405
|
+
* optional인 이유: Monitor packet 경로(외부 사건 감지)는 escalation이 아니므로 이 값이
|
|
406
|
+
* 없다. 기존 요청 파일도 그대로 읽힌다.
|
|
407
|
+
*/
|
|
408
|
+
escalation: z.ZodOptional<z.ZodObject<{
|
|
409
|
+
escalationId: z.ZodString;
|
|
410
|
+
predicates: z.ZodArray<z.ZodString, "atleastone">;
|
|
411
|
+
evidenceRefs: z.ZodArray<z.ZodString, "atleastone">;
|
|
412
|
+
affectedNodes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
413
|
+
/** 지금 못 하는 작업 노드. 경계 영역(blockedScope)과 다른 축이다. */
|
|
414
|
+
blockedNodes: z.ZodArray<z.ZodString, "atleastone">;
|
|
415
|
+
blockedScope: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
416
|
+
stillRunnableNodes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
417
|
+
previousEscalationId: z.ZodOptional<z.ZodString>;
|
|
418
|
+
}, "strip", z.ZodTypeAny, {
|
|
419
|
+
evidenceRefs: [string, ...string[]];
|
|
420
|
+
escalationId: string;
|
|
421
|
+
predicates: [string, ...string[]];
|
|
422
|
+
affectedNodes: string[];
|
|
423
|
+
blockedNodes: [string, ...string[]];
|
|
424
|
+
blockedScope: string[];
|
|
425
|
+
stillRunnableNodes: string[];
|
|
426
|
+
previousEscalationId?: string | undefined;
|
|
427
|
+
}, {
|
|
428
|
+
evidenceRefs: [string, ...string[]];
|
|
429
|
+
escalationId: string;
|
|
430
|
+
predicates: [string, ...string[]];
|
|
431
|
+
blockedNodes: [string, ...string[]];
|
|
432
|
+
affectedNodes?: string[] | undefined;
|
|
433
|
+
blockedScope?: string[] | undefined;
|
|
434
|
+
stillRunnableNodes?: string[] | undefined;
|
|
435
|
+
previousEscalationId?: string | undefined;
|
|
436
|
+
}>>;
|
|
437
|
+
decision: z.ZodOptional<z.ZodObject<{
|
|
438
|
+
kind: z.ZodEnum<["approve", "revise", "defer", "dismiss", "queue"]>;
|
|
439
|
+
actor: z.ZodString;
|
|
440
|
+
channel: z.ZodString;
|
|
441
|
+
revision: z.ZodOptional<z.ZodString>;
|
|
442
|
+
decidedAt: z.ZodString;
|
|
443
|
+
}, "strip", z.ZodTypeAny, {
|
|
444
|
+
kind: "approve" | "revise" | "defer" | "dismiss" | "queue";
|
|
445
|
+
actor: string;
|
|
446
|
+
channel: string;
|
|
447
|
+
decidedAt: string;
|
|
448
|
+
revision?: string | undefined;
|
|
449
|
+
}, {
|
|
450
|
+
kind: "approve" | "revise" | "defer" | "dismiss" | "queue";
|
|
451
|
+
actor: string;
|
|
452
|
+
channel: string;
|
|
453
|
+
decidedAt: string;
|
|
454
|
+
revision?: string | undefined;
|
|
455
|
+
}>>;
|
|
456
|
+
resultRef: z.ZodOptional<z.ZodString>;
|
|
457
|
+
}, "strip", z.ZodTypeAny, {
|
|
458
|
+
type: "informational" | "actionable" | "work";
|
|
459
|
+
status: "DONE" | "AWAITING_APPROVAL" | "APPROVED" | "QUEUED" | "DEFERRED" | "DISMISSED";
|
|
460
|
+
snapshot: {
|
|
461
|
+
sourceId: string;
|
|
462
|
+
baseline: string;
|
|
463
|
+
}[];
|
|
464
|
+
id: string;
|
|
465
|
+
version: number;
|
|
466
|
+
priority: "P0" | "P1" | "P2";
|
|
467
|
+
title: string;
|
|
468
|
+
detectedAt: string;
|
|
469
|
+
source: {
|
|
470
|
+
eventKey: string;
|
|
471
|
+
reference: string;
|
|
472
|
+
threadLastEventId?: string | undefined;
|
|
473
|
+
};
|
|
474
|
+
situation: string;
|
|
475
|
+
context: string;
|
|
476
|
+
impact: {
|
|
477
|
+
interruptRequired: boolean;
|
|
478
|
+
affectedSessions: string[];
|
|
479
|
+
rationale: string;
|
|
480
|
+
};
|
|
481
|
+
recommendation: string;
|
|
482
|
+
authorizedApprover: string;
|
|
483
|
+
allowedDecisions: ["approve" | "revise" | "defer" | "dismiss" | "queue", ...("approve" | "revise" | "defer" | "dismiss" | "queue")[]];
|
|
484
|
+
draft?: string | undefined;
|
|
485
|
+
expiresAt?: string | undefined;
|
|
486
|
+
escalation?: {
|
|
487
|
+
evidenceRefs: [string, ...string[]];
|
|
488
|
+
escalationId: string;
|
|
489
|
+
predicates: [string, ...string[]];
|
|
490
|
+
affectedNodes: string[];
|
|
491
|
+
blockedNodes: [string, ...string[]];
|
|
492
|
+
blockedScope: string[];
|
|
493
|
+
stillRunnableNodes: string[];
|
|
494
|
+
previousEscalationId?: string | undefined;
|
|
495
|
+
} | undefined;
|
|
496
|
+
decision?: {
|
|
497
|
+
kind: "approve" | "revise" | "defer" | "dismiss" | "queue";
|
|
498
|
+
actor: string;
|
|
499
|
+
channel: string;
|
|
500
|
+
decidedAt: string;
|
|
501
|
+
revision?: string | undefined;
|
|
502
|
+
} | undefined;
|
|
503
|
+
resultRef?: string | undefined;
|
|
504
|
+
}, {
|
|
505
|
+
type: "informational" | "actionable" | "work";
|
|
506
|
+
status: "DONE" | "AWAITING_APPROVAL" | "APPROVED" | "QUEUED" | "DEFERRED" | "DISMISSED";
|
|
507
|
+
id: string;
|
|
508
|
+
version: number;
|
|
509
|
+
priority: "P0" | "P1" | "P2";
|
|
510
|
+
title: string;
|
|
511
|
+
detectedAt: string;
|
|
512
|
+
source: {
|
|
513
|
+
eventKey: string;
|
|
514
|
+
reference: string;
|
|
515
|
+
threadLastEventId?: string | undefined;
|
|
516
|
+
};
|
|
517
|
+
situation: string;
|
|
518
|
+
impact: {
|
|
519
|
+
interruptRequired: boolean;
|
|
520
|
+
affectedSessions?: string[] | undefined;
|
|
521
|
+
rationale?: string | undefined;
|
|
522
|
+
};
|
|
523
|
+
authorizedApprover: string;
|
|
524
|
+
allowedDecisions: ["approve" | "revise" | "defer" | "dismiss" | "queue", ...("approve" | "revise" | "defer" | "dismiss" | "queue")[]];
|
|
525
|
+
snapshot?: {
|
|
526
|
+
sourceId: string;
|
|
527
|
+
baseline: string;
|
|
528
|
+
}[] | undefined;
|
|
529
|
+
context?: string | undefined;
|
|
530
|
+
recommendation?: string | undefined;
|
|
531
|
+
draft?: string | undefined;
|
|
532
|
+
expiresAt?: string | undefined;
|
|
533
|
+
escalation?: {
|
|
534
|
+
evidenceRefs: [string, ...string[]];
|
|
535
|
+
escalationId: string;
|
|
536
|
+
predicates: [string, ...string[]];
|
|
537
|
+
blockedNodes: [string, ...string[]];
|
|
538
|
+
affectedNodes?: string[] | undefined;
|
|
539
|
+
blockedScope?: string[] | undefined;
|
|
540
|
+
stillRunnableNodes?: string[] | undefined;
|
|
541
|
+
previousEscalationId?: string | undefined;
|
|
542
|
+
} | undefined;
|
|
543
|
+
decision?: {
|
|
544
|
+
kind: "approve" | "revise" | "defer" | "dismiss" | "queue";
|
|
545
|
+
actor: string;
|
|
546
|
+
channel: string;
|
|
547
|
+
decidedAt: string;
|
|
548
|
+
revision?: string | undefined;
|
|
549
|
+
} | undefined;
|
|
550
|
+
resultRef?: string | undefined;
|
|
551
|
+
}>;
|
|
552
|
+
export type ApprovalRequest = z.infer<typeof ApprovalRequest>;
|
|
553
|
+
/**
|
|
554
|
+
* 채널 무관 결정 DTO. 모든 채널이 동일 requestId를 쓰며, 최초 유효 Decision 이후의
|
|
555
|
+
* 입력은 CAS 실패로 거절된다 (C-01 §7~8).
|
|
556
|
+
*/
|
|
557
|
+
export declare const ApprovalDecision: z.ZodObject<{
|
|
558
|
+
requestId: z.ZodString;
|
|
559
|
+
expectedVersion: z.ZodNumber;
|
|
560
|
+
kind: z.ZodEnum<["approve", "revise", "defer", "dismiss", "queue"]>;
|
|
561
|
+
actor: z.ZodString;
|
|
562
|
+
channel: z.ZodString;
|
|
563
|
+
revision: z.ZodOptional<z.ZodString>;
|
|
564
|
+
decidedAt: z.ZodString;
|
|
565
|
+
}, "strip", z.ZodTypeAny, {
|
|
566
|
+
kind: "approve" | "revise" | "defer" | "dismiss" | "queue";
|
|
567
|
+
actor: string;
|
|
568
|
+
channel: string;
|
|
569
|
+
decidedAt: string;
|
|
570
|
+
requestId: string;
|
|
571
|
+
expectedVersion: number;
|
|
572
|
+
revision?: string | undefined;
|
|
573
|
+
}, {
|
|
574
|
+
kind: "approve" | "revise" | "defer" | "dismiss" | "queue";
|
|
575
|
+
actor: string;
|
|
576
|
+
channel: string;
|
|
577
|
+
decidedAt: string;
|
|
578
|
+
requestId: string;
|
|
579
|
+
expectedVersion: number;
|
|
580
|
+
revision?: string | undefined;
|
|
581
|
+
}>;
|
|
582
|
+
export type ApprovalDecision = z.infer<typeof ApprovalDecision>;
|
|
583
|
+
/** Grant lifecycle (OM §11.5). 성공한 Grant는 재소비 불가 — replay guard의 근간. */
|
|
584
|
+
export declare const GrantStatus: z.ZodEnum<["READY", "CLAIMED", "EXECUTED", "INVALIDATED", "EXPIRED"]>;
|
|
585
|
+
export type GrantStatus = z.infer<typeof GrantStatus>;
|
|
586
|
+
/**
|
|
587
|
+
* Policy hierarchy의 하위 override가 아니라, Controller가 hierarchy 밖에서 생성하는
|
|
588
|
+
* one-shot execution contract (OM §5.2). Session 권한은 그대로 두고 별도 Executor에게만
|
|
589
|
+
* 단일 Action을 허용한다.
|
|
590
|
+
*/
|
|
591
|
+
export declare const ExecutionGrant: z.ZodObject<{
|
|
592
|
+
id: z.ZodString;
|
|
593
|
+
version: z.ZodNumber;
|
|
594
|
+
requestId: z.ZodString;
|
|
595
|
+
status: z.ZodEnum<["READY", "CLAIMED", "EXECUTED", "INVALIDATED", "EXPIRED"]>;
|
|
596
|
+
issuedBy: z.ZodString;
|
|
597
|
+
issuedAt: z.ZodString;
|
|
598
|
+
expiresAt: z.ZodOptional<z.ZodString>;
|
|
599
|
+
singleUse: z.ZodDefault<z.ZodBoolean>;
|
|
600
|
+
action: z.ZodString;
|
|
601
|
+
target: z.ZodString;
|
|
602
|
+
payload: z.ZodString;
|
|
603
|
+
/** 게시 직전 Drift Guard가 대조할 기준 (OM §11.9). */
|
|
604
|
+
snapshot: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
605
|
+
sourceId: z.ZodString;
|
|
606
|
+
baseline: z.ZodString;
|
|
607
|
+
}, "strip", z.ZodTypeAny, {
|
|
608
|
+
sourceId: string;
|
|
609
|
+
baseline: string;
|
|
610
|
+
}, {
|
|
611
|
+
sourceId: string;
|
|
612
|
+
baseline: string;
|
|
613
|
+
}>, "many">>;
|
|
614
|
+
threadLastEventId: z.ZodOptional<z.ZodString>;
|
|
615
|
+
allowedWrites: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
616
|
+
claimedBy: z.ZodOptional<z.ZodString>;
|
|
617
|
+
consumedAt: z.ZodOptional<z.ZodString>;
|
|
618
|
+
resultRef: z.ZodOptional<z.ZodString>;
|
|
619
|
+
}, "strip", z.ZodTypeAny, {
|
|
620
|
+
status: "READY" | "CLAIMED" | "EXECUTED" | "INVALIDATED" | "EXPIRED";
|
|
621
|
+
snapshot: {
|
|
622
|
+
sourceId: string;
|
|
623
|
+
baseline: string;
|
|
624
|
+
}[];
|
|
625
|
+
id: string;
|
|
626
|
+
version: number;
|
|
627
|
+
requestId: string;
|
|
628
|
+
issuedBy: string;
|
|
629
|
+
issuedAt: string;
|
|
630
|
+
singleUse: boolean;
|
|
631
|
+
action: string;
|
|
632
|
+
target: string;
|
|
633
|
+
payload: string;
|
|
634
|
+
allowedWrites: string[];
|
|
635
|
+
threadLastEventId?: string | undefined;
|
|
636
|
+
expiresAt?: string | undefined;
|
|
637
|
+
resultRef?: string | undefined;
|
|
638
|
+
claimedBy?: string | undefined;
|
|
639
|
+
consumedAt?: string | undefined;
|
|
640
|
+
}, {
|
|
641
|
+
status: "READY" | "CLAIMED" | "EXECUTED" | "INVALIDATED" | "EXPIRED";
|
|
642
|
+
id: string;
|
|
643
|
+
version: number;
|
|
644
|
+
requestId: string;
|
|
645
|
+
issuedBy: string;
|
|
646
|
+
issuedAt: string;
|
|
647
|
+
action: string;
|
|
648
|
+
target: string;
|
|
649
|
+
payload: string;
|
|
650
|
+
snapshot?: {
|
|
651
|
+
sourceId: string;
|
|
652
|
+
baseline: string;
|
|
653
|
+
}[] | undefined;
|
|
654
|
+
threadLastEventId?: string | undefined;
|
|
655
|
+
expiresAt?: string | undefined;
|
|
656
|
+
resultRef?: string | undefined;
|
|
657
|
+
singleUse?: boolean | undefined;
|
|
658
|
+
allowedWrites?: string[] | undefined;
|
|
659
|
+
claimedBy?: string | undefined;
|
|
660
|
+
consumedAt?: string | undefined;
|
|
661
|
+
}>;
|
|
662
|
+
export type ExecutionGrant = z.infer<typeof ExecutionGrant>;
|
|
663
|
+
export declare const QueueState: z.ZodEnum<["READY", "ACTIVE", "BLOCKED", "DONE"]>;
|
|
664
|
+
export type QueueState = z.infer<typeof QueueState>;
|
|
665
|
+
/** 승인되어 수행하기로 한 작업 (OM §4.8). inbox = 판단 대기, queue = 승인된 작업. */
|
|
666
|
+
export declare const QueueItem: z.ZodObject<{
|
|
667
|
+
id: z.ZodString;
|
|
668
|
+
version: z.ZodNumber;
|
|
669
|
+
state: z.ZodEnum<["READY", "ACTIVE", "BLOCKED", "DONE"]>;
|
|
670
|
+
title: z.ZodString;
|
|
671
|
+
sourceRequestId: z.ZodOptional<z.ZodString>;
|
|
672
|
+
blockId: z.ZodOptional<z.ZodString>;
|
|
673
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
674
|
+
}, "strip", z.ZodTypeAny, {
|
|
675
|
+
id: string;
|
|
676
|
+
version: number;
|
|
677
|
+
title: string;
|
|
678
|
+
state: "READY" | "ACTIVE" | "BLOCKED" | "DONE";
|
|
679
|
+
blockId?: string | undefined;
|
|
680
|
+
sourceRequestId?: string | undefined;
|
|
681
|
+
sessionId?: string | undefined;
|
|
682
|
+
}, {
|
|
683
|
+
id: string;
|
|
684
|
+
version: number;
|
|
685
|
+
title: string;
|
|
686
|
+
state: "READY" | "ACTIVE" | "BLOCKED" | "DONE";
|
|
687
|
+
blockId?: string | undefined;
|
|
688
|
+
sourceRequestId?: string | undefined;
|
|
689
|
+
sessionId?: string | undefined;
|
|
690
|
+
}>;
|
|
691
|
+
export type QueueItem = z.infer<typeof QueueItem>;
|
|
692
|
+
/** Phase B 처리 결과 — 부분 실패해도 cursor는 전진하고 실패분만 재시도한다 (OM §10.5). */
|
|
693
|
+
export declare const EventProcessing: z.ZodEnum<["LOGGED", "PROCESSED", "PENDING_RETRY"]>;
|
|
694
|
+
export type EventProcessing = z.infer<typeof EventProcessing>;
|
|
695
|
+
export declare const MonitorEvent: z.ZodObject<{
|
|
696
|
+
eventKey: z.ZodString;
|
|
697
|
+
version: z.ZodNumber;
|
|
698
|
+
detectedAt: z.ZodString;
|
|
699
|
+
type: z.ZodEnum<["informational", "actionable", "work"]>;
|
|
700
|
+
suggestedPriority: z.ZodEnum<["P0", "P1", "P2"]>;
|
|
701
|
+
processing: z.ZodEnum<["LOGGED", "PROCESSED", "PENDING_RETRY"]>;
|
|
702
|
+
inboxCandidate: z.ZodBoolean;
|
|
703
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
704
|
+
/**
|
|
705
|
+
* 관련성 판정과 그 근거 (C-07 §3). 숫자가 아니라 문장을 남기는 이유는, 판정이 틀렸을 때
|
|
706
|
+
* 사람이 어디가 틀렸는지 보고 뒤집을 수 있어야 하기 때문이다.
|
|
707
|
+
* optional이라 기존 event 파일이 그대로 읽힌다.
|
|
708
|
+
*/
|
|
709
|
+
relevance: z.ZodOptional<z.ZodObject<{
|
|
710
|
+
explicit: z.ZodEnum<["HIGH", "LOW"]>;
|
|
711
|
+
actual: z.ZodEnum<["HIGH", "LOW"]>;
|
|
712
|
+
disposition: z.ZodEnum<["INBOX", "SHADOW"]>;
|
|
713
|
+
evidence: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
714
|
+
}, "strip", z.ZodTypeAny, {
|
|
715
|
+
explicit: "HIGH" | "LOW";
|
|
716
|
+
actual: "HIGH" | "LOW";
|
|
717
|
+
disposition: "INBOX" | "SHADOW";
|
|
718
|
+
evidence: string[];
|
|
719
|
+
}, {
|
|
720
|
+
explicit: "HIGH" | "LOW";
|
|
721
|
+
actual: "HIGH" | "LOW";
|
|
722
|
+
disposition: "INBOX" | "SHADOW";
|
|
723
|
+
evidence?: string[] | undefined;
|
|
724
|
+
}>>;
|
|
725
|
+
/**
|
|
726
|
+
* 조사를 다시 하려면 원본이 있어야 한다. cursor는 이미 지나갔고 provider가 같은 것을
|
|
727
|
+
* 또 주리라는 보장이 없으므로, 재시도에 필요한 만큼을 여기 남긴다 (OM §10.5).
|
|
728
|
+
*/
|
|
729
|
+
replay: z.ZodOptional<z.ZodObject<{
|
|
730
|
+
reference: z.ZodString;
|
|
731
|
+
raw: z.ZodOptional<z.ZodUnknown>;
|
|
732
|
+
hints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
733
|
+
/**
|
|
734
|
+
* 이미 끝난 조사 단계 (C-07 §6.3). 재시도가 처음부터 다시 하면 비싼 단계에서
|
|
735
|
+
* 실패한 사건은 영영 넘지 못한다.
|
|
736
|
+
*/
|
|
737
|
+
steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
738
|
+
id: z.ZodString;
|
|
739
|
+
kind: z.ZodEnum<["DONE", "UNDECIDABLE", "SKIPPED"]>;
|
|
740
|
+
findings: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
741
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
742
|
+
}, "strip", z.ZodTypeAny, {
|
|
743
|
+
id: string;
|
|
744
|
+
kind: "DONE" | "UNDECIDABLE" | "SKIPPED";
|
|
745
|
+
findings: string[];
|
|
746
|
+
detail?: string | undefined;
|
|
747
|
+
}, {
|
|
748
|
+
id: string;
|
|
749
|
+
kind: "DONE" | "UNDECIDABLE" | "SKIPPED";
|
|
750
|
+
findings?: string[] | undefined;
|
|
751
|
+
detail?: string | undefined;
|
|
752
|
+
}>, "many">>;
|
|
753
|
+
}, "strip", z.ZodTypeAny, {
|
|
754
|
+
reference: string;
|
|
755
|
+
raw?: unknown;
|
|
756
|
+
hints?: Record<string, unknown> | undefined;
|
|
757
|
+
steps?: {
|
|
758
|
+
id: string;
|
|
759
|
+
kind: "DONE" | "UNDECIDABLE" | "SKIPPED";
|
|
760
|
+
findings: string[];
|
|
761
|
+
detail?: string | undefined;
|
|
762
|
+
}[] | undefined;
|
|
763
|
+
}, {
|
|
764
|
+
reference: string;
|
|
765
|
+
raw?: unknown;
|
|
766
|
+
hints?: Record<string, unknown> | undefined;
|
|
767
|
+
steps?: {
|
|
768
|
+
id: string;
|
|
769
|
+
kind: "DONE" | "UNDECIDABLE" | "SKIPPED";
|
|
770
|
+
findings?: string[] | undefined;
|
|
771
|
+
detail?: string | undefined;
|
|
772
|
+
}[] | undefined;
|
|
773
|
+
}>>;
|
|
774
|
+
}, "strip", z.ZodTypeAny, {
|
|
775
|
+
type: "informational" | "actionable" | "work";
|
|
776
|
+
version: number;
|
|
777
|
+
detectedAt: string;
|
|
778
|
+
eventKey: string;
|
|
779
|
+
suggestedPriority: "P0" | "P1" | "P2";
|
|
780
|
+
processing: "LOGGED" | "PROCESSED" | "PENDING_RETRY";
|
|
781
|
+
inboxCandidate: boolean;
|
|
782
|
+
requestId?: string | undefined;
|
|
783
|
+
relevance?: {
|
|
784
|
+
explicit: "HIGH" | "LOW";
|
|
785
|
+
actual: "HIGH" | "LOW";
|
|
786
|
+
disposition: "INBOX" | "SHADOW";
|
|
787
|
+
evidence: string[];
|
|
788
|
+
} | undefined;
|
|
789
|
+
replay?: {
|
|
790
|
+
reference: string;
|
|
791
|
+
raw?: unknown;
|
|
792
|
+
hints?: Record<string, unknown> | undefined;
|
|
793
|
+
steps?: {
|
|
794
|
+
id: string;
|
|
795
|
+
kind: "DONE" | "UNDECIDABLE" | "SKIPPED";
|
|
796
|
+
findings: string[];
|
|
797
|
+
detail?: string | undefined;
|
|
798
|
+
}[] | undefined;
|
|
799
|
+
} | undefined;
|
|
800
|
+
}, {
|
|
801
|
+
type: "informational" | "actionable" | "work";
|
|
802
|
+
version: number;
|
|
803
|
+
detectedAt: string;
|
|
804
|
+
eventKey: string;
|
|
805
|
+
suggestedPriority: "P0" | "P1" | "P2";
|
|
806
|
+
processing: "LOGGED" | "PROCESSED" | "PENDING_RETRY";
|
|
807
|
+
inboxCandidate: boolean;
|
|
808
|
+
requestId?: string | undefined;
|
|
809
|
+
relevance?: {
|
|
810
|
+
explicit: "HIGH" | "LOW";
|
|
811
|
+
actual: "HIGH" | "LOW";
|
|
812
|
+
disposition: "INBOX" | "SHADOW";
|
|
813
|
+
evidence?: string[] | undefined;
|
|
814
|
+
} | undefined;
|
|
815
|
+
replay?: {
|
|
816
|
+
reference: string;
|
|
817
|
+
raw?: unknown;
|
|
818
|
+
hints?: Record<string, unknown> | undefined;
|
|
819
|
+
steps?: {
|
|
820
|
+
id: string;
|
|
821
|
+
kind: "DONE" | "UNDECIDABLE" | "SKIPPED";
|
|
822
|
+
findings?: string[] | undefined;
|
|
823
|
+
detail?: string | undefined;
|
|
824
|
+
}[] | undefined;
|
|
825
|
+
} | undefined;
|
|
826
|
+
}>;
|
|
827
|
+
export type MonitorEvent = z.infer<typeof MonitorEvent>;
|
|
828
|
+
/**
|
|
829
|
+
* Controller single-writer 상태 문서 (OM §7.2). Monitoring 절에는 포인터만 두고
|
|
830
|
+
* 갱신자 없는 숫자·시각을 두지 않는다.
|
|
831
|
+
*/
|
|
832
|
+
export declare const ControlState: z.ZodObject<{
|
|
833
|
+
version: z.ZodNumber;
|
|
834
|
+
activeBlock: z.ZodOptional<z.ZodString>;
|
|
835
|
+
activeSessions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
836
|
+
recentHandoff: z.ZodOptional<z.ZodString>;
|
|
837
|
+
writeBoundaryOccupancy: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
838
|
+
sessionId: z.ZodString;
|
|
839
|
+
paths: z.ZodArray<z.ZodString, "many">;
|
|
840
|
+
}, "strip", z.ZodTypeAny, {
|
|
841
|
+
sessionId: string;
|
|
842
|
+
paths: string[];
|
|
843
|
+
}, {
|
|
844
|
+
sessionId: string;
|
|
845
|
+
paths: string[];
|
|
846
|
+
}>, "many">>;
|
|
847
|
+
awaitingController: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
848
|
+
controllerAttention: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
849
|
+
}, "strip", z.ZodTypeAny, {
|
|
850
|
+
version: number;
|
|
851
|
+
activeSessions: string[];
|
|
852
|
+
writeBoundaryOccupancy: {
|
|
853
|
+
sessionId: string;
|
|
854
|
+
paths: string[];
|
|
855
|
+
}[];
|
|
856
|
+
awaitingController: string[];
|
|
857
|
+
controllerAttention: string[];
|
|
858
|
+
activeBlock?: string | undefined;
|
|
859
|
+
recentHandoff?: string | undefined;
|
|
860
|
+
}, {
|
|
861
|
+
version: number;
|
|
862
|
+
activeBlock?: string | undefined;
|
|
863
|
+
activeSessions?: string[] | undefined;
|
|
864
|
+
recentHandoff?: string | undefined;
|
|
865
|
+
writeBoundaryOccupancy?: {
|
|
866
|
+
sessionId: string;
|
|
867
|
+
paths: string[];
|
|
868
|
+
}[] | undefined;
|
|
869
|
+
awaitingController?: string[] | undefined;
|
|
870
|
+
controllerAttention?: string[] | undefined;
|
|
871
|
+
}>;
|
|
872
|
+
export type ControlState = z.infer<typeof ControlState>;
|