@codai/axiom-mcp 2.1.0 → 2.2.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/README.md +56 -24
- package/dist/{axm-lazy-CR-FmFVd.js → axm-lazy-LAnrfjUO.js} +32 -3
- package/dist/axm-lazy-Xin1nh7Q.js +6284 -0
- package/dist/axm-lazy.js +119 -9
- package/dist/cli-main.js +1650 -14959
- package/dist/dist-Bt9Wvd_P.js +6379 -0
- package/dist/{dist-FFqnyzCe.js → dist-D4M2Lyji.js} +264 -27
- package/dist/gate-lazy.js +581 -46
- package/dist/gc-lazy.js +6885 -0
- package/dist/http-lazy.js +18262 -9889
- package/dist/index.d.ts +140 -4
- package/dist/index.js +575 -41
- package/dist/mcp-lazy.js +23050 -0
- package/dist/migrate-lazy.js +48 -7
- package/dist/verify-tree-lazy.js +6893 -0
- package/package.json +14 -9
- package/spec/codai-tools.json +283 -0
- package/spec/tools.json +1487 -160
package/dist/axm-lazy.js
CHANGED
|
@@ -5809,18 +5809,26 @@ const ERROR_CODES = [
|
|
|
5809
5809
|
"ERR_PROVIDER_FAILED",
|
|
5810
5810
|
"ERR_GUARD_TIMEOUT",
|
|
5811
5811
|
"ERR_GUARD_OUTPUT",
|
|
5812
|
+
"ERR_FACT_DISABLED",
|
|
5812
5813
|
"ERR_SIGNATURE_MISSING",
|
|
5813
5814
|
"ERR_SIGNATURE_INVALID",
|
|
5815
|
+
"ERR_TRUST_STATE_CORRUPT",
|
|
5814
5816
|
"ERR_ROLLBACK",
|
|
5815
5817
|
"ERR_EMITTER_UNKNOWN",
|
|
5816
5818
|
"ERR_TEMPLATE_UNKNOWN",
|
|
5817
5819
|
"ERR_TEMPLATE_PARAMS",
|
|
5820
|
+
"ERR_PATCH_FORMAT",
|
|
5821
|
+
"ERR_PATCH_PREIMAGE",
|
|
5822
|
+
"ERR_PATCH_NO_MATCH",
|
|
5818
5823
|
"ERR_GIT_NOT_FOUND",
|
|
5819
5824
|
"ERR_GIT_NOT_REPO",
|
|
5820
5825
|
"ERR_GIT_DIRTY",
|
|
5821
5826
|
"ERR_GIT_BRANCH_EXISTS",
|
|
5822
5827
|
"ERR_GIT_BRANCH_INVALID",
|
|
5823
5828
|
"ERR_GIT_FAILED",
|
|
5829
|
+
"ERR_TASK_NOT_FOUND",
|
|
5830
|
+
"ERR_TASK_CANCELLED",
|
|
5831
|
+
"ERR_PLAN_SESSION_STATE",
|
|
5824
5832
|
"ERR_REF_OFFLINE",
|
|
5825
5833
|
"ERR_NET_DISABLED",
|
|
5826
5834
|
"ERR_NET_DENIED",
|
|
@@ -5919,7 +5927,18 @@ object({
|
|
|
5919
5927
|
/** sha256(JCS(all facts)) → replayable. */
|
|
5920
5928
|
factsDigest: DigestRefSchema,
|
|
5921
5929
|
durationMs: int().nonnegative(),
|
|
5922
|
-
providers: array(ProviderStatusSchema)
|
|
5930
|
+
providers: array(ProviderStatusSchema),
|
|
5931
|
+
/**
|
|
5932
|
+
* S-402: how the manifest's `preImage` related to the tree at check time.
|
|
5933
|
+
* `verified` = every entry matched; `drifted` = at least one differed (an `error`
|
|
5934
|
+
* finding `ERR_PREIMAGE_CHANGED` is also emitted); `unverified` = no root, or the
|
|
5935
|
+
* manifest carries no `preImage`.
|
|
5936
|
+
*/
|
|
5937
|
+
preImage: _enum([
|
|
5938
|
+
"verified",
|
|
5939
|
+
"drifted",
|
|
5940
|
+
"unverified"
|
|
5941
|
+
]).optional()
|
|
5923
5942
|
}).strict();
|
|
5924
5943
|
const ApiVersionSchema = literal("axiom.dev/v2");
|
|
5925
5944
|
/** Per-blob inline limit: 256 KiB of string content (≈192 KiB decoded when base64). */
|
|
@@ -5959,7 +5978,18 @@ const PlanArtifactSourceSchema = discriminatedUnion("type", [
|
|
|
5959
5978
|
emitter: string().min(1),
|
|
5960
5979
|
template: string().min(1),
|
|
5961
5980
|
params: record(string(), json()).default({})
|
|
5962
|
-
}).strict().describe("
|
|
5981
|
+
}).strict().describe("template source rendered by a registered emitter at compile time"),
|
|
5982
|
+
object({
|
|
5983
|
+
type: literal("patch"),
|
|
5984
|
+
format: _enum([
|
|
5985
|
+
"unified",
|
|
5986
|
+
"v4a",
|
|
5987
|
+
"search-replace"
|
|
5988
|
+
]),
|
|
5989
|
+
/** sha256 of the file the patch was authored against, or `absent` for a new file. */
|
|
5990
|
+
preImage: union([DigestRefSchema, literal("absent")]),
|
|
5991
|
+
body: string().max(INLINE_CONTENT_MAX)
|
|
5992
|
+
}).strict().describe("patch applied at compile time to the pre-image named by its digest")
|
|
5963
5993
|
]);
|
|
5964
5994
|
const PlanArtifactSchema = object({
|
|
5965
5995
|
path: RelPathSchema,
|
|
@@ -6039,6 +6069,11 @@ object({
|
|
|
6039
6069
|
/** Path of `.axiom/journal/<digest>.json`. */
|
|
6040
6070
|
journal: string().optional(),
|
|
6041
6071
|
git: GitResultSchema.optional(),
|
|
6072
|
+
/**
|
|
6073
|
+
* Re-apply of an already-applied digest whose files no longer matched on disk:
|
|
6074
|
+
* the artifacts listed here were re-written over foreign changes (design §apply).
|
|
6075
|
+
*/
|
|
6076
|
+
drifted: array(RelPathSchema).optional(),
|
|
6042
6077
|
error: ApplyErrorSchema.optional()
|
|
6043
6078
|
}).strict().superRefine((r, ctx) => {
|
|
6044
6079
|
if (r.status === "failed" && r.error === void 0) ctx.addIssue({
|
|
@@ -6105,7 +6140,8 @@ const ManifestArtifactSchema = object({
|
|
|
6105
6140
|
"inline",
|
|
6106
6141
|
"template",
|
|
6107
6142
|
"cas",
|
|
6108
|
-
"ref"
|
|
6143
|
+
"ref",
|
|
6144
|
+
"patch"
|
|
6109
6145
|
]).optional()
|
|
6110
6146
|
}).strict().superRefine((a, ctx) => {
|
|
6111
6147
|
if (a.op !== "delete" && a.digest === void 0) ctx.addIssue({
|
|
@@ -6119,6 +6155,15 @@ const ToolchainSchema = object({
|
|
|
6119
6155
|
axiom: string().min(1),
|
|
6120
6156
|
emitters: record(string(), string())
|
|
6121
6157
|
}).strict();
|
|
6158
|
+
/**
|
|
6159
|
+
* What compile saw on disk for one artifact path (S-402): the sha256 of the existing file
|
|
6160
|
+
* or `absent`. Binds a manifest — and every CheckReport/attestation over it — to the tree
|
|
6161
|
+
* it was produced against; `apply` refuses a different tree with `ERR_PREIMAGE_CHANGED`.
|
|
6162
|
+
*/
|
|
6163
|
+
const PreImageEntrySchema = object({
|
|
6164
|
+
path: RelPathSchema,
|
|
6165
|
+
sha256: union([Sha256HexSchema, literal("absent")])
|
|
6166
|
+
}).strict();
|
|
6122
6167
|
/** The exact object that is JCS-canonicalised and sha256-hashed into `manifestDigest`. */
|
|
6123
6168
|
const ManifestBodySchema = object({
|
|
6124
6169
|
apiVersion: ApiVersionSchema,
|
|
@@ -6136,8 +6181,20 @@ const ManifestBodySchema = object({
|
|
|
6136
6181
|
* Anti-rollback counter (D-16): monotonic per root, part of the canonical body so a
|
|
6137
6182
|
* signature binds it. Verified by `manifest.requireSigned { antiRollback: true }`.
|
|
6138
6183
|
*/
|
|
6139
|
-
counter: int().nonnegative().optional()
|
|
6184
|
+
counter: int().nonnegative().optional(),
|
|
6185
|
+
/**
|
|
6186
|
+
* Pre-image of every artifact path at compile time (S-402), sorted by path, unique;
|
|
6187
|
+
* present when compile had a root (or a pre-image reader). Part of the canonical body:
|
|
6188
|
+
* the same Plan compiled against a different tree is a different manifest.
|
|
6189
|
+
*/
|
|
6190
|
+
preImage: array(PreImageEntrySchema).optional()
|
|
6140
6191
|
}).strict().superRefine((m, ctx) => {
|
|
6192
|
+
if (m.preImage !== void 0 && !isSortedUnique(m.preImage.map((p) => p.path))) ctx.addIssue({
|
|
6193
|
+
code: "custom",
|
|
6194
|
+
path: ["preImage"],
|
|
6195
|
+
message: "preImage must be sorted by path (UTF-8 byte order) and unique",
|
|
6196
|
+
params: { code: "ERR_NOT_CANONICAL" }
|
|
6197
|
+
});
|
|
6141
6198
|
if (!isSortedUnique(m.artifacts.map((a) => a.path))) ctx.addIssue({
|
|
6142
6199
|
code: "custom",
|
|
6143
6200
|
path: ["artifacts"],
|
|
@@ -6180,12 +6237,24 @@ const DsseEnvelopeSchema = object({
|
|
|
6180
6237
|
sig: base64()
|
|
6181
6238
|
}).strict())
|
|
6182
6239
|
}).strict();
|
|
6240
|
+
/** DSSE payloadType of a signed `ManifestBody` (D-16). */
|
|
6241
|
+
const AXIOM_MANIFEST_PAYLOAD_TYPE = "application/vnd.axiom.manifest+json";
|
|
6242
|
+
/**
|
|
6243
|
+
* DSSE payloadType of a **root-bound** signature (S-409): the payload is
|
|
6244
|
+
* `JCS({ manifest, rootId })`, so the same key's signature over the same manifest is not
|
|
6245
|
+
* valid for a root whose trust store declares a different `rootId`.
|
|
6246
|
+
*/
|
|
6247
|
+
const AXIOM_MANIFEST_BOUND_PAYLOAD_TYPE = "application/vnd.axiom.manifest-bound+json";
|
|
6248
|
+
/** Operator-chosen root identity, e.g. `github:dragoscv/brivio` or a UUID. */
|
|
6249
|
+
const RootIdSchema = string().min(1).max(200).regex(/^[A-Za-z0-9][A-Za-z0-9._:/@-]*$/, "rootId: letters, digits, . _ : / @ - only");
|
|
6183
6250
|
/**
|
|
6184
6251
|
* DSSE envelope whose payload is `base64(JCS(manifest))`, signed with Ed25519 (D-16).
|
|
6185
6252
|
* Lives outside the canonical body: `manifestDigest` is unchanged whether signed or not.
|
|
6253
|
+
* With `payloadType` = `AXIOM_MANIFEST_BOUND_PAYLOAD_TYPE` the payload is
|
|
6254
|
+
* `base64(JCS({ manifest, rootId }))` (S-409).
|
|
6186
6255
|
*/
|
|
6187
6256
|
const ManifestSignatureSchema = object({
|
|
6188
|
-
payloadType: literal(
|
|
6257
|
+
payloadType: union([literal(AXIOM_MANIFEST_PAYLOAD_TYPE), literal(AXIOM_MANIFEST_BOUND_PAYLOAD_TYPE)]),
|
|
6189
6258
|
payload: base64(),
|
|
6190
6259
|
signatures: array(object({
|
|
6191
6260
|
keyid: string().optional(),
|
|
@@ -6207,13 +6276,24 @@ object({
|
|
|
6207
6276
|
version: literal(1),
|
|
6208
6277
|
keys: array(TrustedKeySchema),
|
|
6209
6278
|
/** Floor for `counter` when no state has been recorded yet. */
|
|
6210
|
-
minCounter: int().nonnegative().optional()
|
|
6279
|
+
minCounter: int().nonnegative().optional(),
|
|
6280
|
+
/**
|
|
6281
|
+
* When set, only root-bound signatures carrying this exact id count (S-409): an
|
|
6282
|
+
* unbound or differently-bound envelope is `signature.unbound`. Absent → both accepted.
|
|
6283
|
+
*/
|
|
6284
|
+
rootId: RootIdSchema.optional()
|
|
6211
6285
|
}).strict();
|
|
6212
6286
|
object({
|
|
6213
6287
|
version: literal(1),
|
|
6214
6288
|
lastCounter: int().nonnegative(),
|
|
6215
6289
|
/** Digest of the manifest that advanced `lastCounter` (informational). */
|
|
6216
|
-
manifestDigest: DigestRefSchema.optional()
|
|
6290
|
+
manifestDigest: DigestRefSchema.optional(),
|
|
6291
|
+
/**
|
|
6292
|
+
* HMAC-SHA256 (hex) over `JCS(state without mac)` keyed by `.axiom/trust/state.key`
|
|
6293
|
+
* (S-409). Written by every `advanceTrustState`; a state with a key on disk but a
|
|
6294
|
+
* missing/wrong mac is `ERR_TRUST_STATE_CORRUPT`.
|
|
6295
|
+
*/
|
|
6296
|
+
mac: string().regex(/^[0-9a-f]{64}$/).optional()
|
|
6217
6297
|
}).strict();
|
|
6218
6298
|
object({
|
|
6219
6299
|
manifest: ManifestBodySchema,
|
|
@@ -12146,6 +12226,7 @@ const ModeKw = keyword("ModeKw", "mode");
|
|
|
12146
12226
|
const OpKw = keyword("OpKw", "op");
|
|
12147
12227
|
const Inline = keyword("Inline", "inline");
|
|
12148
12228
|
const Template = keyword("Template", "template");
|
|
12229
|
+
const Patch = keyword("Patch", "patch");
|
|
12149
12230
|
const Cas = keyword("Cas", "cas");
|
|
12150
12231
|
const Ref = keyword("Ref", "ref");
|
|
12151
12232
|
const Check = keyword("Check", "check");
|
|
@@ -12322,6 +12403,7 @@ const allTokens = [
|
|
|
12322
12403
|
OpKw,
|
|
12323
12404
|
Inline,
|
|
12324
12405
|
Template,
|
|
12406
|
+
Patch,
|
|
12325
12407
|
Cas,
|
|
12326
12408
|
Ref,
|
|
12327
12409
|
Check,
|
|
@@ -12594,6 +12676,26 @@ var Compiler = class {
|
|
|
12594
12676
|
params: params ?? {}
|
|
12595
12677
|
};
|
|
12596
12678
|
}
|
|
12679
|
+
const patch = first(nodes(ctx, "patchSource"));
|
|
12680
|
+
if (patch !== void 0) {
|
|
12681
|
+
const pc = patch.children;
|
|
12682
|
+
const f = first(tokens(pc, "format"));
|
|
12683
|
+
const d = first(tokens(pc, "preImage"));
|
|
12684
|
+
const ab = first(tokens(pc, "absent"));
|
|
12685
|
+
const h = first(tokens(pc, "body"));
|
|
12686
|
+
this.at(`${path}.format`, tokenRange(f));
|
|
12687
|
+
this.at(`${path}.preImage`, tokenRange(d ?? ab ?? f));
|
|
12688
|
+
this.at(`${path}.body`, tokenRange(h));
|
|
12689
|
+
if (ab !== void 0 && ab.image !== "absent") this.error("patch pre-image must be a \"sha256:…\" digest or the word absent", tokenRange(ab));
|
|
12690
|
+
const payload = h?.payload;
|
|
12691
|
+
const body = payload === void 0 ? "" : `${payload.content}\n`;
|
|
12692
|
+
return {
|
|
12693
|
+
type: "patch",
|
|
12694
|
+
format: f?.image ?? "",
|
|
12695
|
+
preImage: d !== void 0 ? decodeString(d.image) : "absent",
|
|
12696
|
+
body
|
|
12697
|
+
};
|
|
12698
|
+
}
|
|
12597
12699
|
}
|
|
12598
12700
|
check(n, path) {
|
|
12599
12701
|
const ctx = n.children;
|
|
@@ -12667,7 +12769,8 @@ function compileCst(file) {
|
|
|
12667
12769
|
* PlanItem = "intent" String | "profile" Ident | "capabilities" "[" [Cap {"," Cap}] "]"
|
|
12668
12770
|
* | "artifact" String ArtifactBody | "check" Ident "using" QualIdent [Json] | "meta" Json ;
|
|
12669
12771
|
* ArtifactBody= "{", { "mode" Mode | "op" Op | Source }, "}" ;
|
|
12670
|
-
* Source = "inline" HereDoc | "template" QualIdent String [Json] | "cas" Digest | "ref" String Digest
|
|
12772
|
+
* Source = "inline" HereDoc | "template" QualIdent String [Json] | "cas" Digest | "ref" String Digest
|
|
12773
|
+
* | "patch" Format ( Digest | "absent" ) HereDoc ; Format = unified | v4a | search-replace
|
|
12671
12774
|
* QualIdent = Ident, { ".", Ident } ;
|
|
12672
12775
|
*/
|
|
12673
12776
|
var AxmParser = class extends CstParser {
|
|
@@ -12749,9 +12852,16 @@ var AxmParser = class extends CstParser {
|
|
|
12749
12852
|
{ ALT: () => this.SUBRULE(this.inlineSource) },
|
|
12750
12853
|
{ ALT: () => this.SUBRULE(this.templateSource) },
|
|
12751
12854
|
{ ALT: () => this.SUBRULE(this.casSource) },
|
|
12752
|
-
{ ALT: () => this.SUBRULE(this.refSource) }
|
|
12855
|
+
{ ALT: () => this.SUBRULE(this.refSource) },
|
|
12856
|
+
{ ALT: () => this.SUBRULE(this.patchSource) }
|
|
12753
12857
|
]);
|
|
12754
12858
|
});
|
|
12859
|
+
patchSource = this.RULE("patchSource", () => {
|
|
12860
|
+
this.CONSUME(Patch);
|
|
12861
|
+
this.CONSUME(IdentLike, { LABEL: "format" });
|
|
12862
|
+
this.OR([{ ALT: () => this.CONSUME(Digest, { LABEL: "preImage" }) }, { ALT: () => this.CONSUME2(IdentLike, { LABEL: "absent" }) }]);
|
|
12863
|
+
this.CONSUME(HereDoc, { LABEL: "body" });
|
|
12864
|
+
});
|
|
12755
12865
|
inlineSource = this.RULE("inlineSource", () => {
|
|
12756
12866
|
this.CONSUME(Inline);
|
|
12757
12867
|
this.CONSUME(HereDoc, { LABEL: "content" });
|