@finchtech/cli 0.3.5 → 0.3.6

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.
Files changed (3) hide show
  1. package/README.md +5 -1
  2. package/dist/finch.js +126 -37
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -55,7 +55,7 @@ Version 0.3.1 fixes Skill search continuation: pass the returned `nextCursor` un
55
55
  Older clients receive an upgrade message from the Skill search API.
56
56
 
57
57
  Version 0.3.0 upgrades Skill publication and encrypted delivery together. Upgrade with
58
- `pnpm add -g @finchtech/cli@0.3.5` and verify `finch --version` before publishing new Skills
58
+ `pnpm add -g @finchtech/cli@0.3.6` and verify `finch --version` before publishing new Skills
59
59
  or downloading encrypted Skills from the upgraded gateway. Older CLI versions cannot use
60
60
  the new encrypted delivery, including for historical Skills; 0.3.0 retains historical package support.
61
61
 
@@ -122,3 +122,7 @@ First-wallet offline import, installed Account-switch revocation, partial doctor
122
122
  ## WebP image detection (CLI 0.3.5+)
123
123
 
124
124
  CLI 0.3.5 fixes valid WebP covers and packaged detail images being rejected when binary file-size bytes were decoded as UTF-8. Upgrade the installed CLI to receive the local detection fix; website or Skill updates alone do not update the executable. Image types, size limits, and publication recovery rules are unchanged.
