primcli 1.10.0 → 1.11.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/dist/oclif/index.js +75 -32
- package/package.json +1 -1
package/dist/oclif/index.js
CHANGED
|
@@ -4629,7 +4629,8 @@ const openapiDocument = {
|
|
|
4629
4629
|
"name": "slug",
|
|
4630
4630
|
"in": "path",
|
|
4631
4631
|
"required": true,
|
|
4632
|
-
"schema": { "type": "string" }
|
|
4632
|
+
"schema": { "type": "string" },
|
|
4633
|
+
"description": "The registry slug."
|
|
4633
4634
|
}],
|
|
4634
4635
|
"get": {
|
|
4635
4636
|
"operationId": "listRegistryAgents",
|
|
@@ -4644,7 +4645,8 @@ const openapiDocument = {
|
|
|
4644
4645
|
"type": "integer",
|
|
4645
4646
|
"minimum": 1,
|
|
4646
4647
|
"maximum": 200
|
|
4647
|
-
}
|
|
4648
|
+
},
|
|
4649
|
+
"description": "Maximum number of items to return (1-200)."
|
|
4648
4650
|
}, {
|
|
4649
4651
|
"name": "cursor",
|
|
4650
4652
|
"in": "query",
|
|
@@ -4690,12 +4692,14 @@ const openapiDocument = {
|
|
|
4690
4692
|
"name": "slug",
|
|
4691
4693
|
"in": "path",
|
|
4692
4694
|
"required": true,
|
|
4693
|
-
"schema": { "type": "string" }
|
|
4695
|
+
"schema": { "type": "string" },
|
|
4696
|
+
"description": "The registry slug."
|
|
4694
4697
|
}, {
|
|
4695
4698
|
"name": "handle",
|
|
4696
4699
|
"in": "path",
|
|
4697
4700
|
"required": true,
|
|
4698
|
-
"schema": { "type": "string" }
|
|
4701
|
+
"schema": { "type": "string" },
|
|
4702
|
+
"description": "The registry-scoped handle the agent is published under."
|
|
4699
4703
|
}],
|
|
4700
4704
|
"get": {
|
|
4701
4705
|
"operationId": "resolveRegistryHandle",
|
|
@@ -4726,7 +4730,8 @@ const openapiDocument = {
|
|
|
4726
4730
|
"name": "slug",
|
|
4727
4731
|
"in": "path",
|
|
4728
4732
|
"required": true,
|
|
4729
|
-
"schema": { "type": "string" }
|
|
4733
|
+
"schema": { "type": "string" },
|
|
4734
|
+
"description": "The registry slug."
|
|
4730
4735
|
}],
|
|
4731
4736
|
"get": {
|
|
4732
4737
|
"operationId": "listRegistryRequests",
|
|
@@ -4740,7 +4745,8 @@ const openapiDocument = {
|
|
|
4740
4745
|
"type": "integer",
|
|
4741
4746
|
"minimum": 1,
|
|
4742
4747
|
"maximum": 200
|
|
4743
|
-
}
|
|
4748
|
+
},
|
|
4749
|
+
"description": "Maximum number of items to return (1-200)."
|
|
4744
4750
|
}],
|
|
4745
4751
|
"responses": {
|
|
4746
4752
|
"200": {
|
|
@@ -4760,7 +4766,8 @@ const openapiDocument = {
|
|
|
4760
4766
|
"name": "slug",
|
|
4761
4767
|
"in": "path",
|
|
4762
4768
|
"required": true,
|
|
4763
|
-
"schema": { "type": "string" }
|
|
4769
|
+
"schema": { "type": "string" },
|
|
4770
|
+
"description": "The registry slug."
|
|
4764
4771
|
}, { "$ref": "#/components/parameters/ResourceId" }],
|
|
4765
4772
|
"post": {
|
|
4766
4773
|
"operationId": "decideRegistryRequest",
|
|
@@ -16292,7 +16299,7 @@ const operationManifest = [
|
|
|
16292
16299
|
"operationId": "decideRegistryRequest",
|
|
16293
16300
|
"path": "/registries/{slug}/requests/{id}",
|
|
16294
16301
|
"pathParams": [{
|
|
16295
|
-
"description":
|
|
16302
|
+
"description": "The registry slug.",
|
|
16296
16303
|
"enum": null,
|
|
16297
16304
|
"name": "slug",
|
|
16298
16305
|
"required": true,
|
|
@@ -16554,14 +16561,14 @@ const operationManifest = [
|
|
|
16554
16561
|
"operationId": "listRegistryAgents",
|
|
16555
16562
|
"path": "/registries/{slug}/agents",
|
|
16556
16563
|
"pathParams": [{
|
|
16557
|
-
"description":
|
|
16564
|
+
"description": "The registry slug.",
|
|
16558
16565
|
"enum": null,
|
|
16559
16566
|
"name": "slug",
|
|
16560
16567
|
"required": true,
|
|
16561
16568
|
"type": "string"
|
|
16562
16569
|
}],
|
|
16563
16570
|
"queryParams": [{
|
|
16564
|
-
"description":
|
|
16571
|
+
"description": "Maximum number of items to return (1-200).",
|
|
16565
16572
|
"enum": null,
|
|
16566
16573
|
"maximum": 200,
|
|
16567
16574
|
"minimum": 1,
|
|
@@ -16620,14 +16627,14 @@ const operationManifest = [
|
|
|
16620
16627
|
"operationId": "listRegistryRequests",
|
|
16621
16628
|
"path": "/registries/{slug}/requests",
|
|
16622
16629
|
"pathParams": [{
|
|
16623
|
-
"description":
|
|
16630
|
+
"description": "The registry slug.",
|
|
16624
16631
|
"enum": null,
|
|
16625
16632
|
"name": "slug",
|
|
16626
16633
|
"required": true,
|
|
16627
16634
|
"type": "string"
|
|
16628
16635
|
}],
|
|
16629
16636
|
"queryParams": [{
|
|
16630
|
-
"description":
|
|
16637
|
+
"description": "Maximum number of items to return (1-200).",
|
|
16631
16638
|
"enum": null,
|
|
16632
16639
|
"maximum": 200,
|
|
16633
16640
|
"minimum": 1,
|
|
@@ -16678,7 +16685,7 @@ const operationManifest = [
|
|
|
16678
16685
|
"operationId": "publishAgent",
|
|
16679
16686
|
"path": "/registries/{slug}/agents",
|
|
16680
16687
|
"pathParams": [{
|
|
16681
|
-
"description":
|
|
16688
|
+
"description": "The registry slug.",
|
|
16682
16689
|
"enum": null,
|
|
16683
16690
|
"name": "slug",
|
|
16684
16691
|
"required": true,
|
|
@@ -16731,13 +16738,13 @@ const operationManifest = [
|
|
|
16731
16738
|
"operationId": "resolveRegistryHandle",
|
|
16732
16739
|
"path": "/registries/{slug}/agents/{handle}",
|
|
16733
16740
|
"pathParams": [{
|
|
16734
|
-
"description":
|
|
16741
|
+
"description": "The registry slug.",
|
|
16735
16742
|
"enum": null,
|
|
16736
16743
|
"name": "slug",
|
|
16737
16744
|
"required": true,
|
|
16738
16745
|
"type": "string"
|
|
16739
16746
|
}, {
|
|
16740
|
-
"description":
|
|
16747
|
+
"description": "The registry-scoped handle the agent is published under.",
|
|
16741
16748
|
"enum": null,
|
|
16742
16749
|
"name": "handle",
|
|
16743
16750
|
"required": true,
|
|
@@ -16786,13 +16793,13 @@ const operationManifest = [
|
|
|
16786
16793
|
"operationId": "unpublishAgent",
|
|
16787
16794
|
"path": "/registries/{slug}/agents/{handle}",
|
|
16788
16795
|
"pathParams": [{
|
|
16789
|
-
"description":
|
|
16796
|
+
"description": "The registry slug.",
|
|
16790
16797
|
"enum": null,
|
|
16791
16798
|
"name": "slug",
|
|
16792
16799
|
"required": true,
|
|
16793
16800
|
"type": "string"
|
|
16794
16801
|
}, {
|
|
16795
|
-
"description":
|
|
16802
|
+
"description": "The registry-scoped handle the agent is published under.",
|
|
16796
16803
|
"enum": null,
|
|
16797
16804
|
"name": "handle",
|
|
16798
16805
|
"required": true,
|
|
@@ -22648,8 +22655,8 @@ const PRIMITIVE_TEAM_AUTHOR = {
|
|
|
22648
22655
|
name: "Primitive Team",
|
|
22649
22656
|
url: "https://primitive.dev"
|
|
22650
22657
|
};
|
|
22651
|
-
const SDK_VERSION_RANGE = "^1.
|
|
22652
|
-
const CLI_VERSION_RANGE = "^1.
|
|
22658
|
+
const SDK_VERSION_RANGE = "^1.11.0";
|
|
22659
|
+
const CLI_VERSION_RANGE = "^1.11.0";
|
|
22653
22660
|
const ESBUILD_VERSION_RANGE = "^0.27.0";
|
|
22654
22661
|
function renderHandler() {
|
|
22655
22662
|
return `// env.PRIMITIVE_API_KEY, env.PRIMITIVE_WEBHOOK_SECRET, and
|
|
@@ -26194,24 +26201,47 @@ function toPaymentPayload(network, auth, signature) {
|
|
|
26194
26201
|
};
|
|
26195
26202
|
}
|
|
26196
26203
|
/**
|
|
26197
|
-
* Compute the EIP-3009 validity window for a payment
|
|
26198
|
-
*
|
|
26199
|
-
*
|
|
26200
|
-
*
|
|
26201
|
-
*
|
|
26202
|
-
*
|
|
26204
|
+
* Compute the EIP-3009 validity window for a payment, landing inside the band
|
|
26205
|
+
* the platform accepts. `validBefore` governs on-chain validity, so it MUST
|
|
26206
|
+
* stay far enough in the future to settle (>= `minHeadroomSec`) yet not so far
|
|
26207
|
+
* that the total window exceeds the `maxWindowSec` cap; `validAfter` is set
|
|
26208
|
+
* generously in the past for clock skew.
|
|
26209
|
+
*
|
|
26210
|
+
* Both ends of that band are payer landmines: a too-tight `validBefore` (low
|
|
26211
|
+
* headroom, e.g. a near-expired challenge) is rejected for being about to
|
|
26212
|
+
* expire, and a too-wide window (far-future expiry) is rejected as
|
|
26213
|
+
* "authorization window too wide". By default this clamps the computed window
|
|
26214
|
+
* into the band so a caller who does not override always gets a signable
|
|
26215
|
+
* window.
|
|
26216
|
+
*
|
|
26217
|
+
* If the caller passes an explicit `validBeforeSec` or `validAfterSec`, that is
|
|
26218
|
+
* an intent to pin the bound: when it falls outside the band this throws a
|
|
26219
|
+
* specific error naming which bound was violated (rather than silently signing
|
|
26220
|
+
* a doomed authorization), unless `clamp` is left enabled, in which case the
|
|
26221
|
+
* pinned value is clamped into the band like the computed one.
|
|
26203
26222
|
*/
|
|
26204
26223
|
function computePaymentValidityWindow(params) {
|
|
26205
26224
|
const margin = params.settlementMarginSec ?? 300;
|
|
26206
26225
|
const skew = params.clockSkewSec ?? 300;
|
|
26207
|
-
const
|
|
26208
|
-
const
|
|
26209
|
-
|
|
26210
|
-
|
|
26211
|
-
|
|
26226
|
+
const maxWindow = params.maxWindowSec ?? 86400;
|
|
26227
|
+
const minHeadroom = params.minHeadroomSec ?? 60;
|
|
26228
|
+
const clamp = params.clamp ?? true;
|
|
26229
|
+
if (maxWindow < minHeadroom) throw new Error(`invalid validity window config: maxWindowSec (${maxWindow}) is smaller than minHeadroomSec (${minHeadroom})`);
|
|
26230
|
+
const validAfter = params.validAfterSec !== void 0 ? params.validAfterSec : params.nowSec - skew;
|
|
26231
|
+
const rawValidBefore = params.validBeforeSec !== void 0 ? params.validBeforeSec : params.challengeExpiresAtSec + margin;
|
|
26232
|
+
const floor = params.nowSec + minHeadroom;
|
|
26233
|
+
const ceiling = validAfter + maxWindow;
|
|
26234
|
+
const tooTight = rawValidBefore < floor;
|
|
26235
|
+
const tooWide = rawValidBefore > ceiling;
|
|
26236
|
+
if (!clamp && params.validBeforeSec !== void 0) {
|
|
26237
|
+
if (tooTight) throw new Error(`invalid validity window: validBefore (${rawValidBefore}) is below the minimum settlement headroom (must be >= now + ${minHeadroom}s = ${floor}); the authorization would be rejected as about to expire`);
|
|
26238
|
+
if (tooWide) throw new Error(`invalid validity window: validBefore (${rawValidBefore}) exceeds the ${maxWindow}s window cap (must be <= validAfter + ${maxWindow}s = ${ceiling}); the authorization window is too wide`);
|
|
26239
|
+
}
|
|
26240
|
+
const bandedValidBefore = tooTight ? floor : tooWide ? ceiling : rawValidBefore;
|
|
26241
|
+
if (bandedValidBefore <= validAfter) throw new Error("invalid validity window: validBefore must be after validAfter (challenge already expired or validAfter pinned too late?)");
|
|
26212
26242
|
return {
|
|
26213
|
-
validAfter,
|
|
26214
|
-
validBefore
|
|
26243
|
+
validAfter: BigInt(validAfter),
|
|
26244
|
+
validBefore: BigInt(bandedValidBefore)
|
|
26215
26245
|
};
|
|
26216
26246
|
}
|
|
26217
26247
|
/**
|
|
@@ -26308,6 +26338,7 @@ var X402Error = class extends Error {
|
|
|
26308
26338
|
this.retryAfter = options?.retryAfter ?? null;
|
|
26309
26339
|
}
|
|
26310
26340
|
};
|
|
26341
|
+
new RegExp(`^${/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.source.slice(1, -1)}@[^\\s@]+$`, "i");
|
|
26311
26342
|
/**
|
|
26312
26343
|
* Assert a challenge is fully hydrated before signing, so a missing field fails
|
|
26313
26344
|
* with a named X402Error instead of an opaque viem/BigInt error mid-sign.
|
|
@@ -28529,6 +28560,18 @@ const CANONICAL_OPERATION_ALIASES = {
|
|
|
28529
28560
|
"functions:get": "functions:get-function",
|
|
28530
28561
|
"functions:list": "functions:list-functions",
|
|
28531
28562
|
"functions:list-secrets": "functions:list-function-secrets",
|
|
28563
|
+
"registries:agent": "registries:get-agent",
|
|
28564
|
+
"registries:agents": "registries:list-registry-agents",
|
|
28565
|
+
"registries:create": "registries:create-registry",
|
|
28566
|
+
"registries:decide": "registries:decide-registry-request",
|
|
28567
|
+
"registries:define": "registries:define-agent",
|
|
28568
|
+
"registries:get": "registries:get-registry",
|
|
28569
|
+
"registries:list": "registries:list-registries",
|
|
28570
|
+
"registries:publish": "registries:publish-agent",
|
|
28571
|
+
"registries:requests": "registries:list-registry-requests",
|
|
28572
|
+
"registries:resolve": "registries:resolve-registry-handle",
|
|
28573
|
+
"registries:unpublish": "registries:unpublish-agent",
|
|
28574
|
+
"registries:update": "registries:update-registry",
|
|
28532
28575
|
"sending:get": "sending:get-sent-email",
|
|
28533
28576
|
"sending:list": "sending:list-sent-emails",
|
|
28534
28577
|
"sending:permissions": "sending:get-send-permissions",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "primcli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "Official Primitive CLI: deploy Primitive Functions, send and inspect mail, manage endpoints, all from the terminal. Wraps the @primitivedotdev/sdk runtime client with one-shot commands.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|