@hasna/skills 0.5.7 → 0.5.9
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 +47 -1
- package/bin/index.js +315 -314
- package/bin/mcp.js +188 -186
- package/bin/migrate.js +4 -2
- package/bin/server.js +144 -123
- package/bin/worker.js +123 -121
- package/dist/admin-contract.js +8 -8
- package/dist/index.js +18 -16
- package/dist/lib/private-publication-recovery.d.ts +2 -1
- package/dist/lib/remote-private-publications.d.ts +2 -1
- package/dist/sdk/amounts.d.ts +5 -0
- package/dist/sdk/governance-store.d.ts +2 -0
- package/dist/sdk/index.d.ts +1 -0
- package/dist/sdk/index.js +404 -167
- package/dist/sdk/operations.d.ts +68 -0
- package/dist/sdk/runs.d.ts +1 -1
- package/dist/sdk/spend.d.ts +5 -2
- package/package.json +4 -2
- package/dist/cli/cli.test-utils.d.ts +0 -43
- package/dist/server/store-fixtures.d.ts +0 -31
package/dist/admin-contract.js
CHANGED
|
@@ -46,7 +46,7 @@ var __export = (target, all) => {
|
|
|
46
46
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
47
47
|
var __require = import.meta.require;
|
|
48
48
|
|
|
49
|
-
//
|
|
49
|
+
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/external.js
|
|
50
50
|
var exports_external = {};
|
|
51
51
|
__export(exports_external, {
|
|
52
52
|
void: () => voidType,
|
|
@@ -158,7 +158,7 @@ __export(exports_external, {
|
|
|
158
158
|
BRAND: () => BRAND
|
|
159
159
|
});
|
|
160
160
|
|
|
161
|
-
//
|
|
161
|
+
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/util.js
|
|
162
162
|
var util;
|
|
163
163
|
(function(util2) {
|
|
164
164
|
util2.assertEqual = (_) => {};
|
|
@@ -289,7 +289,7 @@ var getParsedType = (data) => {
|
|
|
289
289
|
}
|
|
290
290
|
};
|
|
291
291
|
|
|
292
|
-
//
|
|
292
|
+
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/ZodError.js
|
|
293
293
|
var ZodIssueCode = util.arrayToEnum([
|
|
294
294
|
"invalid_type",
|
|
295
295
|
"invalid_literal",
|
|
@@ -408,7 +408,7 @@ ZodError.create = (issues) => {
|
|
|
408
408
|
return error;
|
|
409
409
|
};
|
|
410
410
|
|
|
411
|
-
//
|
|
411
|
+
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/locales/en.js
|
|
412
412
|
var errorMap = (issue, _ctx) => {
|
|
413
413
|
let message;
|
|
414
414
|
switch (issue.code) {
|
|
@@ -511,7 +511,7 @@ var errorMap = (issue, _ctx) => {
|
|
|
511
511
|
};
|
|
512
512
|
var en_default = errorMap;
|
|
513
513
|
|
|
514
|
-
//
|
|
514
|
+
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/errors.js
|
|
515
515
|
var overrideErrorMap = en_default;
|
|
516
516
|
function setErrorMap(map) {
|
|
517
517
|
overrideErrorMap = map;
|
|
@@ -519,7 +519,7 @@ function setErrorMap(map) {
|
|
|
519
519
|
function getErrorMap() {
|
|
520
520
|
return overrideErrorMap;
|
|
521
521
|
}
|
|
522
|
-
//
|
|
522
|
+
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
523
523
|
var makeIssue = (params) => {
|
|
524
524
|
const { data, path, errorMaps, issueData } = params;
|
|
525
525
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -625,14 +625,14 @@ var isAborted = (x) => x.status === "aborted";
|
|
|
625
625
|
var isDirty = (x) => x.status === "dirty";
|
|
626
626
|
var isValid = (x) => x.status === "valid";
|
|
627
627
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
628
|
-
//
|
|
628
|
+
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js
|
|
629
629
|
var errorUtil;
|
|
630
630
|
(function(errorUtil2) {
|
|
631
631
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
632
632
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
633
633
|
})(errorUtil || (errorUtil = {}));
|
|
634
634
|
|
|
635
|
-
//
|
|
635
|
+
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/types.js
|
|
636
636
|
class ParseInputLazyPath {
|
|
637
637
|
constructor(parent, value, path, key) {
|
|
638
638
|
this._cachedPath = [];
|
package/dist/index.js
CHANGED
|
@@ -4726,7 +4726,7 @@ function readIfExists(path) {
|
|
|
4726
4726
|
} catch {}
|
|
4727
4727
|
return null;
|
|
4728
4728
|
}
|
|
4729
|
-
//
|
|
4729
|
+
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/external.js
|
|
4730
4730
|
var exports_external = {};
|
|
4731
4731
|
__export(exports_external, {
|
|
4732
4732
|
void: () => voidType,
|
|
@@ -4838,7 +4838,7 @@ __export(exports_external, {
|
|
|
4838
4838
|
BRAND: () => BRAND
|
|
4839
4839
|
});
|
|
4840
4840
|
|
|
4841
|
-
//
|
|
4841
|
+
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/util.js
|
|
4842
4842
|
var util;
|
|
4843
4843
|
(function(util2) {
|
|
4844
4844
|
util2.assertEqual = (_) => {};
|
|
@@ -4969,7 +4969,7 @@ var getParsedType = (data) => {
|
|
|
4969
4969
|
}
|
|
4970
4970
|
};
|
|
4971
4971
|
|
|
4972
|
-
//
|
|
4972
|
+
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/ZodError.js
|
|
4973
4973
|
var ZodIssueCode = util.arrayToEnum([
|
|
4974
4974
|
"invalid_type",
|
|
4975
4975
|
"invalid_literal",
|
|
@@ -5088,7 +5088,7 @@ ZodError.create = (issues) => {
|
|
|
5088
5088
|
return error;
|
|
5089
5089
|
};
|
|
5090
5090
|
|
|
5091
|
-
//
|
|
5091
|
+
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/locales/en.js
|
|
5092
5092
|
var errorMap = (issue, _ctx) => {
|
|
5093
5093
|
let message;
|
|
5094
5094
|
switch (issue.code) {
|
|
@@ -5191,7 +5191,7 @@ var errorMap = (issue, _ctx) => {
|
|
|
5191
5191
|
};
|
|
5192
5192
|
var en_default = errorMap;
|
|
5193
5193
|
|
|
5194
|
-
//
|
|
5194
|
+
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/errors.js
|
|
5195
5195
|
var overrideErrorMap = en_default;
|
|
5196
5196
|
function setErrorMap(map) {
|
|
5197
5197
|
overrideErrorMap = map;
|
|
@@ -5199,7 +5199,7 @@ function setErrorMap(map) {
|
|
|
5199
5199
|
function getErrorMap() {
|
|
5200
5200
|
return overrideErrorMap;
|
|
5201
5201
|
}
|
|
5202
|
-
//
|
|
5202
|
+
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
5203
5203
|
var makeIssue = (params) => {
|
|
5204
5204
|
const { data, path, errorMaps, issueData } = params;
|
|
5205
5205
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -5305,14 +5305,14 @@ var isAborted = (x) => x.status === "aborted";
|
|
|
5305
5305
|
var isDirty = (x) => x.status === "dirty";
|
|
5306
5306
|
var isValid = (x) => x.status === "valid";
|
|
5307
5307
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
5308
|
-
//
|
|
5308
|
+
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js
|
|
5309
5309
|
var errorUtil;
|
|
5310
5310
|
(function(errorUtil2) {
|
|
5311
5311
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
5312
5312
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
5313
5313
|
})(errorUtil || (errorUtil = {}));
|
|
5314
5314
|
|
|
5315
|
-
//
|
|
5315
|
+
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/types.js
|
|
5316
5316
|
class ParseInputLazyPath {
|
|
5317
5317
|
constructor(parent, value, path, key) {
|
|
5318
5318
|
this._cachedPath = [];
|
|
@@ -8699,7 +8699,7 @@ var coerce = {
|
|
|
8699
8699
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
8700
8700
|
};
|
|
8701
8701
|
var NEVER = INVALID;
|
|
8702
|
-
//
|
|
8702
|
+
// ../contracts/dist/client/transport.js
|
|
8703
8703
|
import { isIP } from "net";
|
|
8704
8704
|
import { spawnSync } from "child_process";
|
|
8705
8705
|
import { closeSync, fstatSync, openSync, readFileSync as readFileSync12 } from "fs";
|
|
@@ -13336,7 +13336,7 @@ import { dirname as dirname7, relative as relative4 } from "path";
|
|
|
13336
13336
|
// package.json
|
|
13337
13337
|
var package_default = {
|
|
13338
13338
|
name: "@hasna/skills",
|
|
13339
|
-
version: "0.5.
|
|
13339
|
+
version: "0.5.9",
|
|
13340
13340
|
description: "Skills library for AI coding agents",
|
|
13341
13341
|
type: "module",
|
|
13342
13342
|
bin: {
|
|
@@ -13376,7 +13376,9 @@ var package_default = {
|
|
|
13376
13376
|
"docs/skill-standard.md",
|
|
13377
13377
|
"schemas/",
|
|
13378
13378
|
"LICENSE",
|
|
13379
|
-
"README.md"
|
|
13379
|
+
"README.md",
|
|
13380
|
+
"!dist/**/*test-utils.d.ts",
|
|
13381
|
+
"!dist/**/*fixtures.d.ts"
|
|
13380
13382
|
],
|
|
13381
13383
|
main: "./dist/index.js",
|
|
13382
13384
|
types: "./dist/index.d.ts",
|
|
@@ -14412,7 +14414,7 @@ var privatePublicationContracts = [
|
|
|
14412
14414
|
].map((operation) => ({
|
|
14413
14415
|
name: operation.name,
|
|
14414
14416
|
title: operation.title,
|
|
14415
|
-
description: "Manage private source publication with fresh workspace verification and durable host-local recovery. Upload consent and current version comparison are explicit;
|
|
14417
|
+
description: "Manage private source publication with fresh workspace verification and durable host-local recovery. Upload consent and current version comparison are explicit; execution requires a separate server quote and approval.",
|
|
14416
14418
|
params: [...Object.keys(publicationVerification), ...Object.keys(operation.extras)],
|
|
14417
14419
|
category: "storage",
|
|
14418
14420
|
sideEffects: "filesystem",
|
|
@@ -14425,7 +14427,7 @@ var privatePublicationContracts = [
|
|
|
14425
14427
|
state: { type: "string" },
|
|
14426
14428
|
versionId: { oneOf: [publicationUuidSchema, { type: "null" }] },
|
|
14427
14429
|
committed: { type: "boolean" },
|
|
14428
|
-
executionEnabled: {
|
|
14430
|
+
executionEnabled: { oneOf: [{ type: "boolean" }, { type: "null" }] },
|
|
14429
14431
|
nextAction: { type: "string" }
|
|
14430
14432
|
}, ["recoveryDirectory", "skillId", "intentId", "state", "versionId", "committed", "executionEnabled", "nextAction"])
|
|
14431
14433
|
}));
|
|
@@ -16119,7 +16121,7 @@ class RemotePrivatePublicationsClient {
|
|
|
16119
16121
|
return bad();
|
|
16120
16122
|
const response = await boundedJson(skillsApiRequestUrl(this.apiOrigin, "/api/v1/capabilities"), {}, this.#token, false, options.timeoutMs, options.signal);
|
|
16121
16123
|
const p = record5(response) && response.privatePublishing;
|
|
16122
|
-
if (!record5(response) || response.contractVersion !== 1 || response.apiVersion !== 1 || !exact(p, ["contractVersion", "enabled", "authentication", "maxArchiveBytes", "uploadMaxTtlSeconds", "executionEnabled"]) || p.contractVersion !== 1 || typeof p.enabled !== "boolean" || p.authentication !== "interactive-session" || p.maxArchiveBytes !== PRIVATE_PUBLICATION_MAX_BYTES || p.uploadMaxTtlSeconds !== 300 || p.executionEnabled !==
|
|
16124
|
+
if (!record5(response) || response.contractVersion !== 1 || response.apiVersion !== 1 || !exact(p, ["contractVersion", "enabled", "authentication", "maxArchiveBytes", "uploadMaxTtlSeconds", "executionEnabled"]) || p.contractVersion !== 1 || typeof p.enabled !== "boolean" || p.authentication !== "interactive-session" || p.maxArchiveBytes !== PRIVATE_PUBLICATION_MAX_BYTES || p.uploadMaxTtlSeconds !== 300 || typeof p.executionEnabled !== "boolean")
|
|
16123
16125
|
throw new PrivatePublicationError("PUBLICATION_CONTRACT_UNAVAILABLE", "This server does not support the hosted private publication contract.");
|
|
16124
16126
|
return Object.freeze({ ...p });
|
|
16125
16127
|
}
|
|
@@ -16642,7 +16644,7 @@ async function preparePrivatePublication(client, sourceDirectory, recoveryDirect
|
|
|
16642
16644
|
}
|
|
16643
16645
|
function privatePublicationResult(directory, receipt) {
|
|
16644
16646
|
const state = receipt.intent?.state ?? receipt.phase, committed = state === "committed";
|
|
16645
|
-
const nextAction = committed ? "
|
|
16647
|
+
const nextAction = committed ? "Published; execution requires a separate server quote and approval." : ["rejected", "cancelled", "expired"].includes(state) ? "This intent is terminal. Inspect the result before explicitly preparing another version." : state === "needs_attention" ? "Keep this intent and contact the service operator; do not create a replacement or upload again." : receipt.phase === "upload_uncertain" ? "Run publication resume with this recovery directory to finalize the same intent without another upload." : receipt.intent ? "Run publication status or resume with this recovery directory; cancel explicitly if you want to stop." : "Run publication resume with this recovery directory to reconcile the identical request key and declaration.";
|
|
16646
16648
|
return {
|
|
16647
16649
|
recoveryDirectory: directory,
|
|
16648
16650
|
skillId: receipt.skillId,
|
|
@@ -16650,7 +16652,7 @@ function privatePublicationResult(directory, receipt) {
|
|
|
16650
16652
|
state,
|
|
16651
16653
|
versionId: receipt.intent?.versionId ?? null,
|
|
16652
16654
|
committed,
|
|
16653
|
-
executionEnabled:
|
|
16655
|
+
executionEnabled: null,
|
|
16654
16656
|
nextAction
|
|
16655
16657
|
};
|
|
16656
16658
|
}
|
|
@@ -18,7 +18,8 @@ export interface PrivatePublicationResult {
|
|
|
18
18
|
state: string;
|
|
19
19
|
versionId: string | null;
|
|
20
20
|
committed: boolean;
|
|
21
|
-
|
|
21
|
+
/** Null when this recovery receipt contains no directly observed server capability. Publication alone never proves execution availability. */
|
|
22
|
+
executionEnabled: boolean | null;
|
|
22
23
|
nextAction: string;
|
|
23
24
|
}
|
|
24
25
|
/** Reads only two bounded local files. The receipt never contains a token or signed URL. */
|
|
@@ -27,7 +27,8 @@ export interface PrivatePublishingCapability {
|
|
|
27
27
|
authentication: "interactive-session";
|
|
28
28
|
maxArchiveBytes: 16777216;
|
|
29
29
|
uploadMaxTtlSeconds: 300;
|
|
30
|
-
|
|
30
|
+
/** Server capability only; each execution still requires a separate quote and approval. */
|
|
31
|
+
executionEnabled: boolean;
|
|
31
32
|
}
|
|
32
33
|
/** Contains a short-lived bearer capability. Never print or persist this object. */
|
|
33
34
|
export interface PrivatePublicationUpload {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Aggregate monetary values use nonnegative JavaScript-safe integer cents. */
|
|
2
|
+
export declare function assertCents(value: number, field: string): void;
|
|
3
|
+
/** A single reservation/charge must fit every supported store's integer column.
|
|
4
|
+
* Monthly ceilings and sums remain safe integers and may exceed this row limit. */
|
|
5
|
+
export declare function assertReservationCents(value: number, field: string): void;
|
|
@@ -34,7 +34,9 @@ export interface CreditReservation {
|
|
|
34
34
|
id: string;
|
|
35
35
|
orgId: string;
|
|
36
36
|
runId: string;
|
|
37
|
+
/** Per-reservation integer cents (0..2147483647) across all store backends. */
|
|
37
38
|
estimatedCents: number;
|
|
39
|
+
/** Settled integer cents in the same per-reservation range. */
|
|
38
40
|
actualCents?: number;
|
|
39
41
|
status: ReservationStatus;
|
|
40
42
|
createdAt: string;
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -48,3 +48,4 @@ export { WorkspaceInvitationInputError, RemoteWorkspaceInvitationError, RemoteWo
|
|
|
48
48
|
export { InvitationEmailInputError, RemoteInvitationEmailError, RemoteInvitationEmailUnconfirmedError, type RequestInvitationEmailChallenge, type AcceptInvitationEmailChallenge, type RemoteInvitationEmailChallenge, type RemoteInvitationEmailAcceptance, type RemoteInvitationEmailErrorCode } from "../lib/remote-invitation-recovery.js";
|
|
49
49
|
export { RemotePrivatePublicationsClient, PrivatePublicationError, PRIVATE_PUBLICATION_MAX_BYTES, type PrivatePublicationDeclaration, type PrivatePublicationView, type PrivatePublicationState, type PrivatePublishingCapability } from "../lib/remote-private-publications.js";
|
|
50
50
|
export { preparePrivatePublication, readPrivatePublicationRecovery, continuePrivatePublication, inspectPrivatePublication, type PrivatePublicationRecovery, type PrivatePublicationResult } from "../lib/private-publication-recovery.js";
|
|
51
|
+
export { createSkillOperationClient, SkillOperationClientError, SKILL_OPERATION_LIMITS, type SkillOperationClient, type SkillOperationTransport, type SkillOperationRequest, type SkillOperationResult, type SkillOperationJson, type SkillOperationRefusal, type SkillOperationClientErrorCode } from "./operations.js";
|