125
+
126
+ ## Market category compatibility (CLI 0.3.6+)
127
+
128
+ Use CLI 0.3.6 or newer for the expanded market categories. Skill response display categories now accept bounded text, so future taxonomy additions do not require another CLI upgrade. Updating the website or this Skill does not upgrade an installed CLI.
package/dist/finch.js CHANGED
@@ -4349,7 +4349,7 @@ var require_core = __commonJS({
4349
4349
  errorsText(errors = this.errors, { separator = ", ", dataVar = "data" } = {}) {
4350
4350
  if (!errors || errors.length === 0)
4351
4351
  return "No errors";
4352
- return errors.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((text2, msg) => text2 + separator + msg);
4352
+ return errors.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((text3, msg) => text3 + separator + msg);
4353
4353
  }
4354
4354
  $dataMetaSchema(metaSchema, keywordsJsonPointers) {
4355
4355
  const rules = this.RULES.all;
@@ -9579,7 +9579,7 @@ function baseX({ name, prefix, alphabet, caseInsensitive = false }) {
9579
9579
  prefix,
9580
9580
  name,
9581
9581
  encode: encode10,
9582
- decode: (text2) => coerce(decode10(text2))
9582
+ decode: (text3) => coerce(decode10(text3))
9583
9583
  });
9584
9584
  }
9585
9585
  function decode2(string5, alphabetIdx, bitsPerChar, name) {
@@ -9699,12 +9699,12 @@ var init_base = __esm({
9699
9699
  this.prefixCodePoint = prefixCodePoint;
9700
9700
  this.baseDecode = baseDecode;
9701
9701
  }
9702
- decode(text2) {
9703
- if (typeof text2 === "string") {
9704
- if (text2.codePointAt(0) !== this.prefixCodePoint) {
9705
- throw Error(`Unable to decode multibase string ${JSON.stringify(text2)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);
9702
+ decode(text3) {
9703
+ if (typeof text3 === "string") {
9704
+ if (text3.codePointAt(0) !== this.prefixCodePoint) {
9705
+ throw Error(`Unable to decode multibase string ${JSON.stringify(text3)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);
9706
9706
  }
9707
- return this.baseDecode(text2.slice(this.prefix.length));
9707
+ return this.baseDecode(text3.slice(this.prefix.length));
9708
9708
  } else {
9709
9709
  throw Error("Can only multibase decode strings");
9710
9710
  }
@@ -14667,19 +14667,35 @@ var init_display = __esm({
14667
14667
  "U+3000",
14668
14668
  "U+FEFF",
14669
14669
  "U+D800..U+DFFF"
14670
+ ]),
14671
+ descriptionForbiddenCodePoints: Object.freeze([
14672
+ "U+0000..U+0009",
14673
+ "U+000B..U+000C",
14674
+ "U+000E..U+001F",
14675
+ "U+007F..U+009F",
14676
+ "U+00A0",
14677
+ "U+1680",
14678
+ "U+2000..U+200A",
14679
+ "U+2028",
14680
+ "U+2029",
14681
+ "U+202F",
14682
+ "U+205F",
14683
+ "U+3000",
14684
+ "U+FEFF",
14685
+ "U+D800..U+DFFF"
14670
14686
  ])
14671
14687
  });
14672
- displayTextSchema = (minBytes, maxBytes) => Object.freeze({
14688
+ displayTextSchema = (minBytes, maxBytes, allowStandardLineBreaks = false) => Object.freeze({
14673
14689
  type: "string",
14674
14690
  description: `NFC display text containing ${minBytes}..${maxBytes} UTF-8 bytes and no forbidden code points.`,
14675
14691
  "x-finch-nfc": true,
14676
14692
  "x-finch-min-utf8-bytes": minBytes,
14677
14693
  "x-finch-max-utf8-bytes": maxBytes,
14678
14694
  "x-finch-no-edge-ascii-space": true,
14679
- "x-finch-forbidden-code-points": DISPLAY_TEXT_CODEC_CONTRACT.forbiddenCodePoints
14695
+ "x-finch-forbidden-code-points": allowStandardLineBreaks ? DISPLAY_TEXT_CODEC_CONTRACT.descriptionForbiddenCodePoints : DISPLAY_TEXT_CODEC_CONTRACT.forbiddenCodePoints
14680
14696
  });
14681
14697
  agentMarketDisplayNameSchema = displayTextSchema(1, 120);
14682
- agentMarketDescriptionSchema = displayTextSchema(0, 2e3);
14698
+ agentMarketDescriptionSchema = displayTextSchema(0, 2e3, true);
14683
14699
  agentMarketSupportContactSchema = displayTextSchema(1, 500);
14684
14700
  agentMarketRevisionDisplaySchema = strictObjectSchema({
14685
14701
  displayName: agentMarketDisplayNameSchema,
@@ -15122,6 +15138,52 @@ var init_identity = __esm({
15122
15138
  }
15123
15139
  });
15124
15140
 
15141
+ // ../../packages/agent-market-contracts/src/v1/localization.ts
15142
+ var text2, listingInputRequestSchema, saveListingRequestSchema, listingSaveResponseSchema;
15143
+ var init_localization = __esm({
15144
+ "../../packages/agent-market-contracts/src/v1/localization.ts"() {
15145
+ "use strict";
15146
+ init_common2();
15147
+ init_display();
15148
+ text2 = strictObjectSchema({
15149
+ name: { type: "string", minLength: 1, maxLength: 120 },
15150
+ description: { type: "string", maxLength: 5e3 },
15151
+ deliverable: { type: "string", maxLength: 2e3 },
15152
+ serviceBoundary: { type: "string", maxLength: 2e3 }
15153
+ }, ["name", "description"]);
15154
+ listingInputRequestSchema = strictObjectSchema({
15155
+ inputLocales: {
15156
+ type: "array",
15157
+ minItems: 1,
15158
+ maxItems: 3,
15159
+ uniqueItems: true,
15160
+ items: { enum: ["en", "zh", "zh-TW"] },
15161
+ description: "Explicit authored languages. One queues the other two; multiple languages disable automatic translation."
15162
+ },
15163
+ translations: strictObjectSchema({ en: text2, zh: text2, "zh-TW": text2 }, [])
15164
+ });
15165
+ saveListingRequestSchema = strictObjectSchema({
15166
+ versionRevision: positiveRevisionSchema,
15167
+ integrationFamily: { enum: ["agenton_v2", "direct_api_v1"] },
15168
+ displayName: agentMarketDisplayNameSchema,
15169
+ description: agentMarketDescriptionSchema,
15170
+ supportContact: { type: "string", minLength: 3, maxLength: 320 },
15171
+ avatarUri: { type: "string", maxLength: 2048 },
15172
+ avatarMediaType: { enum: [null, "image/jpeg", "image/png", "image/webp", "video/mp4", "video/webm"] },
15173
+ category: { type: "string", maxLength: 80 },
15174
+ tags: { type: "array", maxItems: 16, items: { type: "string", minLength: 1, maxLength: 80 } },
15175
+ deliverable: { type: "string", maxLength: 1e3 },
15176
+ serviceBoundary: { type: "string", maxLength: 1e3 },
15177
+ localization: listingInputRequestSchema
15178
+ }, ["versionRevision", "integrationFamily", "displayName", "description", "supportContact", "avatarUri", "avatarMediaType", "category", "tags", "deliverable", "serviceBoundary"]);
15179
+ listingSaveResponseSchema = strictObjectSchema({
15180
+ serviceVersionId: { type: "string", format: "uuid" },
15181
+ versionRevision: positiveRevisionSchema,
15182
+ presentationRevision: positiveRevisionSchema
15183
+ });
15184
+ }
15185
+ });
15186
+
15125
15187
  // ../../packages/agent-market-contracts/src/v1/merchant.ts
15126
15188
  function signedStatusVariants(kind, denialCode, executionFailureCode, successResult, extra = {}) {
15127
15189
  const base3 = (status) => ({ ...signedBase(kind, status), ...extra });
@@ -15141,6 +15203,7 @@ var init_merchant = __esm({
15141
15203
  "../../packages/agent-market-contracts/src/v1/merchant.ts"() {
15142
15204
  "use strict";
15143
15205
  init_common2();
15206
+ init_localization();
15144
15207
  init_validation_input();
15145
15208
  init_display();
15146
15209
  init_actions();
@@ -15216,8 +15279,9 @@ var init_merchant = __esm({
15216
15279
  displayName: agentMarketDisplayNameSchema,
15217
15280
  description: agentMarketDescriptionSchema,
15218
15281
  supportContact: agentMarketSupportContactSchema,
15219
- avatarUri: nullableIpfsUriSchema
15220
- });
15282
+ avatarUri: nullableIpfsUriSchema,
15283
+ localization: listingInputRequestSchema
15284
+ }, ["integrationFamily", "displayName", "description", "supportContact", "avatarUri"]);
15221
15285
  agentResponseSchema = strictObjectSchema({
15222
15286
  agentId: canonicalUuidSchema,
15223
15287
  supportContact: agentMarketSupportContactSchema,
@@ -15305,8 +15369,9 @@ var init_merchant = __esm({
15305
15369
  createAdditionalVersionRequestSchema = strictObjectSchema({
15306
15370
  integrationFamily: { type: "string", enum: integrationFamilyValues },
15307
15371
  displayName: agentMarketDisplayNameSchema,
15308
- description: agentMarketDescriptionSchema
15309
- });
15372
+ description: agentMarketDescriptionSchema,
15373
+ localization: listingInputRequestSchema
15374
+ }, ["integrationFamily", "displayName", "description"]);
15310
15375
  beginVersionDraftRequestSchema = emptyStrictObjectSchema;
15311
15376
  beginVersionDraftResponseSchema = strictObjectSchema({
15312
15377
  serviceVersionId: canonicalUuidSchema,
@@ -15393,7 +15458,7 @@ var init_merchant = __esm({
15393
15458
  artifactContract: artifactBatchContractSchema,
15394
15459
  validationInput: validationInputSchema
15395
15460
  };
15396
- createOfferRequestSchema = strictObjectSchema(offerConfigurationProperties);
15461
+ createOfferRequestSchema = strictObjectSchema({ ...offerConfigurationProperties, localization: listingInputRequestSchema }, Object.keys(offerConfigurationProperties));
15397
15462
  replaceOfferRequestSchema = createOfferRequestSchema;
15398
15463
  offerResponseSchema = strictObjectSchema({
15399
15464
  offerId: canonicalUuidSchema,
@@ -16013,6 +16078,7 @@ var families, AGENT_MARKET_V1_OPERATIONS, CLI_IDEMPOTENCY_RETRY_CONTRACT, REQUES
16013
16078
  var init_operations = __esm({
16014
16079
  "../../packages/agent-market-contracts/src/v1/operations.ts"() {
16015
16080
  "use strict";
16081
+ init_localization();
16016
16082
  init_artifacts();
16017
16083
  init_agent_cli();
16018
16084
  init_buyer();
@@ -16128,6 +16194,19 @@ var init_operations = __esm({
16128
16194
  sessionWrites: false,
16129
16195
  writes: true
16130
16196
  }),
16197
+ "merchant_listings.replace": operation({
16198
+ id: "merchant_listings.replace",
16199
+ requiredScope: "agent_market:merchant:write",
16200
+ http: http("put", "/api/v1/agent-market/merchant/versions/{versionId}/listing", 200, {
16201
+ requestSchema: saveListingRequestSchema,
16202
+ responseSchema: listingSaveResponseSchema,
16203
+ idempotencyRequired: true
16204
+ }),
16205
+ mcp: { name: "agent_market_merchant_listing_replace" },
16206
+ cli: null,
16207
+ integrationFamilies: families.active,
16208
+ writes: true
16209
+ }),
16131
16210
  "merchant_versions.get": operation({
16132
16211
  id: "merchant_versions.get",
16133
16212
  requiredScope: "agent_market:merchant:read",
@@ -17351,6 +17430,7 @@ var init_v1 = __esm({
17351
17430
  init_snapshot();
17352
17431
  init_testnet_purchase_v1();
17353
17432
  init_validation_input();
17433
+ init_localization();
17354
17434
  }
17355
17435
  });
17356
17436
 
@@ -24920,8 +25000,8 @@ var capitalizeFirstCharacter, error28;
24920
25000
  var init_lt = __esm({
24921
25001
  "../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/lt.js"() {
24922
25002
  init_util();
24923
- capitalizeFirstCharacter = (text2) => {
24924
- return text2.charAt(0).toUpperCase() + text2.slice(1);
25003
+ capitalizeFirstCharacter = (text3) => {
25004
+ return text3.charAt(0).toUpperCase() + text3.slice(1);
24925
25005
  };
24926
25006
  error28 = () => {
24927
25007
  const Sizable = {
@@ -32995,7 +33075,8 @@ var init_skill_protocol = __esm({
32995
33075
  defaultRpcUrls: [
32996
33076
  "https://mainnet.base.org"
32997
33077
  ],
32998
- maxLogBlockRange: 2e3
33078
+ maxLogBlockRange: 2e3,
33079
+ maxConcurrentRequests: 3
32999
33080
  },
33000
33081
  sourceRepository: "FinchipAI/finchip-protocol",
33001
33082
  sourceCommit: "89e54d6ff46dbfba61122e90c5e77f409f02fe5e",
@@ -33282,7 +33363,8 @@ function getSkillProtocolDeployment(environment3, chainId) {
33282
33363
  factoryDeploymentBlock: value.deployment.factoryFirstBlock,
33283
33364
  confirmations: value.deployment.confirmations,
33284
33365
  defaultRpcUrls: Object.freeze([...value.network.defaultRpcUrls]),
33285
- maxLogBlockRange: value.network.maxLogBlockRange ?? DEFAULT_LOG_BLOCK_RANGE
33366
+ maxLogBlockRange: value.network.maxLogBlockRange ?? DEFAULT_LOG_BLOCK_RANGE,
33367
+ maxConcurrentRequests: value.network.maxConcurrentRequests ?? DEFAULT_CONCURRENT_REQUESTS
33286
33368
  });
33287
33369
  }
33288
33370
  function getSkillProtocolDeploymentByChainId(chainId) {
@@ -33293,7 +33375,7 @@ function getSkillProtocolDeploymentByChainId(chainId) {
33293
33375
  function getAllSkillProtocolChainIds() {
33294
33376
  return Object.freeze(Object.keys(SKILL_CLIENT_DEPLOYMENT_BY_CHAIN).map(Number).sort((left, right) => left - right));
33295
33377
  }
33296
- var canonicalAddressSchema, hashSchema, commitSchema, positiveDecimalSchema, DEFAULT_LOG_BLOCK_RANGE, networkSchema, publicRpcUrlsSchema, legacySkillIndexerChainSchema, legacySkillIndexerRegistrySchema, sourceSchema, disabledDeploymentSchema, deploymentsShape, agentActiveSchema, taskActiveSchema, skillActiveSchema, agentRegistrySchema, taskRegistrySchema, skillEnvironmentSchema, skillRegistrySchema, registrySchema, agentRegistry, taskRegistry, skillRegistry, legacySkillIndexerRegistry, AGENT_CLIENT_DEPLOYMENT_BY_CHAIN, TASK_CLIENT_DEPLOYMENT_BY_CHAIN, SKILL_CLIENT_DEPLOYMENT_BY_CHAIN;
33378
+ var canonicalAddressSchema, hashSchema, commitSchema, positiveDecimalSchema, DEFAULT_LOG_BLOCK_RANGE, DEFAULT_CONCURRENT_REQUESTS, networkSchema, publicRpcUrlsSchema, legacySkillIndexerChainSchema, legacySkillIndexerRegistrySchema, sourceSchema, disabledDeploymentSchema, deploymentsShape, agentActiveSchema, taskActiveSchema, skillActiveSchema, agentRegistrySchema, taskRegistrySchema, skillEnvironmentSchema, skillRegistrySchema, registrySchema, agentRegistry, taskRegistry, skillRegistry, legacySkillIndexerRegistry, AGENT_CLIENT_DEPLOYMENT_BY_CHAIN, TASK_CLIENT_DEPLOYMENT_BY_CHAIN, SKILL_CLIENT_DEPLOYMENT_BY_CHAIN;
33297
33379
  var init_chains = __esm({
33298
33380
  "../../packages/deployment-manifest/src/chains/index.ts"() {
33299
33381
  "use strict";
@@ -33309,13 +33391,24 @@ var init_chains = __esm({
33309
33391
  commitSchema = external_exports.string().regex(/^[0-9a-f]{40}$/u);
33310
33392
  positiveDecimalSchema = external_exports.string().regex(/^[1-9][0-9]*$/u);
33311
33393
  DEFAULT_LOG_BLOCK_RANGE = 9999;
33394
+ DEFAULT_CONCURRENT_REQUESTS = 12;
33312
33395
  networkSchema = external_exports.strictObject({
33313
33396
  chainId: external_exports.number().int().positive(),
33314
33397
  name: external_exports.string().min(1).max(100),
33315
33398
  explorerUrl: external_exports.url().refine((value) => new URL(value).protocol === "https:"),
33316
33399
  defaultRpcUrls: external_exports.array(external_exports.url().refine((value) => new URL(value).protocol === "https:")).min(1).max(4),
33317
33400
  /** Omit where every listed endpoint serves the default window. */
33318
- maxLogBlockRange: external_exports.number().int().min(1).max(DEFAULT_LOG_BLOCK_RANGE).optional()
33401
+ maxLogBlockRange: external_exports.number().int().min(1).max(DEFAULT_LOG_BLOCK_RANGE).optional(),
33402
+ /**
33403
+ * Shared by scheduled and receipt readers for this environment/chain within one process.
33404
+ * Omit where every listed endpoint serves the default number of concurrent requests.
33405
+ *
33406
+ * Narrow it for an endpoint that meters compute rather than requests: Base answers four
33407
+ * concurrent `eth_call`s and refuses most of eight with `-32016 over rate limit`, while serving
33408
+ * twelve concurrent balance reads without complaint. The number that matters is the one measured
33409
+ * with the call the indexer actually makes.
33410
+ */
33411
+ maxConcurrentRequests: external_exports.number().int().min(1).max(DEFAULT_CONCURRENT_REQUESTS).optional()
33319
33412
  });
33320
33413
  publicRpcUrlsSchema = external_exports.array(
33321
33414
  external_exports.url().refine((value) => new URL(value).protocol === "https:")
@@ -34123,21 +34216,18 @@ var init_common4 = __esm({
34123
34216
  }
34124
34217
  });
34125
34218
 
34219
+ // ../../packages/market-categories/src/index.ts
34220
+ var init_src4 = __esm({
34221
+ "../../packages/market-categories/src/index.ts"() {
34222
+ }
34223
+ });
34224
+
34126
34225
  // ../../packages/skill-market-contracts/src/public.ts
34127
- var SKILL_CATEGORIES, SKILL_V3_ENVELOPE_SCHEME, SKILL_V3_LIT_ENVELOPE_SCHEME;
34226
+ var SKILL_V3_ENVELOPE_SCHEME, SKILL_V3_LIT_ENVELOPE_SCHEME;
34128
34227
  var init_public = __esm({
34129
34228
  "../../packages/skill-market-contracts/src/public.ts"() {
34130
34229
  "use strict";
34131
- SKILL_CATEGORIES = [
34132
- "Dev Environment",
34133
- "Documents & Legal",
34134
- "Security Audit",
34135
- "Finance & Tax",
34136
- "Education & Research",
34137
- "Media & Entertainment",
34138
- "Health & Medicine",
34139
- "Other"
34140
- ];
34230
+ init_src4();
34141
34231
  SKILL_V3_ENVELOPE_SCHEME = "FINCHIP_V2";
34142
34232
  SKILL_V3_LIT_ENVELOPE_SCHEME = "LIT_V1";
34143
34233
  }
@@ -34171,7 +34261,6 @@ var init_client = __esm({
34171
34261
  init_platform();
34172
34262
  init_common4();
34173
34263
  init_public();
34174
- init_public();
34175
34264
  SKILL_V3_CHAIN_IDS = getAllSkillProtocolChainIds();
34176
34265
  SKILL_V3_DEPLOYMENTS = Object.freeze(SKILL_V3_CHAIN_IDS.map((chainId) => {
34177
34266
  const deployment = getSkillProtocolDeploymentByChainId(chainId);
@@ -34179,7 +34268,7 @@ var init_client = __esm({
34179
34268
  }));
34180
34269
  versionSchema = { type: "integer", minimum: 1, maximum: 4294967295 };
34181
34270
  chainIdSchema2 = { type: "integer", enum: SKILL_V3_CHAIN_IDS };
34182
- nullableCategorySchema = { type: ["string", "null"], enum: [...SKILL_CATEGORIES, null] };
34271
+ nullableCategorySchema = { type: ["string", "null"], minLength: 1, maxLength: 100 };
34183
34272
  signingAuthoritySchema = strictObjectSchema3({
34184
34273
  accountId: canonicalUuidSchema3,
34185
34274
  walletAddress: addressSchema2,
@@ -57443,8 +57532,8 @@ async function readBoundedJsonFile(path2) {
57443
57532
  if (after.size !== before.size || bytes.byteLength !== before.size) {
57444
57533
  throw new TypeError("Request file changed while it was read.");
57445
57534
  }
57446
- const text2 = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
57447
- return asObject(JSON.parse(text2), "Request file");
57535
+ const text3 = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
57536
+ return asObject(JSON.parse(text3), "Request file");
57448
57537
  } catch (cause) {
57449
57538
  if (cause instanceof TypeError) throw cause;
57450
57539
  throw new TypeError("Request file is invalid.", { cause });
@@ -59057,7 +59146,7 @@ var init_package = __esm({
59057
59146
  "package.json"() {
59058
59147
  package_default = {
59059
59148
  name: "@finchtech/cli",
59060
- version: "0.3.5",
59149
+ version: "0.3.6",
59061
59150
  description: "Finch Agent CLI for wallet-owned marketplace and MCP workflows.",
59062
59151
  type: "module",
59063
59152
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finchtech/cli",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "Finch Agent CLI for wallet-owned marketplace and MCP workflows.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -35,9 +35,9 @@
35
35
  "viem": "2.55.15",
36
36
  "vitest": "4.1.10",
37
37
  "@finch/agent-market-contracts": "0.1.0",
38
+ "@finch/task-market-contracts": "0.1.0",
38
39
  "@finch/skill-content": "0.1.0",
39
40
  "@finch/deployment-manifest": "0.1.0",
40
- "@finch/task-market-contracts": "0.1.0",
41
41
  "@finch/skill-market-contracts": "0.1.0"
42
42
  },
43
43
  "scripts": {