@jcr-adk/core 2.0.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 +201 -0
- package/dist/artifact-ref.d.ts +11 -0
- package/dist/artifact-ref.d.ts.map +1 -0
- package/dist/artifact-ref.js +10 -0
- package/dist/artifact-ref.js.map +1 -0
- package/dist/config.d.ts +39 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +56 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +25 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +36 -0
- package/dist/context.js.map +1 -0
- package/dist/correlation.d.ts +22 -0
- package/dist/correlation.d.ts.map +1 -0
- package/dist/correlation.js +32 -0
- package/dist/correlation.js.map +1 -0
- package/dist/gateway/gateway.d.ts +15 -0
- package/dist/gateway/gateway.d.ts.map +1 -0
- package/dist/gateway/gateway.js +35 -0
- package/dist/gateway/gateway.js.map +1 -0
- package/dist/gateway/index.d.ts +4 -0
- package/dist/gateway/index.d.ts.map +1 -0
- package/dist/gateway/index.js +3 -0
- package/dist/gateway/index.js.map +1 -0
- package/dist/gateway/registry.d.ts +18 -0
- package/dist/gateway/registry.d.ts.map +1 -0
- package/dist/gateway/registry.js +40 -0
- package/dist/gateway/registry.js.map +1 -0
- package/dist/gateway/types.d.ts +21 -0
- package/dist/gateway/types.d.ts.map +1 -0
- package/dist/gateway/types.js +8 -0
- package/dist/gateway/types.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/paths.d.ts +36 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +94 -0
- package/dist/paths.js.map +1 -0
- package/dist/tools/registry.d.ts +36 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +57 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/types/errors.d.ts +42 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +60 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/events.d.ts +28 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/events.js +2 -0
- package/dist/types/events.js.map +1 -0
- package/package.json +29 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Typed reference to an ADK artifact — avoids raw path strings in domain code. */
|
|
2
|
+
export type ArtifactKind = "spec" | "plan" | "report" | "log" | "codemap" | "decision" | "diff";
|
|
3
|
+
export interface ArtifactRef {
|
|
4
|
+
readonly kind: ArtifactKind;
|
|
5
|
+
readonly path: string;
|
|
6
|
+
readonly sha256?: string;
|
|
7
|
+
readonly generatedBy?: string;
|
|
8
|
+
readonly createdAt: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function createArtifactRef(kind: ArtifactKind, path: string, options?: Pick<ArtifactRef, "sha256" | "generatedBy" | "createdAt">): ArtifactRef;
|
|
11
|
+
//# sourceMappingURL=artifact-ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-ref.d.ts","sourceRoot":"","sources":["../src/artifact-ref.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,MAAM,GACN,QAAQ,GACR,KAAK,GACL,SAAS,GACT,UAAU,GACV,MAAM,CAAC;AAEX,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,aAAa,GAAG,WAAW,CAAC,GAClE,WAAW,CAQb"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function createArtifactRef(kind, path, options) {
|
|
2
|
+
return {
|
|
3
|
+
kind,
|
|
4
|
+
path,
|
|
5
|
+
sha256: options?.sha256,
|
|
6
|
+
generatedBy: options?.generatedBy,
|
|
7
|
+
createdAt: options?.createdAt ?? new Date().toISOString(),
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=artifact-ref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-ref.js","sourceRoot":"","sources":["../src/artifact-ref.ts"],"names":[],"mappings":"AAkBA,MAAM,UAAU,iBAAiB,CAC/B,IAAkB,EAClB,IAAY,EACZ,OAAmE;IAEnE,OAAO;QACL,IAAI;QACJ,IAAI;QACJ,MAAM,EAAE,OAAO,EAAE,MAAM;QACvB,WAAW,EAAE,OAAO,EAAE,WAAW;QACjC,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KAC1D,CAAC;AACJ,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Supported on-disk config schema (version 1). */
|
|
2
|
+
export interface AdkConfigFileV1 {
|
|
3
|
+
readonly version: 1;
|
|
4
|
+
readonly artifactRoot?: string;
|
|
5
|
+
readonly projectId?: string;
|
|
6
|
+
}
|
|
7
|
+
export type AdkConfigFile = AdkConfigFileV1;
|
|
8
|
+
/** Supported config schema versions — unknown version is fail-closed. */
|
|
9
|
+
export declare const SUPPORTED_CONFIG_VERSIONS: readonly [1];
|
|
10
|
+
export type SupportedConfigVersion = (typeof SUPPORTED_CONFIG_VERSIONS)[number];
|
|
11
|
+
export declare const CURRENT_CONFIG_VERSION: SupportedConfigVersion;
|
|
12
|
+
export declare const DEFAULT_ARTIFACT_ROOT = ".jcr-adk";
|
|
13
|
+
/** Runtime config with resolved absolute paths. */
|
|
14
|
+
export interface AdkConfig {
|
|
15
|
+
readonly version: SupportedConfigVersion;
|
|
16
|
+
readonly workspaceRoot: string;
|
|
17
|
+
readonly artifactRoot: string;
|
|
18
|
+
readonly projectId?: string;
|
|
19
|
+
readonly adkDir: string;
|
|
20
|
+
readonly configDir: string;
|
|
21
|
+
readonly specsDir: string;
|
|
22
|
+
readonly logsDir: string;
|
|
23
|
+
readonly reportsDir: string;
|
|
24
|
+
readonly adkEventsPath: string;
|
|
25
|
+
readonly gateReportsDir: string;
|
|
26
|
+
}
|
|
27
|
+
export type AdkConfigParseResult = {
|
|
28
|
+
readonly ok: true;
|
|
29
|
+
readonly config: AdkConfigFile;
|
|
30
|
+
} | {
|
|
31
|
+
readonly ok: false;
|
|
32
|
+
readonly reason: "INVALID_SHAPE" | "UNSUPPORTED_VERSION";
|
|
33
|
+
readonly message: string;
|
|
34
|
+
};
|
|
35
|
+
/** Parse and validate config file JSON — unknown version fail-closed. */
|
|
36
|
+
export declare function parseAdkConfigFile(raw: unknown): AdkConfigParseResult;
|
|
37
|
+
/** Build default v1 config file shape. */
|
|
38
|
+
export declare function defaultAdkConfigFile(projectId?: string): AdkConfigFileV1;
|
|
39
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,MAAM,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MAAM,CAAA;CAAE,CAAC;AAM/G,yEAAyE;AACzE,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,oBAAoB,CAkDrE;AAED,0CAA0C;AAC1C,wBAAgB,oBAAoB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,eAAe,CAExE"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** Supported config schema versions — unknown version is fail-closed. */
|
|
2
|
+
export const SUPPORTED_CONFIG_VERSIONS = [1];
|
|
3
|
+
export const CURRENT_CONFIG_VERSION = 1;
|
|
4
|
+
export const DEFAULT_ARTIFACT_ROOT = ".jcr-adk";
|
|
5
|
+
function isRecord(value) {
|
|
6
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7
|
+
}
|
|
8
|
+
/** Parse and validate config file JSON — unknown version fail-closed. */
|
|
9
|
+
export function parseAdkConfigFile(raw) {
|
|
10
|
+
if (!isRecord(raw)) {
|
|
11
|
+
return { ok: false, reason: "INVALID_SHAPE", message: "config must be an object" };
|
|
12
|
+
}
|
|
13
|
+
const version = raw.version;
|
|
14
|
+
if (typeof version !== "number") {
|
|
15
|
+
return { ok: false, reason: "INVALID_SHAPE", message: "config.version must be a number" };
|
|
16
|
+
}
|
|
17
|
+
if (!SUPPORTED_CONFIG_VERSIONS.includes(version)) {
|
|
18
|
+
return {
|
|
19
|
+
ok: false,
|
|
20
|
+
reason: "UNSUPPORTED_VERSION",
|
|
21
|
+
message: `unsupported config version ${version}; supported: ${SUPPORTED_CONFIG_VERSIONS.join(", ")}`,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
if (version === 1) {
|
|
25
|
+
const artifactRoot = raw.artifactRoot === undefined
|
|
26
|
+
? undefined
|
|
27
|
+
: typeof raw.artifactRoot === "string"
|
|
28
|
+
? raw.artifactRoot
|
|
29
|
+
: null;
|
|
30
|
+
if (artifactRoot === null) {
|
|
31
|
+
return { ok: false, reason: "INVALID_SHAPE", message: "config.artifactRoot must be a string" };
|
|
32
|
+
}
|
|
33
|
+
const projectId = raw.projectId === undefined
|
|
34
|
+
? undefined
|
|
35
|
+
: typeof raw.projectId === "string"
|
|
36
|
+
? raw.projectId
|
|
37
|
+
: null;
|
|
38
|
+
if (projectId === null) {
|
|
39
|
+
return { ok: false, reason: "INVALID_SHAPE", message: "config.projectId must be a string" };
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
ok: true,
|
|
43
|
+
config: { version: 1, artifactRoot, projectId },
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
ok: false,
|
|
48
|
+
reason: "UNSUPPORTED_VERSION",
|
|
49
|
+
message: `unsupported config version ${version}`,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** Build default v1 config file shape. */
|
|
53
|
+
export function defaultAdkConfigFile(projectId) {
|
|
54
|
+
return { version: 1, artifactRoot: DEFAULT_ARTIFACT_ROOT, projectId };
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AASA,yEAAyE;AACzE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,CAAU,CAAC;AAEtD,MAAM,CAAC,MAAM,sBAAsB,GAA2B,CAAC,CAAC;AAEhE,MAAM,CAAC,MAAM,qBAAqB,GAAG,UAAU,CAAC;AAqBhD,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC7C,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACnB,OAAO,EAAE,EAAE,EAAE,KAAK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,EAAE,mCAAmC,EAAE,CAAC;QAC9F,CAAC;QAED,OAAO;YACL,EAAE,EAAE,IAAI;YACR,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE;SAChD,CAAC;IACJ,CAAC;IAED,OAAO;QACL,EAAE,EAAE,KAAK;QACT,MAAM,EAAE,qBAAqB;QAC7B,OAAO,EAAE,8BAA8B,OAAO,EAAE;KACjD,CAAC;AACJ,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,oBAAoB,CAAC,SAAkB;IACrD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,qBAAqB,EAAE,SAAS,EAAE,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AdkConfig, AdkConfigFile } from "./config.js";
|
|
2
|
+
import type { CorrelationIds } from "./correlation.js";
|
|
3
|
+
/** Runtime execution context shared across packages. */
|
|
4
|
+
export interface AdkContext {
|
|
5
|
+
readonly workspaceRoot: string;
|
|
6
|
+
readonly specId?: string;
|
|
7
|
+
readonly runId?: string;
|
|
8
|
+
readonly requestId: string;
|
|
9
|
+
readonly config: AdkConfig;
|
|
10
|
+
readonly correlation: CorrelationIds;
|
|
11
|
+
}
|
|
12
|
+
export interface CreateAdkContextInput {
|
|
13
|
+
readonly workspaceRoot: string;
|
|
14
|
+
readonly config: AdkConfig;
|
|
15
|
+
readonly correlation: CorrelationIds;
|
|
16
|
+
}
|
|
17
|
+
/** Assemble runtime context from resolved config and correlation IDs. */
|
|
18
|
+
export declare function createAdkContext(input: CreateAdkContextInput): AdkContext;
|
|
19
|
+
/**
|
|
20
|
+
* Merge on-disk config file with workspace paths.
|
|
21
|
+
* Delegates to resolveAdkPaths so OS-aware path.join and workspace-boundary
|
|
22
|
+
* logic is applied consistently (Fix 1: path logic unification).
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveAdkConfig(workspaceRoot: string, file?: AdkConfigFile): AdkConfig;
|
|
25
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,wDAAwD;AACxD,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC;CACtC;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC;CACtC;AAED,yEAAyE;AACzE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,UAAU,CASzE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,aAAa,EAAE,MAAM,EACrB,IAAI,GAAE,aAAmE,GACxE,SAAS,CAgBX"}
|
package/dist/context.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DEFAULT_ARTIFACT_ROOT } from "./config.js";
|
|
2
|
+
import { resolveAdkPaths } from "./paths.js";
|
|
3
|
+
/** Assemble runtime context from resolved config and correlation IDs. */
|
|
4
|
+
export function createAdkContext(input) {
|
|
5
|
+
return {
|
|
6
|
+
workspaceRoot: input.workspaceRoot,
|
|
7
|
+
specId: input.correlation.specId,
|
|
8
|
+
runId: input.correlation.runId,
|
|
9
|
+
requestId: input.correlation.requestId,
|
|
10
|
+
config: input.config,
|
|
11
|
+
correlation: input.correlation,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Merge on-disk config file with workspace paths.
|
|
16
|
+
* Delegates to resolveAdkPaths so OS-aware path.join and workspace-boundary
|
|
17
|
+
* logic is applied consistently (Fix 1: path logic unification).
|
|
18
|
+
*/
|
|
19
|
+
export function resolveAdkConfig(workspaceRoot, file = { version: 1, artifactRoot: DEFAULT_ARTIFACT_ROOT }) {
|
|
20
|
+
const artifactRoot = file.artifactRoot ?? DEFAULT_ARTIFACT_ROOT;
|
|
21
|
+
const paths = resolveAdkPaths(workspaceRoot, artifactRoot);
|
|
22
|
+
return {
|
|
23
|
+
version: file.version,
|
|
24
|
+
workspaceRoot,
|
|
25
|
+
artifactRoot,
|
|
26
|
+
projectId: file.projectId,
|
|
27
|
+
adkDir: paths.adkDir,
|
|
28
|
+
configDir: paths.configDir,
|
|
29
|
+
specsDir: paths.specsDir,
|
|
30
|
+
logsDir: paths.logsDir,
|
|
31
|
+
reportsDir: paths.reportsDir,
|
|
32
|
+
adkEventsPath: paths.adkEventsPath,
|
|
33
|
+
gateReportsDir: paths.gateReportsDir,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAkB7C,yEAAyE;AACzE,MAAM,UAAU,gBAAgB,CAAC,KAA4B;IAC3D,OAAO;QACL,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,MAAM;QAChC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,KAAK;QAC9B,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,SAAS;QACtC,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,WAAW,EAAE,KAAK,CAAC,WAAW;KAC/B,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAC9B,aAAqB,EACrB,OAAsB,EAAE,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,qBAAqB,EAAE;IAEzE,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,qBAAqB,CAAC;IAChE,MAAM,KAAK,GAAG,eAAe,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;IAC3D,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,aAAa;QACb,YAAY;QACZ,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,cAAc,EAAE,KAAK,CAAC,cAAc;KACrC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Correlation identifiers — F-01 compatible specId / runId / requestId. */
|
|
2
|
+
export interface CorrelationIds {
|
|
3
|
+
readonly specId: string;
|
|
4
|
+
readonly runId: string;
|
|
5
|
+
readonly requestId: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CreateCorrelationInput {
|
|
8
|
+
readonly specId: string;
|
|
9
|
+
readonly runId?: string;
|
|
10
|
+
readonly requestId?: string;
|
|
11
|
+
}
|
|
12
|
+
/** Create correlation triple, generating missing IDs when omitted. */
|
|
13
|
+
export declare function createCorrelationIds(input: CreateCorrelationInput): CorrelationIds;
|
|
14
|
+
/** Propagate correlation into a child scope (e.g. nested tool call). */
|
|
15
|
+
export declare function propagateCorrelationIds(parent: CorrelationIds, overrides?: Partial<Pick<CorrelationIds, "runId" | "requestId">>): CorrelationIds;
|
|
16
|
+
/** RUN-{epochMs} — matches F-01 spike convention. */
|
|
17
|
+
export declare function generateRunId(prefix?: string): string;
|
|
18
|
+
/** REQ-{uuid} — matches F-01 spike convention. */
|
|
19
|
+
export declare function generateRequestId(): string;
|
|
20
|
+
/** SPEC-{date}-{seq} helper for new specs. */
|
|
21
|
+
export declare function generateSpecId(date?: Date, seq?: number): string;
|
|
22
|
+
//# sourceMappingURL=correlation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"correlation.d.ts","sourceRoot":"","sources":["../src/correlation.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,sEAAsE;AACtE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,sBAAsB,GAAG,cAAc,CAMlF;AAED,wEAAwE;AACxE,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,cAAc,EACtB,SAAS,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,WAAW,CAAC,CAAC,GAC/D,cAAc,CAMhB;AAED,qDAAqD;AACrD,wBAAgB,aAAa,CAAC,MAAM,SAAQ,GAAG,MAAM,CAEpD;AAED,kDAAkD;AAClD,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,8CAA8C;AAC9C,wBAAgB,cAAc,CAAC,IAAI,OAAa,EAAE,GAAG,SAAI,GAAG,MAAM,CAKjE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** Create correlation triple, generating missing IDs when omitted. */
|
|
2
|
+
export function createCorrelationIds(input) {
|
|
3
|
+
return {
|
|
4
|
+
specId: input.specId,
|
|
5
|
+
runId: input.runId ?? generateRunId(),
|
|
6
|
+
requestId: input.requestId ?? generateRequestId(),
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
/** Propagate correlation into a child scope (e.g. nested tool call). */
|
|
10
|
+
export function propagateCorrelationIds(parent, overrides) {
|
|
11
|
+
return {
|
|
12
|
+
specId: parent.specId,
|
|
13
|
+
runId: overrides?.runId ?? parent.runId,
|
|
14
|
+
requestId: overrides?.requestId ?? generateRequestId(),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/** RUN-{epochMs} — matches F-01 spike convention. */
|
|
18
|
+
export function generateRunId(prefix = "RUN") {
|
|
19
|
+
return `${prefix}-${Date.now()}`;
|
|
20
|
+
}
|
|
21
|
+
/** REQ-{uuid} — matches F-01 spike convention. */
|
|
22
|
+
export function generateRequestId() {
|
|
23
|
+
return `REQ-${crypto.randomUUID()}`;
|
|
24
|
+
}
|
|
25
|
+
/** SPEC-{date}-{seq} helper for new specs. */
|
|
26
|
+
export function generateSpecId(date = new Date(), seq = 1) {
|
|
27
|
+
const y = date.getUTCFullYear();
|
|
28
|
+
const m = String(date.getUTCMonth() + 1).padStart(2, "0");
|
|
29
|
+
const d = String(date.getUTCDate()).padStart(2, "0");
|
|
30
|
+
return `SPEC-${y}${m}${d}-${String(seq).padStart(3, "0")}`;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=correlation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"correlation.js","sourceRoot":"","sources":["../src/correlation.ts"],"names":[],"mappings":"AAaA,sEAAsE;AACtE,MAAM,UAAU,oBAAoB,CAAC,KAA6B;IACh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
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { GatewayDecision, MutationRequest } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Gateway entry point: evaluate whether a mutation is allowed.
|
|
4
|
+
*
|
|
5
|
+
* Rules (SEC-12R / DAC-N02):
|
|
6
|
+
* 1. Non-protected path → allow.
|
|
7
|
+
* 2. direct_write to protected path → deny DAC-003-DIRECT-LIFECYCLE-WRITE.
|
|
8
|
+
* 3. tool mode + approved tool → allow.
|
|
9
|
+
* 4. tool mode + unapproved tool → deny DAC-003-UNAPPROVED-TOOL.
|
|
10
|
+
*
|
|
11
|
+
* Callers MUST emit a policy.denied event before returning the deny
|
|
12
|
+
* result to the caller (EVENT_FIRST_WRITE_ORDERING).
|
|
13
|
+
*/
|
|
14
|
+
export declare function gatewayCheck(request: MutationRequest): GatewayDecision;
|
|
15
|
+
//# sourceMappingURL=gateway.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../../src/gateway/gateway.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEnE;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,eAAe,CAuBtE"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { isApprovedMutatingTool, isProtectedPath } from "./registry.js";
|
|
2
|
+
/**
|
|
3
|
+
* Gateway entry point: evaluate whether a mutation is allowed.
|
|
4
|
+
*
|
|
5
|
+
* Rules (SEC-12R / DAC-N02):
|
|
6
|
+
* 1. Non-protected path → allow.
|
|
7
|
+
* 2. direct_write to protected path → deny DAC-003-DIRECT-LIFECYCLE-WRITE.
|
|
8
|
+
* 3. tool mode + approved tool → allow.
|
|
9
|
+
* 4. tool mode + unapproved tool → deny DAC-003-UNAPPROVED-TOOL.
|
|
10
|
+
*
|
|
11
|
+
* Callers MUST emit a policy.denied event before returning the deny
|
|
12
|
+
* result to the caller (EVENT_FIRST_WRITE_ORDERING).
|
|
13
|
+
*/
|
|
14
|
+
export function gatewayCheck(request) {
|
|
15
|
+
if (!isProtectedPath(request.targetPath)) {
|
|
16
|
+
return { allowed: true };
|
|
17
|
+
}
|
|
18
|
+
if (request.mode === "direct_write") {
|
|
19
|
+
return {
|
|
20
|
+
allowed: false,
|
|
21
|
+
ruleId: "DAC-003-DIRECT-LIFECYCLE-WRITE",
|
|
22
|
+
reason: "Direct lifecycle artifact mutation is forbidden; use approved ADK command or custom tool.",
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const toolName = request.toolName ?? "";
|
|
26
|
+
if (isApprovedMutatingTool(toolName)) {
|
|
27
|
+
return { allowed: true };
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
allowed: false,
|
|
31
|
+
ruleId: "DAC-003-UNAPPROVED-TOOL",
|
|
32
|
+
reason: `Tool '${toolName}' is not an approved mutating tool for protected path.`,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=gateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../src/gateway/gateway.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGxE;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAAC,OAAwB;IACnD,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;QACpC,OAAO;YACL,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,gCAAgC;YACxC,MAAM,EAAE,2FAA2F;SACpG,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC;IACxC,IAAI,sBAAsB,CAAC,QAAQ,CAAC,EAAE,CAAC;QACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,OAAO;QACL,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,yBAAyB;QACjC,MAAM,EAAE,SAAS,QAAQ,wDAAwD;KAClF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { MutationMode, MutationRequest, GatewayRuleId, GatewayDecision } from "./types.js";
|
|
2
|
+
export { PROTECTED_PATH_PREFIXES, PROTECTED_METADATA_SUFFIX, APPROVED_MUTATING_TOOLS, isProtectedPath, isApprovedMutatingTool, } from "./registry.js";
|
|
3
|
+
export { gatewayCheck } from "./gateway.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gateway/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAChG,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,eAAe,EACf,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/gateway/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,eAAe,EACf,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Protected lifecycle artifact path prefixes. */
|
|
2
|
+
export declare const PROTECTED_PATH_PREFIXES: readonly string[];
|
|
3
|
+
/** Protected file suffix — always requires an approved tool. */
|
|
4
|
+
export declare const PROTECTED_METADATA_SUFFIX = "metadata.yaml";
|
|
5
|
+
/**
|
|
6
|
+
* Approved mutating tools — derived from the canonical registry's mutating flag.
|
|
7
|
+
* Only tools in this set may write to PROTECTED_PATH_PREFIXES.
|
|
8
|
+
*/
|
|
9
|
+
export declare const APPROVED_MUTATING_TOOLS: ReadonlySet<string>;
|
|
10
|
+
/** Return true when `targetPath` is a protected lifecycle artifact. */
|
|
11
|
+
export declare function isProtectedPath(targetPath: string): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Return true when `toolName` (canonical OR deprecated alias) is an approved mutating tool.
|
|
14
|
+
* Alias resolution happens here at the gateway boundary, matching OI-005 policy:
|
|
15
|
+
* "deprecated aliases resolve at gateway boundary only".
|
|
16
|
+
*/
|
|
17
|
+
export declare function isApprovedMutatingTool(toolName: string): boolean;
|
|
18
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/gateway/registry.ts"],"names":[],"mappings":"AASA,kDAAkD;AAClD,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAKpD,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,yBAAyB,kBAAkB,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,MAAM,CAAuB,CAAC;AAEhF,uEAAuE;AACvE,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAM3D;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGhE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mutation boundary registry — SEC-12D / OI-009 / DAC-N02.
|
|
3
|
+
*
|
|
4
|
+
* The approved-mutating-tool set is DERIVED from the canonical tool registry
|
|
5
|
+
* (tools/registry.ts) so there is a single source of truth. Do not hardcode a
|
|
6
|
+
* second list here.
|
|
7
|
+
*/
|
|
8
|
+
import { MUTATING_TOOL_NAMES, resolveToolName } from "../tools/registry.js";
|
|
9
|
+
/** Protected lifecycle artifact path prefixes. */
|
|
10
|
+
export const PROTECTED_PATH_PREFIXES = [
|
|
11
|
+
".jcr-adk/state",
|
|
12
|
+
".jcr-adk/reports",
|
|
13
|
+
".jcr-adk/logs",
|
|
14
|
+
".jcr-adk/specs",
|
|
15
|
+
];
|
|
16
|
+
/** Protected file suffix — always requires an approved tool. */
|
|
17
|
+
export const PROTECTED_METADATA_SUFFIX = "metadata.yaml";
|
|
18
|
+
/**
|
|
19
|
+
* Approved mutating tools — derived from the canonical registry's mutating flag.
|
|
20
|
+
* Only tools in this set may write to PROTECTED_PATH_PREFIXES.
|
|
21
|
+
*/
|
|
22
|
+
export const APPROVED_MUTATING_TOOLS = MUTATING_TOOL_NAMES;
|
|
23
|
+
/** Return true when `targetPath` is a protected lifecycle artifact. */
|
|
24
|
+
export function isProtectedPath(targetPath) {
|
|
25
|
+
const normalized = targetPath.replace(/\\/g, "/");
|
|
26
|
+
if (PROTECTED_PATH_PREFIXES.some((prefix) => normalized === prefix || normalized.startsWith(`${prefix}/`))) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return normalized.endsWith(PROTECTED_METADATA_SUFFIX);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Return true when `toolName` (canonical OR deprecated alias) is an approved mutating tool.
|
|
33
|
+
* Alias resolution happens here at the gateway boundary, matching OI-005 policy:
|
|
34
|
+
* "deprecated aliases resolve at gateway boundary only".
|
|
35
|
+
*/
|
|
36
|
+
export function isApprovedMutatingTool(toolName) {
|
|
37
|
+
const resolved = resolveToolName(toolName);
|
|
38
|
+
return resolved.ok && APPROVED_MUTATING_TOOLS.has(resolved.canonical);
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/gateway/registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5E,kDAAkD;AAClD,MAAM,CAAC,MAAM,uBAAuB,GAAsB;IACxD,gBAAgB;IAChB,kBAAkB;IAClB,eAAe;IACf,gBAAgB;CACjB,CAAC;AAEF,gEAAgE;AAChE,MAAM,CAAC,MAAM,yBAAyB,GAAG,eAAe,CAAC;AAEzD;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAwB,mBAAmB,CAAC;AAEhF,uEAAuE;AACvE,MAAM,UAAU,eAAe,CAAC,UAAkB;IAChD,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAClD,IAAI,uBAAuB,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,KAAK,MAAM,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC;QAC3G,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,UAAU,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC;AACxD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB;IACrD,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC3C,OAAO,QAAQ,CAAC,EAAE,IAAI,uBAAuB,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MutationGateway contract types.
|
|
3
|
+
*
|
|
4
|
+
* SEC-12R / DAC-N02: All writes to protected lifecycle artifacts must pass
|
|
5
|
+
* through this gateway. Direct writes are always denied.
|
|
6
|
+
*/
|
|
7
|
+
export type MutationMode = "direct_write" | "tool";
|
|
8
|
+
export interface MutationRequest {
|
|
9
|
+
readonly mode: MutationMode;
|
|
10
|
+
readonly toolName?: string;
|
|
11
|
+
readonly targetPath: string;
|
|
12
|
+
}
|
|
13
|
+
export type GatewayRuleId = "DAC-003-DIRECT-LIFECYCLE-WRITE" | "DAC-003-UNAPPROVED-TOOL";
|
|
14
|
+
export type GatewayDecision = {
|
|
15
|
+
readonly allowed: true;
|
|
16
|
+
} | {
|
|
17
|
+
readonly allowed: false;
|
|
18
|
+
readonly ruleId: GatewayRuleId;
|
|
19
|
+
readonly reason: string;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/gateway/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,YAAY,GAAG,cAAc,GAAG,MAAM,CAAC;AAEnD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,MAAM,aAAa,GACrB,gCAAgC,GAChC,yBAAyB,CAAC;AAE9B,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAA;CAAE,GAC1B;IAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/gateway/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type { AdkConfig, AdkConfigFile, AdkConfigFileV1, AdkConfigParseResult, SupportedConfigVersion, } from "./config.js";
|
|
2
|
+
export { CURRENT_CONFIG_VERSION, DEFAULT_ARTIFACT_ROOT, SUPPORTED_CONFIG_VERSIONS, defaultAdkConfigFile, parseAdkConfigFile, } from "./config.js";
|
|
3
|
+
export type { AdkContext, CreateAdkContextInput } from "./context.js";
|
|
4
|
+
export { createAdkContext, resolveAdkConfig } from "./context.js";
|
|
5
|
+
export type { CorrelationIds, CreateCorrelationInput } from "./correlation.js";
|
|
6
|
+
export { createCorrelationIds, generateRequestId, generateRunId, generateSpecId, propagateCorrelationIds, } from "./correlation.js";
|
|
7
|
+
export type { ArtifactKind, ArtifactRef } from "./artifact-ref.js";
|
|
8
|
+
export { createArtifactRef } from "./artifact-ref.js";
|
|
9
|
+
export type { EventKind, AdkEventBase, ToolInvocation, ToolInvocationResult, } from "./types/events.js";
|
|
10
|
+
export type { AdkErrorCode, AdkError, AdkErrorSeverity } from "./types/errors.js";
|
|
11
|
+
export { adkError, isAdkError, isFatal, FAIL_CLOSED_CODES } from "./types/errors.js";
|
|
12
|
+
export type { AdkPaths, PathResolveResult } from "./paths.js";
|
|
13
|
+
export { joinWithinRoot, resolveAdkPaths, resolveArtifactPath, resolveArtifactRef, resolveGateReportPath, resolveSpecDir, } from "./paths.js";
|
|
14
|
+
export type { MutationMode, MutationRequest, GatewayRuleId, GatewayDecision, } from "./gateway/index.js";
|
|
15
|
+
export { PROTECTED_PATH_PREFIXES, PROTECTED_METADATA_SUFFIX, APPROVED_MUTATING_TOOLS, isProtectedPath, isApprovedMutatingTool, gatewayCheck, } from "./gateway/index.js";
|
|
16
|
+
export type { ToolRegistryEntry, ResolveToolResult } from "./tools/registry.js";
|
|
17
|
+
export { TOOL_REGISTRY, TOOL_ALIASES, MUTATING_TOOL_NAMES, resolveToolName, getToolEntry, isMutatingTool, } from "./tools/registry.js";
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,SAAS,EACT,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAElE,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,YAAY,EACV,SAAS,EACT,YAAY,EACZ,cAAc,EACd,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAErF,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EACL,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,YAAY,EACZ,eAAe,EACf,aAAa,EACb,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,eAAe,EACf,sBAAsB,EACtB,YAAY,GACb,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EACL,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,cAAc,GACf,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { CURRENT_CONFIG_VERSION, DEFAULT_ARTIFACT_ROOT, SUPPORTED_CONFIG_VERSIONS, defaultAdkConfigFile, parseAdkConfigFile, } from "./config.js";
|
|
2
|
+
export { createAdkContext, resolveAdkConfig } from "./context.js";
|
|
3
|
+
export { createCorrelationIds, generateRequestId, generateRunId, generateSpecId, propagateCorrelationIds, } from "./correlation.js";
|
|
4
|
+
export { createArtifactRef } from "./artifact-ref.js";
|
|
5
|
+
export { adkError, isAdkError, isFatal, FAIL_CLOSED_CODES } from "./types/errors.js";
|
|
6
|
+
export { joinWithinRoot, resolveAdkPaths, resolveArtifactPath, resolveArtifactRef, resolveGateReportPath, resolveSpecDir, } from "./paths.js";
|
|
7
|
+
export { PROTECTED_PATH_PREFIXES, PROTECTED_METADATA_SUFFIX, APPROVED_MUTATING_TOOLS, isProtectedPath, isApprovedMutatingTool, gatewayCheck, } from "./gateway/index.js";
|
|
8
|
+
export { TOOL_REGISTRY, TOOL_ALIASES, MUTATING_TOOL_NAMES, resolveToolName, getToolEntry, isMutatingTool, } from "./tools/registry.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGlE,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAUtD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGrF,OAAO,EACL,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,cAAc,GACf,MAAM,YAAY,CAAC;AAQpB,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,eAAe,EACf,sBAAsB,EACtB,YAAY,GACb,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,cAAc,GACf,MAAM,qBAAqB,CAAC"}
|
package/dist/paths.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { AdkConfig } from "./config.js";
|
|
2
|
+
import type { ArtifactRef } from "./artifact-ref.js";
|
|
3
|
+
export interface AdkPaths {
|
|
4
|
+
readonly adkDir: string;
|
|
5
|
+
readonly configDir: string;
|
|
6
|
+
readonly configFilePath: string;
|
|
7
|
+
readonly specsDir: string;
|
|
8
|
+
readonly logsDir: string;
|
|
9
|
+
readonly adkEventsPath: string;
|
|
10
|
+
readonly reportsDir: string;
|
|
11
|
+
readonly gateReportsDir: string;
|
|
12
|
+
}
|
|
13
|
+
export type PathResolveResult = {
|
|
14
|
+
readonly ok: true;
|
|
15
|
+
readonly absolutePath: string;
|
|
16
|
+
readonly relativePath: string;
|
|
17
|
+
} | {
|
|
18
|
+
readonly ok: false;
|
|
19
|
+
readonly reason: "PATH_ESCAPE" | "INVALID_SEGMENT";
|
|
20
|
+
readonly message: string;
|
|
21
|
+
};
|
|
22
|
+
/** Resolve standard `.jcr-adk` layout from workspace root. */
|
|
23
|
+
export declare function resolveAdkPaths(workspaceRoot: string, artifactRoot?: string): AdkPaths;
|
|
24
|
+
/** Resolve a path segment chain without escaping workspace root. */
|
|
25
|
+
export declare function joinWithinRoot(workspaceRoot: string, ...segments: string[]): PathResolveResult;
|
|
26
|
+
/** Resolve spec directory: `.jcr-adk/specs/{specId}`. */
|
|
27
|
+
export declare function resolveSpecDir(config: AdkConfig, specId: string): PathResolveResult;
|
|
28
|
+
/** Resolve gate report path under reports/gate. */
|
|
29
|
+
export declare function resolveGateReportPath(config: AdkConfig, reportName: string): PathResolveResult;
|
|
30
|
+
/** Resolve relative artifact path to absolute, enforcing workspace boundary. */
|
|
31
|
+
export declare function resolveArtifactPath(workspaceRoot: string, artifactPath: string): PathResolveResult;
|
|
32
|
+
/** Build ArtifactRef with workspace-safe absolute path. */
|
|
33
|
+
export declare function resolveArtifactRef(workspaceRoot: string, ref: Pick<ArtifactRef, "kind" | "path"> & Partial<ArtifactRef>): PathResolveResult & {
|
|
34
|
+
readonly ref?: ArtifactRef;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;I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QAAQ,CAAC,GAAG,CAAC,EAAE,WAAW,CAAA;CAAE,CAWpD"}
|
package/dist/paths.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { createArtifactRef } from "./artifact-ref.js";
|
|
3
|
+
/** Resolve standard `.jcr-adk` layout from workspace root. */
|
|
4
|
+
export function resolveAdkPaths(workspaceRoot, artifactRoot = ".jcr-adk") {
|
|
5
|
+
const joined = joinWithinRoot(workspaceRoot, artifactRoot);
|
|
6
|
+
if (!joined.ok) {
|
|
7
|
+
throw new Error(`failed to resolve adk paths: ${joined.message}`);
|
|
8
|
+
}
|
|
9
|
+
const adkDir = joined.absolutePath;
|
|
10
|
+
return {
|
|
11
|
+
adkDir,
|
|
12
|
+
configDir: path.join(adkDir, "config"),
|
|
13
|
+
configFilePath: path.join(adkDir, "config", "adk.json"),
|
|
14
|
+
specsDir: path.join(adkDir, "specs"),
|
|
15
|
+
logsDir: path.join(adkDir, "logs"),
|
|
16
|
+
adkEventsPath: path.join(adkDir, "logs", "adk-events.jsonl"),
|
|
17
|
+
reportsDir: path.join(adkDir, "reports"),
|
|
18
|
+
gateReportsDir: path.join(adkDir, "reports", "gate"),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** Resolve a path segment chain without escaping workspace root. */
|
|
22
|
+
export function joinWithinRoot(workspaceRoot, ...segments) {
|
|
23
|
+
const root = path.resolve(workspaceRoot);
|
|
24
|
+
for (const segment of segments) {
|
|
25
|
+
if (segment.includes("\0") ||
|
|
26
|
+
path.isAbsolute(segment) ||
|
|
27
|
+
segment.split(/[/\\]/).some((part) => part === "..")) {
|
|
28
|
+
return {
|
|
29
|
+
ok: false,
|
|
30
|
+
reason: "INVALID_SEGMENT",
|
|
31
|
+
message: `invalid path segment: ${segment}`,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const absolutePath = path.resolve(root, ...segments);
|
|
36
|
+
if (!isPathWithinRoot(root, absolutePath)) {
|
|
37
|
+
return {
|
|
38
|
+
ok: false,
|
|
39
|
+
reason: "PATH_ESCAPE",
|
|
40
|
+
message: `path escapes workspace root: ${absolutePath}`,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
ok: true,
|
|
45
|
+
absolutePath,
|
|
46
|
+
relativePath: path.relative(root, absolutePath),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** Resolve spec directory: `.jcr-adk/specs/{specId}`. */
|
|
50
|
+
export function resolveSpecDir(config, specId) {
|
|
51
|
+
return joinWithinRoot(config.workspaceRoot, config.artifactRoot, "specs", specId);
|
|
52
|
+
}
|
|
53
|
+
/** Resolve gate report path under reports/gate. */
|
|
54
|
+
export function resolveGateReportPath(config, reportName) {
|
|
55
|
+
return joinWithinRoot(config.workspaceRoot, config.artifactRoot, "reports", "gate", reportName);
|
|
56
|
+
}
|
|
57
|
+
/** Resolve relative artifact path to absolute, enforcing workspace boundary. */
|
|
58
|
+
export function resolveArtifactPath(workspaceRoot, artifactPath) {
|
|
59
|
+
if (path.isAbsolute(artifactPath)) {
|
|
60
|
+
const root = path.resolve(workspaceRoot);
|
|
61
|
+
if (!isPathWithinRoot(root, artifactPath)) {
|
|
62
|
+
return {
|
|
63
|
+
ok: false,
|
|
64
|
+
reason: "PATH_ESCAPE",
|
|
65
|
+
message: `absolute path escapes workspace root: ${artifactPath}`,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
ok: true,
|
|
70
|
+
absolutePath: artifactPath,
|
|
71
|
+
relativePath: path.relative(root, artifactPath),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return joinWithinRoot(workspaceRoot, artifactPath);
|
|
75
|
+
}
|
|
76
|
+
/** Build ArtifactRef with workspace-safe absolute path. */
|
|
77
|
+
export function resolveArtifactRef(workspaceRoot, ref) {
|
|
78
|
+
const resolved = resolveArtifactPath(workspaceRoot, ref.path);
|
|
79
|
+
if (!resolved.ok)
|
|
80
|
+
return resolved;
|
|
81
|
+
return {
|
|
82
|
+
...resolved,
|
|
83
|
+
ref: createArtifactRef(ref.kind, resolved.absolutePath, {
|
|
84
|
+
sha256: ref.sha256,
|
|
85
|
+
generatedBy: ref.generatedBy,
|
|
86
|
+
createdAt: ref.createdAt ?? new Date().toISOString(),
|
|
87
|
+
}),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function isPathWithinRoot(root, target) {
|
|
91
|
+
const normalizedRoot = root.endsWith(path.sep) ? root : `${root}${path.sep}`;
|
|
92
|
+
return target === root || target.startsWith(normalizedRoot);
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAiBtD,8DAA8D;AAC9D,MAAM,UAAU,eAAe,CAAC,aAAqB,EAAE,YAAY,GAAG,UAAU;IAC9E,MAAM,MAAM,GAAG,cAAc,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;IAC3D,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,gCAAgC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC;IACnC,OAAO;QACL,MAAM;QACN,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC;QACtC,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,CAAC;QACvD,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC;QACpC,OAAO,EAAE,IAAI,CAAC,IAAI,CAA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B,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,YAAY,EAAE;YACtD,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,SAAS,EAAE,GAAG,CAAC,SAAS,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACrD,CAAC;KACH,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAY,EAAE,MAAc;IACpD,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC7E,OAAO,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical Tool Registry — OI-005 / 10-tool §Tool Registry Naming SSOT.
|
|
3
|
+
*
|
|
4
|
+
* This is the single source of truth for tool names and their mutating flag.
|
|
5
|
+
* The mutation gateway derives APPROVED_MUTATING_TOOLS from this registry so
|
|
6
|
+
* the two can never diverge (review lesson from PR-008).
|
|
7
|
+
*
|
|
8
|
+
* Ported 1:1 from spikes/core-p0-verify/src/lib/tool-registry.ts.
|
|
9
|
+
*/
|
|
10
|
+
export interface ToolRegistryEntry {
|
|
11
|
+
readonly canonical: string;
|
|
12
|
+
readonly role: string;
|
|
13
|
+
readonly mutating: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** 13 canonical tools. */
|
|
16
|
+
export declare const TOOL_REGISTRY: readonly ToolRegistryEntry[];
|
|
17
|
+
/** Deprecated aliases → canonical (OI-005 정리). Resolved at gateway boundary only. */
|
|
18
|
+
export declare const TOOL_ALIASES: Readonly<Record<string, string>>;
|
|
19
|
+
export type ResolveToolResult = {
|
|
20
|
+
readonly ok: true;
|
|
21
|
+
readonly canonical: string;
|
|
22
|
+
readonly resolvedFromAlias: boolean;
|
|
23
|
+
} | {
|
|
24
|
+
readonly ok: false;
|
|
25
|
+
readonly reason: "UNKNOWN_TOOL";
|
|
26
|
+
readonly message: string;
|
|
27
|
+
};
|
|
28
|
+
/** Resolve a (possibly aliased) tool name to its canonical form. Fail-closed on unknown. */
|
|
29
|
+
export declare function resolveToolName(name: string): ResolveToolResult;
|
|
30
|
+
/** Look up the registry entry for a name (after alias resolution). */
|
|
31
|
+
export declare function getToolEntry(name: string): ToolRegistryEntry | undefined;
|
|
32
|
+
/** True when the tool exists and is flagged mutating in the registry. */
|
|
33
|
+
export declare function isMutatingTool(name: string): boolean;
|
|
34
|
+
/** Set of canonical names flagged mutating — derived SSOT for the gateway. */
|
|
35
|
+
export declare const MUTATING_TOOL_NAMES: ReadonlySet<string>;
|
|
36
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED,0BAA0B;AAC1B,eAAO,MAAM,aAAa,EAAE,SAAS,iBAAiB,EAcrD,CAAC;AAEF,qFAAqF;AACrF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAKzD,CAAC;AAKF,MAAM,MAAM,iBAAiB,GACzB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAA;CAAE,GACtF;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtF,4FAA4F;AAC5F,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAS/D;AAED,sEAAsE;AACtE,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAGxE;AAED,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,8EAA8E;AAC9E,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,MAAM,CAEnD,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical Tool Registry — OI-005 / 10-tool §Tool Registry Naming SSOT.
|
|
3
|
+
*
|
|
4
|
+
* This is the single source of truth for tool names and their mutating flag.
|
|
5
|
+
* The mutation gateway derives APPROVED_MUTATING_TOOLS from this registry so
|
|
6
|
+
* the two can never diverge (review lesson from PR-008).
|
|
7
|
+
*
|
|
8
|
+
* Ported 1:1 from spikes/core-p0-verify/src/lib/tool-registry.ts.
|
|
9
|
+
*/
|
|
10
|
+
/** 13 canonical tools. */
|
|
11
|
+
export const TOOL_REGISTRY = [
|
|
12
|
+
{ canonical: "adk_spec_read", role: "SPEC 조회", mutating: false },
|
|
13
|
+
{ canonical: "adk_spec_list", role: "SPEC 목록", mutating: false },
|
|
14
|
+
{ canonical: "adk_progress_append", role: "progress append", mutating: true },
|
|
15
|
+
{ canonical: "adk_acceptance_update", role: "acceptance trace update", mutating: true },
|
|
16
|
+
{ canonical: "adk_gate_run", role: "gate 실행 요청", mutating: true },
|
|
17
|
+
{ canonical: "adk_policy_check", role: "policy check", mutating: false },
|
|
18
|
+
{ canonical: "adk_diagnostics_collect", role: "diagnostics 수집", mutating: true },
|
|
19
|
+
{ canonical: "adk_decision_record", role: "decision 기록", mutating: true },
|
|
20
|
+
{ canonical: "adk_codemap_query", role: "codemap 조회", mutating: false },
|
|
21
|
+
{ canonical: "adk_codemap_update", role: "codemap 갱신", mutating: true },
|
|
22
|
+
{ canonical: "adk_diff_summary", role: "diff 요약", mutating: false },
|
|
23
|
+
{ canonical: "adk_doctor_run", role: "doctor 실행", mutating: true },
|
|
24
|
+
{ canonical: "adk_sync_prepare", role: "sync 준비", mutating: true },
|
|
25
|
+
];
|
|
26
|
+
/** Deprecated aliases → canonical (OI-005 정리). Resolved at gateway boundary only. */
|
|
27
|
+
export const TOOL_ALIASES = {
|
|
28
|
+
adk_read_spec: "adk_spec_read",
|
|
29
|
+
adk_append_progress: "adk_progress_append",
|
|
30
|
+
adk_run_gate: "adk_gate_run",
|
|
31
|
+
adk_check_policy: "adk_policy_check",
|
|
32
|
+
};
|
|
33
|
+
const _canonicalSet = new Set(TOOL_REGISTRY.map((t) => t.canonical));
|
|
34
|
+
const _entryByName = new Map(TOOL_REGISTRY.map((t) => [t.canonical, t]));
|
|
35
|
+
/** Resolve a (possibly aliased) tool name to its canonical form. Fail-closed on unknown. */
|
|
36
|
+
export function resolveToolName(name) {
|
|
37
|
+
if (_canonicalSet.has(name)) {
|
|
38
|
+
return { ok: true, canonical: name, resolvedFromAlias: false };
|
|
39
|
+
}
|
|
40
|
+
const alias = TOOL_ALIASES[name];
|
|
41
|
+
if (alias) {
|
|
42
|
+
return { ok: true, canonical: alias, resolvedFromAlias: true };
|
|
43
|
+
}
|
|
44
|
+
return { ok: false, reason: "UNKNOWN_TOOL", message: `Unknown tool name: ${name}` };
|
|
45
|
+
}
|
|
46
|
+
/** Look up the registry entry for a name (after alias resolution). */
|
|
47
|
+
export function getToolEntry(name) {
|
|
48
|
+
const resolved = resolveToolName(name);
|
|
49
|
+
return resolved.ok ? _entryByName.get(resolved.canonical) : undefined;
|
|
50
|
+
}
|
|
51
|
+
/** True when the tool exists and is flagged mutating in the registry. */
|
|
52
|
+
export function isMutatingTool(name) {
|
|
53
|
+
return getToolEntry(name)?.mutating ?? false;
|
|
54
|
+
}
|
|
55
|
+
/** Set of canonical names flagged mutating — derived SSOT for the gateway. */
|
|
56
|
+
export const MUTATING_TOOL_NAMES = new Set(TOOL_REGISTRY.filter((t) => t.mutating).map((t) => t.canonical));
|
|
57
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,0BAA0B;AAC1B,MAAM,CAAC,MAAM,aAAa,GAAiC;IACzD,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE;IAChE,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE;IAChE,EAAE,SAAS,EAAE,qBAAqB,EAAE,IAAI,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC7E,EAAE,SAAS,EAAE,uBAAuB,EAAE,IAAI,EAAE,yBAAyB,EAAE,QAAQ,EAAE,IAAI,EAAE;IACvF,EAAE,SAAS,EAAE,cAAc,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE;IACjE,EAAE,SAAS,EAAE,kBAAkB,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE;IACxE,EAAE,SAAS,EAAE,yBAAyB,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE;IAChF,EAAE,SAAS,EAAE,qBAAqB,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE;IACzE,EAAE,SAAS,EAAE,mBAAmB,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE;IACvE,EAAE,SAAS,EAAE,oBAAoB,EAAE,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AE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,sBAAsB,IAAI,EAAE,EAAE,CAAC;AACtF,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,QAAQ,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IACvC,OAAO,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACxE,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,YAAY,CAAC,IAAI,CAAC,EAAE,QAAQ,IAAI,KAAK,CAAC;AAC/C,CAAC;AAED,8EAA8E;AAC9E,MAAM,CAAC,MAAM,mBAAmB,GAAwB,IAAI,GAAG,CAC7D,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAChE,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fail-closed error taxonomy (T-CORE-06 / G-05, SEC-01).
|
|
3
|
+
*
|
|
4
|
+
* Every recoverable failure in the ADK maps to one of these codes so callers
|
|
5
|
+
* can branch deterministically and audit logs stay consistent across packages.
|
|
6
|
+
* Codes are grouped by subsystem; keep in sync with package-level failure types
|
|
7
|
+
* (state AppendFailure, verifier integrity, gateway decisions, doctor checks).
|
|
8
|
+
*/
|
|
9
|
+
export type AdkErrorCode = "CONFIG_INVALID" | "CONFIG_UNSUPPORTED_VERSION" | "PATH_DENIED" | "PATH_ESCAPE" | "EVENT_APPEND_FAILED" | "EVENT_INVALID" | "EVENT_LOG_CORRUPT" | "RUN_ID_MISMATCH" | "IO_ERROR" | "POLICY_DENIED" | "MUTATION_DENIED" | "UNKNOWN_TOOL" | "GATE_FAILED" | "REPORT_HASH_MISMATCH" | "COMMAND_NOT_PERMITTED" | "SDK_INCOMPATIBLE";
|
|
10
|
+
/**
|
|
11
|
+
* Severity classifies whether a failure must abort the operation (fail-closed)
|
|
12
|
+
* or can be surfaced as a warning. Security/integrity failures are always fatal.
|
|
13
|
+
*/
|
|
14
|
+
export type AdkErrorSeverity = "fatal" | "warning";
|
|
15
|
+
export interface AdkError {
|
|
16
|
+
readonly code: AdkErrorCode;
|
|
17
|
+
readonly message: string;
|
|
18
|
+
readonly severity: AdkErrorSeverity;
|
|
19
|
+
readonly cause?: unknown;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Codes that must ALWAYS fail closed (abort), regardless of caller intent.
|
|
23
|
+
* Used by `adkError` to default severity and by guards in security paths.
|
|
24
|
+
*/
|
|
25
|
+
export declare const FAIL_CLOSED_CODES: ReadonlySet<AdkErrorCode>;
|
|
26
|
+
/**
|
|
27
|
+
* Build an AdkError.
|
|
28
|
+
*
|
|
29
|
+
* Severity rules:
|
|
30
|
+
* - fail-closed codes always default to "fatal" and CANNOT be downgraded to
|
|
31
|
+
* "warning" — doing so would allow security violations to be silently ignored.
|
|
32
|
+
* - non-fail-closed codes default to "warning" but may be upgraded to "fatal".
|
|
33
|
+
*/
|
|
34
|
+
export declare function adkError(code: AdkErrorCode, message: string, options?: {
|
|
35
|
+
readonly cause?: unknown;
|
|
36
|
+
readonly severity?: AdkErrorSeverity;
|
|
37
|
+
}): AdkError;
|
|
38
|
+
/** Type guard for AdkError-shaped values. */
|
|
39
|
+
export declare function isAdkError(value: unknown): value is AdkError;
|
|
40
|
+
/** True when the error must abort the operation (fail-closed). */
|
|
41
|
+
export declare function isFatal(error: AdkError): boolean;
|
|
42
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/types/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAEpB,gBAAgB,GAChB,4BAA4B,GAE5B,aAAa,GACb,aAAa,GAEb,qBAAqB,GACrB,eAAe,GACf,mBAAmB,GACnB,iBAAiB,GACjB,UAAU,GAEV,eAAe,GACf,iBAAiB,GACjB,cAAc,GAEd,aAAa,GACb,sBAAsB,GAEtB,uBAAuB,GAEvB,kBAAkB,CAAC;AAEvB;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,SAAS,CAAC;AAEnD,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,YAAY,CAgBtD,CAAC;AAEH;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAA;CAAO,GAC/E,QAAQ,CAkBV;AAED,6CAA6C;AAC7C,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAQ5D;AAED,kEAAkE;AAClE,wBAAgB,OAAO,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAEhD"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codes that must ALWAYS fail closed (abort), regardless of caller intent.
|
|
3
|
+
* Used by `adkError` to default severity and by guards in security paths.
|
|
4
|
+
*/
|
|
5
|
+
export const FAIL_CLOSED_CODES = new Set([
|
|
6
|
+
"PATH_DENIED",
|
|
7
|
+
"PATH_ESCAPE",
|
|
8
|
+
"EVENT_APPEND_FAILED",
|
|
9
|
+
"EVENT_INVALID",
|
|
10
|
+
"EVENT_LOG_CORRUPT",
|
|
11
|
+
"IO_ERROR", // IO failure breaks the audit trail — must abort, not warn
|
|
12
|
+
"RUN_ID_MISMATCH",
|
|
13
|
+
"POLICY_DENIED",
|
|
14
|
+
"MUTATION_DENIED",
|
|
15
|
+
"UNKNOWN_TOOL",
|
|
16
|
+
"GATE_FAILED", // gate verifier failure must abort — cannot proceed without gate
|
|
17
|
+
"REPORT_HASH_MISMATCH",
|
|
18
|
+
"COMMAND_NOT_PERMITTED",
|
|
19
|
+
"SDK_INCOMPATIBLE",
|
|
20
|
+
"CONFIG_UNSUPPORTED_VERSION",
|
|
21
|
+
]);
|
|
22
|
+
/**
|
|
23
|
+
* Build an AdkError.
|
|
24
|
+
*
|
|
25
|
+
* Severity rules:
|
|
26
|
+
* - fail-closed codes always default to "fatal" and CANNOT be downgraded to
|
|
27
|
+
* "warning" — doing so would allow security violations to be silently ignored.
|
|
28
|
+
* - non-fail-closed codes default to "warning" but may be upgraded to "fatal".
|
|
29
|
+
*/
|
|
30
|
+
export function adkError(code, message, options = {}) {
|
|
31
|
+
const isFailClosed = FAIL_CLOSED_CODES.has(code);
|
|
32
|
+
const requestedSeverity = options.severity;
|
|
33
|
+
let severity;
|
|
34
|
+
if (isFailClosed) {
|
|
35
|
+
// Downgrade of a fail-closed code is a programming error — silently enforce fatal.
|
|
36
|
+
severity = "fatal";
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
severity = requestedSeverity ?? "warning";
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
code,
|
|
43
|
+
message,
|
|
44
|
+
severity,
|
|
45
|
+
...(options.cause !== undefined ? { cause: options.cause } : {}),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/** Type guard for AdkError-shaped values. */
|
|
49
|
+
export function isAdkError(value) {
|
|
50
|
+
return (typeof value === "object" &&
|
|
51
|
+
value !== null &&
|
|
52
|
+
"code" in value &&
|
|
53
|
+
"message" in value &&
|
|
54
|
+
"severity" in value);
|
|
55
|
+
}
|
|
56
|
+
/** True when the error must abort the operation (fail-closed). */
|
|
57
|
+
export function isFatal(error) {
|
|
58
|
+
return error.severity === "fatal";
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/types/errors.ts"],"names":[],"mappings":"AA8CA;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA8B,IAAI,GAAG,CAAC;IAClE,aAAa;IACb,aAAa;IACb,qBAAqB;IACrB,eAAe;IACf,mBAAmB;IACnB,UAAU,EAAY,2DAA2D;IACjF,iBAAiB;IACjB,eAAe;IACf,iBAAiB;IACjB,cAAc;IACd,aAAa,EAAW,iEAAiE;IACzF,sBAAsB;IACtB,uBAAuB;IACvB,kBAAkB;IAClB,4BAA4B;CAC7B,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CACtB,IAAkB,EAClB,OAAe,EACf,UAA8E,EAAE;IAEhF,MAAM,YAAY,GAAG,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjD,MAAM,iBAAiB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAE3C,IAAI,QAA0B,CAAC;IAC/B,IAAI,YAAY,EAAE,CAAC;QACjB,mFAAmF;QACnF,QAAQ,GAAG,OAAO,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,QAAQ,GAAG,iBAAiB,IAAI,SAAS,CAAC;IAC5C,CAAC;IAED,OAAO;QACL,IAAI;QACJ,OAAO;QACP,QAAQ;QACR,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACjE,CAAC;AACJ,CAAC;AAED,6CAA6C;AAC7C,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,IAAI,KAAK;QACf,SAAS,IAAI,KAAK;QAClB,UAAU,IAAI,KAAK,CACpB,CAAC;AACJ,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,OAAO,CAAC,KAAe;IACrC,OAAO,KAAK,CAAC,QAAQ,KAAK,OAAO,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CorrelationIds } from "../correlation.js";
|
|
2
|
+
/** Canonical event kinds — owned by core. */
|
|
3
|
+
export type EventKind = "run.started" | "run.completed" | "run.failed" | "tool.invoked" | "tool.completed" | "tool.failed" | "policy.denied" | "policy.approval.required" | "policy.approved" | "gate.report" | "mutation.denied";
|
|
4
|
+
/** Base event envelope — persisted shape extends this in state package. */
|
|
5
|
+
export interface AdkEventBase {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly kind: EventKind;
|
|
8
|
+
readonly timestamp: string;
|
|
9
|
+
readonly specId: string;
|
|
10
|
+
readonly runId: string;
|
|
11
|
+
readonly requestId: string;
|
|
12
|
+
readonly payload: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
/** Bridge contract between CLI/gateway and runner-sdk — owned by core. */
|
|
15
|
+
export interface ToolInvocation {
|
|
16
|
+
readonly toolName: string;
|
|
17
|
+
readonly args: Record<string, unknown>;
|
|
18
|
+
readonly correlation: CorrelationIds;
|
|
19
|
+
/** Policy-evaluated mutation target; forwarded to mutating tools after boundary allow. */
|
|
20
|
+
readonly targetPath?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ToolInvocationResult {
|
|
23
|
+
readonly toolName: string;
|
|
24
|
+
readonly success: boolean;
|
|
25
|
+
readonly output?: unknown;
|
|
26
|
+
readonly error?: string;
|
|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AK,CAAC,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jcr-adk/core",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"import": "./dist/index.js"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"tsx": "^4.19.4",
|
|
15
|
+
"typescript": "^5.8.3"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"description": "JCR ADK (Jason Cursor ADK) — core",
|
|
24
|
+
"scripts": {
|
|
25
|
+
"typecheck": "tsc --noEmit",
|
|
26
|
+
"test": "node --import tsx --test src/config.test.ts src/gateway/gateway.test.ts src/tools/registry.test.ts src/types/errors.test.ts",
|
|
27
|
+
"build": "tsc -p tsconfig.build.json"
|
|
28
|
+
}
|
|
29
|
+
}
|