@finchtech/cli 0.3.0 → 0.3.1
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 +9 -1
- package/dist/finch.js +63 -14
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -36,8 +36,12 @@ Task and Skill business discovery and preparation stay in the Remote MCP server.
|
|
|
36
36
|
|
|
37
37
|
## ZIP import and SkillRoot publication
|
|
38
38
|
|
|
39
|
+
Version 0.3.1 fixes Skill search continuation: pass the returned `nextCursor` unchanged as
|
|
40
|
+
`--cursor`. Search uses the server rules; the CLI does not implement a matching algorithm.
|
|
41
|
+
Older clients receive an upgrade message from the Skill search API.
|
|
42
|
+
|
|
39
43
|
Version 0.3.0 upgrades Skill publication and encrypted delivery together. Upgrade with
|
|
40
|
-
`pnpm add -g @finchtech/cli@0.3.
|
|
44
|
+
`pnpm add -g @finchtech/cli@0.3.1` and verify `finch --version` before publishing new Skills
|
|
41
45
|
or downloading encrypted Skills from the upgraded gateway. Older CLI versions cannot use
|
|
42
46
|
the new encrypted delivery, including for historical Skills; 0.3.0 retains historical package support.
|
|
43
47
|
|
|
@@ -57,3 +61,7 @@ SkillRoot exactly as supplied, matching Browser publication metadata; omission m
|
|
|
57
61
|
Equal public file bytes, paths, name, summary, version and history produce equal roots. Encrypted
|
|
58
62
|
publications use random keys/IVs and need not produce the same root. Updates send the proposed
|
|
59
63
|
manifest for server validation; URI intents are prepared after the new chain binding is confirmed.
|
|
64
|
+
|
|
65
|
+
Finch-managed publication key requests use a signed timestamp and a one-time nonce. Each request is
|
|
66
|
+
valid for five minutes; retrying after expiry or a lost response requires a fresh signature. The
|
|
67
|
+
gateway rejects older CLI publication requests without timestamps. Historical downloads are unchanged.
|
package/dist/finch.js
CHANGED
|
@@ -6675,6 +6675,17 @@ var init_crypto = __esm({
|
|
|
6675
6675
|
});
|
|
6676
6676
|
|
|
6677
6677
|
// ../../packages/skill-content/src/delivery-message.ts
|
|
6678
|
+
function parsePublicationNonce(nonce) {
|
|
6679
|
+
const match = /^publication:([1-9][0-9]{0,15}):([A-Za-z0-9_-]{1,128})$/u.exec(nonce);
|
|
6680
|
+
if (!match) return null;
|
|
6681
|
+
const timestamp = Number(match[1]);
|
|
6682
|
+
return Number.isSafeInteger(timestamp) ? timestamp : null;
|
|
6683
|
+
}
|
|
6684
|
+
function buildPublicationNonce(random, timestamp = Date.now()) {
|
|
6685
|
+
const nonce = `publication:${timestamp}:${random}`;
|
|
6686
|
+
if (parsePublicationNonce(nonce) === null) throw new Error("Invalid publication nonce.");
|
|
6687
|
+
return nonce;
|
|
6688
|
+
}
|
|
6678
6689
|
function buildKeyRequestMessage(ref, wallet, nonce) {
|
|
6679
6690
|
return [PREAMBLE, `chain: ${ref.chainId}`, `skill: ${ref.skillId}`, `version: ${ref.version}`, `wallet: ${wallet.toLowerCase()}`, `nonce: ${nonce}`].join("\n");
|
|
6680
6691
|
}
|
|
@@ -15109,7 +15120,7 @@ var init_testnet_purchase_v1 = __esm({
|
|
|
15109
15120
|
});
|
|
15110
15121
|
|
|
15111
15122
|
// ../../packages/agent-market-contracts/src/v1/public-catalog.ts
|
|
15112
|
-
var publicCatalogCursorSchema, PUBLIC_BUYER_SERVICE_FIELDS, publicAgentAvailabilitySchema, publicAgentSlowmistAuditStatusValues, publicAgentSlowmistAuditReportSchema, publicSummaryProperties, publicBuyerServiceSchema, canonicalInvocationSchemaDocument, canonicalArtifactDocument, canonicalJsonTextSchema, artifactContractPreimageSchema, publicDocumentProperties, publicAgentOnOfferSchema, publicAgentOnDetailSchema, publicDirectDetailSchema, publicCatalogDetailResponseSchema, publicCatalogListRequestSchema, publicCatalogListResponseSchema, publicCatalogSearchRequestSchema, publicCatalogSearchResponseSchema, PUBLIC_CATALOG_MCP_ANY_OF_SCOPES, PUBLIC_CATALOG_SEARCH_CONTRACT, PUBLIC_CATALOG_CANONICAL_DOCS;
|
|
15123
|
+
var publicCatalogCursorSchema, PUBLIC_BUYER_SERVICE_FIELDS, publicAgentAvailabilitySchema, publicAgentSlowmistAuditStatusValues, publicAgentSlowmistAuditReportSchema, publicSummaryProperties, publicBuyerServiceSchema, canonicalInvocationSchemaDocument, canonicalArtifactDocument, canonicalJsonTextSchema, artifactContractPreimageSchema, publicDocumentProperties, publicAgentOnOfferSchema, publicAgentOnDetailSchema, publicDirectDetailSchema, publicCatalogDetailResponseSchema, publicCatalogListRequestSchema, publicCatalogListResponseSchema, publicCatalogSearchCursorSchema, publicCatalogSearchRequestSchema, publicCatalogSearchResponseSchema, PUBLIC_CATALOG_MCP_ANY_OF_SCOPES, PUBLIC_CATALOG_SEARCH_CONTRACT, PUBLIC_CATALOG_CANONICAL_DOCS;
|
|
15113
15124
|
var init_public_catalog = __esm({
|
|
15114
15125
|
"../../packages/agent-market-contracts/src/v1/public-catalog.ts"() {
|
|
15115
15126
|
"use strict";
|
|
@@ -15259,6 +15270,7 @@ var init_public_catalog = __esm({
|
|
|
15259
15270
|
services: { type: "array", maxItems: 100, items: publicBuyerServiceSchema },
|
|
15260
15271
|
nextCursor: { anyOf: [publicCatalogCursorSchema, { type: "null" }] }
|
|
15261
15272
|
});
|
|
15273
|
+
publicCatalogSearchCursorSchema = { type: "string", minLength: 1, maxLength: 512, pattern: "^[A-Za-z0-9_-]+$" };
|
|
15262
15274
|
publicCatalogSearchRequestSchema = strictObjectSchema({
|
|
15263
15275
|
query: {
|
|
15264
15276
|
type: "string",
|
|
@@ -15266,13 +15278,17 @@ var init_public_catalog = __esm({
|
|
|
15266
15278
|
maxLength: 200,
|
|
15267
15279
|
"x-finch-normalization": "NFC",
|
|
15268
15280
|
"x-finch-max-utf8-bytes": 200,
|
|
15269
|
-
"x-finch-case-sensitive":
|
|
15270
|
-
"x-finch-matching": "
|
|
15281
|
+
"x-finch-case-sensitive": false,
|
|
15282
|
+
"x-finch-matching": "all_words_substring_and_name_typo"
|
|
15271
15283
|
},
|
|
15272
|
-
cursor:
|
|
15284
|
+
cursor: publicCatalogSearchCursorSchema,
|
|
15273
15285
|
limit: { type: "integer", minimum: 1, maximum: 100 }
|
|
15274
15286
|
}, ["query"]);
|
|
15275
|
-
publicCatalogSearchResponseSchema =
|
|
15287
|
+
publicCatalogSearchResponseSchema = strictObjectSchema({
|
|
15288
|
+
services: { type: "array", maxItems: 100, items: publicBuyerServiceSchema },
|
|
15289
|
+
totalCount: { type: "integer", minimum: 0 },
|
|
15290
|
+
nextCursor: { anyOf: [publicCatalogSearchCursorSchema, { type: "null" }] }
|
|
15291
|
+
});
|
|
15276
15292
|
PUBLIC_CATALOG_MCP_ANY_OF_SCOPES = Object.freeze([
|
|
15277
15293
|
"agent_market:discover",
|
|
15278
15294
|
"agent_market:buyer:read"
|
|
@@ -15280,9 +15296,12 @@ var init_public_catalog = __esm({
|
|
|
15280
15296
|
PUBLIC_CATALOG_SEARCH_CONTRACT = Object.freeze({
|
|
15281
15297
|
normalization: "NFC",
|
|
15282
15298
|
maxUtf8Bytes: 200,
|
|
15283
|
-
|
|
15284
|
-
|
|
15285
|
-
|
|
15299
|
+
cursor: "opaque_filter_bound_v2",
|
|
15300
|
+
widthFolding: "fullwidth_ascii",
|
|
15301
|
+
separators: "whitespace_hyphen_underscore",
|
|
15302
|
+
caseSensitive: false,
|
|
15303
|
+
matching: "all_words_substring_and_name_typo",
|
|
15304
|
+
fields: Object.freeze(["displayName", "slug", "description", "integrationFamily", "seller"])
|
|
15286
15305
|
});
|
|
15287
15306
|
PUBLIC_CATALOG_CANONICAL_DOCS = Object.freeze({
|
|
15288
15307
|
visibility: "active_publications_only",
|
|
@@ -16753,7 +16772,7 @@ var init_schemas = __esm({
|
|
|
16753
16772
|
taskListRequestSchema = strictObjectSchema2({
|
|
16754
16773
|
q: { type: "string", maxLength: 200 },
|
|
16755
16774
|
section: { type: "string", enum: ["active", "ended"] },
|
|
16756
|
-
sort: { type: "string", enum: ["latest", "hot", "top"] },
|
|
16775
|
+
sort: { type: "string", enum: ["latest", "hot", "top", "relevance"] },
|
|
16757
16776
|
taskStatus: { type: "string", enum: ["all", "active", "upcoming", "ended"] },
|
|
16758
16777
|
participationModel: { type: "string", enum: ["competition", "collaborative"] },
|
|
16759
16778
|
page: positiveInteger,
|
|
@@ -32914,6 +32933,22 @@ var init_chains = __esm({
|
|
|
32914
32933
|
}
|
|
32915
32934
|
});
|
|
32916
32935
|
|
|
32936
|
+
// ../../packages/deployment-manifest/src/platform/web-analytics.json
|
|
32937
|
+
var web_analytics_default;
|
|
32938
|
+
var init_web_analytics = __esm({
|
|
32939
|
+
"../../packages/deployment-manifest/src/platform/web-analytics.json"() {
|
|
32940
|
+
web_analytics_default = {
|
|
32941
|
+
schemaVersion: 1,
|
|
32942
|
+
kind: "web_analytics",
|
|
32943
|
+
environments: {
|
|
32944
|
+
local: { measurementId: null },
|
|
32945
|
+
test: { measurementId: null },
|
|
32946
|
+
production: { measurementId: "G-ZZJYKRBJEY" }
|
|
32947
|
+
}
|
|
32948
|
+
};
|
|
32949
|
+
}
|
|
32950
|
+
});
|
|
32951
|
+
|
|
32917
32952
|
// ../../packages/deployment-manifest/src/platform/web-localization.json
|
|
32918
32953
|
var web_localization_default;
|
|
32919
32954
|
var init_web_localization = __esm({
|
|
@@ -33208,11 +33243,12 @@ function getSkillDeliveryDeploymentByChainId(chainId) {
|
|
|
33208
33243
|
if (!environment3) throw new DeploymentManifestError(`Skill delivery has no reviewed binding for chain ${chainId}.`);
|
|
33209
33244
|
return getSkillDeliveryDeployment(environment3, chainId);
|
|
33210
33245
|
}
|
|
33211
|
-
var internalAppSchema, internalAppsEnvironmentSchema, internalAppsManifestSchema, disabledServiceSchema, taskPlatformManifestSchema, skillDeliveryBindingSchema, skillDeliveryEnvironmentSchema, skillDeliveryManifestSchema, internalAppsManifest, taskPlatformManifest, skillDeliveryManifest, webLocalizationPolicySchema, webLocalizationManifest;
|
|
33246
|
+
var internalAppSchema, internalAppsEnvironmentSchema, internalAppsManifestSchema, disabledServiceSchema, taskPlatformManifestSchema, skillDeliveryBindingSchema, skillDeliveryEnvironmentSchema, skillDeliveryManifestSchema, internalAppsManifest, taskPlatformManifest, skillDeliveryManifest, webLocalizationPolicySchema, webLocalizationManifest, webAnalyticsPolicySchema, webAnalyticsManifest;
|
|
33212
33247
|
var init_platform = __esm({
|
|
33213
33248
|
"../../packages/deployment-manifest/src/platform/index.ts"() {
|
|
33214
33249
|
"use strict";
|
|
33215
33250
|
init_zod();
|
|
33251
|
+
init_web_analytics();
|
|
33216
33252
|
init_web_localization();
|
|
33217
33253
|
init_chains();
|
|
33218
33254
|
init_shared();
|
|
@@ -33326,6 +33362,18 @@ var init_platform = __esm({
|
|
|
33326
33362
|
kind: external_exports.literal("web_localization"),
|
|
33327
33363
|
environments: external_exports.strictObject({ local: webLocalizationPolicySchema, test: webLocalizationPolicySchema, production: webLocalizationPolicySchema })
|
|
33328
33364
|
}).parse(web_localization_default);
|
|
33365
|
+
webAnalyticsPolicySchema = external_exports.strictObject({
|
|
33366
|
+
measurementId: external_exports.string().regex(/^G-[A-Z0-9]+$/u).nullable()
|
|
33367
|
+
});
|
|
33368
|
+
webAnalyticsManifest = external_exports.strictObject({
|
|
33369
|
+
schemaVersion: external_exports.literal(1),
|
|
33370
|
+
kind: external_exports.literal("web_analytics"),
|
|
33371
|
+
environments: external_exports.strictObject({
|
|
33372
|
+
local: webAnalyticsPolicySchema,
|
|
33373
|
+
test: webAnalyticsPolicySchema,
|
|
33374
|
+
production: webAnalyticsPolicySchema
|
|
33375
|
+
})
|
|
33376
|
+
}).parse(web_analytics_default);
|
|
33329
33377
|
}
|
|
33330
33378
|
});
|
|
33331
33379
|
|
|
@@ -54331,6 +54379,7 @@ var init_api2 = __esm({
|
|
|
54331
54379
|
}
|
|
54332
54380
|
async request(options) {
|
|
54333
54381
|
const headers = new Headers(options.headers);
|
|
54382
|
+
if (options.path.split("?")[0] === "/api/v1/skill-market/skills") headers.set("X-Finch-Search-Version", "2");
|
|
54334
54383
|
if (options.bearer !== void 0) headers.set("authorization", `Bearer ${options.bearer}`);
|
|
54335
54384
|
if (options.idempotencyKey !== void 0) headers.set("idempotency-key", options.idempotencyKey);
|
|
54336
54385
|
let body;
|
|
@@ -56044,7 +56093,7 @@ var init_skill_local_flow = __esm({
|
|
|
56044
56093
|
return required2(this.api.fetchSkillStoredContent, "Skill content relay").call(this.api, uri, bearer);
|
|
56045
56094
|
}
|
|
56046
56095
|
async contentKey(context, chainId, skillId, version6) {
|
|
56047
|
-
const message = buildKeyRequestMessage({ chainId, skillId: BigInt(skillId), version: version6 }, context.walletAddress,
|
|
56096
|
+
const message = buildKeyRequestMessage({ chainId, skillId: BigInt(skillId), version: version6 }, context.walletAddress, buildPublicationNonce(this.nonce()));
|
|
56048
56097
|
const signature = await this.signer.signMessage({ privateKey: context.privateKey, message });
|
|
56049
56098
|
const result2 = await required2(this.api.requestSkillContentKey, "Skill content-key request").call(this.api, {
|
|
56050
56099
|
chainId,
|
|
@@ -58435,7 +58484,7 @@ var init_package = __esm({
|
|
|
58435
58484
|
"package.json"() {
|
|
58436
58485
|
package_default = {
|
|
58437
58486
|
name: "@finchtech/cli",
|
|
58438
|
-
version: "0.3.
|
|
58487
|
+
version: "0.3.1",
|
|
58439
58488
|
description: "Finch Agent CLI for wallet-owned marketplace and MCP workflows.",
|
|
58440
58489
|
type: "module",
|
|
58441
58490
|
bin: {
|
|
@@ -58902,8 +58951,8 @@ async function routeCommand(arguments_, application) {
|
|
|
58902
58951
|
query.limit = Number(options["--limit"]);
|
|
58903
58952
|
}
|
|
58904
58953
|
if (options["--cursor"] !== void 0) {
|
|
58905
|
-
if (!/^
|
|
58906
|
-
throw new TypeError("--cursor must be
|
|
58954
|
+
if (!/^[A-Za-z0-9_-]{1,512}$/u.test(options["--cursor"])) {
|
|
58955
|
+
throw new TypeError("--cursor must be the opaque nextCursor returned by search.");
|
|
58907
58956
|
}
|
|
58908
58957
|
query.cursor = options["--cursor"];
|
|
58909
58958
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finchtech/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Finch Agent CLI for wallet-owned marketplace and MCP workflows.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"typescript-eslint": "8.67.0",
|
|
35
35
|
"viem": "2.55.15",
|
|
36
36
|
"vitest": "4.1.10",
|
|
37
|
-
"@finch/deployment-manifest": "0.1.0",
|
|
38
|
-
"@finch/task-market-contracts": "0.1.0",
|
|
39
|
-
"@finch/skill-content": "0.1.0",
|
|
40
37
|
"@finch/agent-market-contracts": "0.1.0",
|
|
41
|
-
"@finch/skill-
|
|
38
|
+
"@finch/skill-content": "0.1.0",
|
|
39
|
+
"@finch/deployment-manifest": "0.1.0",
|
|
40
|
+
"@finch/skill-market-contracts": "0.1.0",
|
|
41
|
+
"@finch/task-market-contracts": "0.1.0"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "esbuild src/bootstrap.ts --bundle --platform=node --format=esm --target=node20 --outfile=dist/finch.js --banner:js=\"#!/usr/bin/env node\"",
|