@hasna/skills 0.10.81 → 0.10.83
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 +35 -0
- package/bin/index.js +279 -57
- package/bin/mcp.js +121 -11
- package/bin/migrate.js +1 -1
- package/bin/server.js +1 -1
- package/bin/worker.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +117 -7
- package/dist/lib/agent-discovery-directories.d.ts +2 -1
- package/dist/lib/private-publication-customer.d.ts +4 -1
- package/dist/lib/remote-auth.d.ts +3 -1
- package/dist/lib/remote-private-publications.d.ts +35 -0
- package/dist/runtime-prerequisites.js +3 -2
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.js +117 -7
- package/package.json +1 -1
package/bin/mcp.js
CHANGED
|
@@ -23,7 +23,7 @@ var package_default;
|
|
|
23
23
|
var init_package = __esm(() => {
|
|
24
24
|
package_default = {
|
|
25
25
|
name: "@hasna/skills",
|
|
26
|
-
version: "0.10.
|
|
26
|
+
version: "0.10.83",
|
|
27
27
|
description: "Skills library for AI coding agents",
|
|
28
28
|
type: "module",
|
|
29
29
|
bin: {
|
|
@@ -23031,7 +23031,7 @@ function hashClaudePluginCacheOrphanMarker(path, budget2, changes) {
|
|
|
23031
23031
|
if (!before)
|
|
23032
23032
|
return null;
|
|
23033
23033
|
const uid = process.getuid?.();
|
|
23034
|
-
if (!before.isFile() || uid === undefined || before.uid !== uid || before.size > 32)
|
|
23034
|
+
if (!before.isFile() || uid === undefined || before.uid !== uid || before.size > 32 || (before.mode & 73) !== 0)
|
|
23035
23035
|
throw new Error("Invalid Claude orphan marker file or owner");
|
|
23036
23036
|
const fd = openSync7(path, constants4.O_RDONLY | constants4.O_NOFOLLOW | constants4.O_NONBLOCK);
|
|
23037
23037
|
try {
|
|
@@ -30444,7 +30444,7 @@ function safe2(path) {
|
|
|
30444
30444
|
function same2(before, after) {
|
|
30445
30445
|
return Boolean(after && after.isDirectory() && before.dev === after.dev && before.ino === after.ino && before.mtimeMs === after.mtimeMs && before.ctimeMs === after.ctimeMs);
|
|
30446
30446
|
}
|
|
30447
|
-
function capture(path, budget2, excludedRoots, omittedRoots = [], rows) {
|
|
30447
|
+
function capture(path, budget2, excludedRoots, omittedRoots = [], rows, claudeMarkers) {
|
|
30448
30448
|
safe2(path);
|
|
30449
30449
|
if (omittedRoots.some((root2) => path === root2 || path.startsWith(root2 + "/")))
|
|
30450
30450
|
return { path, sha256: null };
|
|
@@ -30472,6 +30472,11 @@ function capture(path, budget2, excludedRoots, omittedRoots = [], rows) {
|
|
|
30472
30472
|
need3(child2.length <= AGENT_POLICY_LIMITS.pathCharacters, "Native discovery directory path limit exceeded");
|
|
30473
30473
|
const stat = lstatSync8(child2);
|
|
30474
30474
|
need3(stat.isFile() || stat.isDirectory(), "Refusing symlink or special native discovery directory member");
|
|
30475
|
+
if (claudeMarkers && isClaudePluginCacheOrphanMarker(child2)) {
|
|
30476
|
+
need3(hashClaudePluginCacheOrphanMarker(child2) !== null, "Claude orphan marker changed while reading directory");
|
|
30477
|
+
if (claudeMarkers === "omit")
|
|
30478
|
+
continue;
|
|
30479
|
+
}
|
|
30475
30480
|
const row = JSON.stringify([childRelative, stat.isDirectory() ? "directory" : "file"]) + `
|
|
30476
30481
|
`;
|
|
30477
30482
|
budget2.bytes += Buffer.byteLength(row);
|
|
@@ -30528,25 +30533,33 @@ function verifyDiscoveryDirectoryProjection(directories, omittedRoots, tolerance
|
|
|
30528
30533
|
witnessChanged(new NativeDiscoveryWitnessChange("membership", directories[i].path, "Native discovery directory membership changed outside retired Codex roots"), tolerance, tolerance?.acceptsMembership(directories[i].path) === true);
|
|
30529
30534
|
}
|
|
30530
30535
|
}
|
|
30531
|
-
function
|
|
30536
|
+
function captureOrdinaryDirectories(paths, excludedRoots, claudeMarkers) {
|
|
30532
30537
|
need3(Array.isArray(paths) && paths.length <= AGENT_POLICY_LIMITS.discoveryDirectories && new Set(paths).size === paths.length, "Invalid native discovery directory collection");
|
|
30533
30538
|
const budget2 = { entries: 0, bytes: 0 };
|
|
30534
30539
|
for (const root of excludedRoots)
|
|
30535
30540
|
safe2(root);
|
|
30536
|
-
return paths.map((path) => capture(path, budget2, excludedRoots));
|
|
30541
|
+
return paths.map((path) => capture(path, budget2, excludedRoots, [], undefined, claudeMarkers));
|
|
30542
|
+
}
|
|
30543
|
+
function captureDiscoveryDirectories(paths, excludedRoots = []) {
|
|
30544
|
+
return captureOrdinaryDirectories(paths, excludedRoots, "omit");
|
|
30537
30545
|
}
|
|
30538
30546
|
function verifyDiscoveryDirectories(directories, excludedRoots = [], tolerance) {
|
|
30539
30547
|
need3(Array.isArray(directories) && directories.length <= AGENT_POLICY_LIMITS.discoveryDirectories, "Invalid native discovery directory collection");
|
|
30540
30548
|
for (const directory of directories)
|
|
30541
30549
|
need3(directory && typeof directory === "object" && (directory.sha256 === null || typeof directory.sha256 === "string" && /^[a-f0-9]{64}$/.test(directory.sha256)), "Invalid native discovery directory digest");
|
|
30542
30550
|
const current = captureDiscoveryDirectories(directories.map((directory) => directory.path), excludedRoots);
|
|
30551
|
+
let legacy;
|
|
30543
30552
|
for (let i = 0;i < directories.length; i++)
|
|
30544
30553
|
if (current[i].sha256 !== directories[i].sha256) {
|
|
30554
|
+
legacy ??= captureOrdinaryDirectories(directories.map((directory) => directory.path), excludedRoots, "retain");
|
|
30555
|
+
if (legacy[i].sha256 === directories[i].sha256)
|
|
30556
|
+
continue;
|
|
30545
30557
|
witnessChanged(new NativeDiscoveryWitnessChange("membership", directories[i].path, `Native discovery directory membership changed; run skills hook install with a fresh discovery review: ${directories[i].path}`), tolerance, tolerance?.acceptsMembership(directories[i].path) === true);
|
|
30546
30558
|
}
|
|
30547
30559
|
}
|
|
30548
30560
|
var init_agent_discovery_directories = __esm(() => {
|
|
30549
30561
|
init_agent_policy_limits();
|
|
30562
|
+
init_claude_plugin_cache_marker();
|
|
30550
30563
|
init_native_discovery_witness_change();
|
|
30551
30564
|
});
|
|
30552
30565
|
|
|
@@ -35652,6 +35665,7 @@ var init_hook_diagnostics = __esm(() => {
|
|
|
35652
35665
|
"CACHED_PROFILE_EXPIRED",
|
|
35653
35666
|
"CACHED_PROFILE_MISSING",
|
|
35654
35667
|
"CACHED_BUNDLE_MISSING",
|
|
35668
|
+
"PROFILE_LOCK_MISMATCH",
|
|
35655
35669
|
"SESSION_RECONCILIATION_REQUIRED",
|
|
35656
35670
|
"SESSION_RENEWAL_TIMEOUT",
|
|
35657
35671
|
"SESSION_WRITE_BUSY",
|
|
@@ -41871,7 +41885,7 @@ function checkedPublicationView(value, skillId, intentId, declaration) {
|
|
|
41871
41885
|
return invalid4();
|
|
41872
41886
|
return Object.freeze({ ...value });
|
|
41873
41887
|
}
|
|
41874
|
-
async function boundedJson(url2, init, token, mutation, budget3 = 15000, signal, create = false) {
|
|
41888
|
+
async function boundedJson(url2, init, token, mutation, budget3 = 15000, signal, create = false, readBinding) {
|
|
41875
41889
|
const controller = new AbortController;
|
|
41876
41890
|
let reader;
|
|
41877
41891
|
let response;
|
|
@@ -41887,8 +41901,18 @@ async function boundedJson(url2, init, token, mutation, budget3 = 15000, signal,
|
|
|
41887
41901
|
redirect: "error",
|
|
41888
41902
|
credentials: "omit",
|
|
41889
41903
|
signal: controller.signal,
|
|
41890
|
-
headers: {
|
|
41904
|
+
headers: {
|
|
41905
|
+
"Content-Type": "application/json",
|
|
41906
|
+
Authorization: `Bearer ${token}`,
|
|
41907
|
+
...readBinding ? {
|
|
41908
|
+
"x-skills-user-id": readBinding.userId,
|
|
41909
|
+
"x-skills-workspace-id": readBinding.organizationId,
|
|
41910
|
+
"x-skills-membership-id": readBinding.membershipId
|
|
41911
|
+
} : {}
|
|
41912
|
+
}
|
|
41891
41913
|
});
|
|
41914
|
+
if (readBinding && response.ok && response.status !== 200)
|
|
41915
|
+
return invalid4();
|
|
41892
41916
|
const length = response.headers.get("content-length");
|
|
41893
41917
|
if (length !== null && (!/^\d+$/.test(length) || Number(length) > 65536))
|
|
41894
41918
|
return invalid4();
|
|
@@ -41956,6 +41980,81 @@ async function boundedJson(url2, init, token, mutation, budget3 = 15000, signal,
|
|
|
41956
41980
|
response?.body?.cancel().catch(() => {});
|
|
41957
41981
|
}
|
|
41958
41982
|
}
|
|
41983
|
+
function historyDate(value) {
|
|
41984
|
+
if (typeof value !== "string")
|
|
41985
|
+
return false;
|
|
41986
|
+
const parts = /^(\d{4})-(\d{2})-(\d{2})(T| )(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,9}))?(Z|[+-](\d{2})(?::(\d{2}))?)$/.exec(value);
|
|
41987
|
+
if (!parts)
|
|
41988
|
+
return false;
|
|
41989
|
+
const [, y, m, d, separator, h, minute, second, fraction, zone, offsetHour, offsetMinute] = parts;
|
|
41990
|
+
if (separator === " " ? zone === "Z" || (fraction?.length ?? 0) > 6 : zone !== "Z" && offsetMinute === undefined)
|
|
41991
|
+
return false;
|
|
41992
|
+
const year = Number(y), month = Number(m), day = Number(d);
|
|
41993
|
+
const leap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
41994
|
+
const days = [31, leap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
41995
|
+
return year > 0 && month >= 1 && month <= 12 && day >= 1 && day <= days[month - 1] && Number(h) <= 23 && Number(minute) <= 59 && Number(second) <= 59 && (zone === "Z" || Number(offsetHour) <= 23 && Number(offsetMinute ?? 0) <= 59);
|
|
41996
|
+
}
|
|
41997
|
+
function privateHistory(value, organizationId, skillId, limit, cursor2) {
|
|
41998
|
+
if (!record10(value) || value.organizationId !== organizationId || value.skillId !== skillId || typeof value.slug !== "string" || !/^[a-z0-9-]+$/.test(value.slug) || !(value.currentVersion === null || historyText(value.currentVersion)) || !(value.currentVersionId === null || publicationUuid(value.currentVersionId)) || value.currentVersion === null !== (value.currentVersionId === null) || !(value.nextCursor === null || publicationUuid(value.nextCursor)) || !Array.isArray(value.versions) || value.versions.length > limit)
|
|
41999
|
+
return historyResponse();
|
|
42000
|
+
const seen = new Set;
|
|
42001
|
+
let previous = cursor2;
|
|
42002
|
+
const versions2 = value.versions.map((row) => {
|
|
42003
|
+
if (!record10(row) || !publicationUuid(row.id) || seen.has(row.id) || previous !== undefined && row.id >= previous || !historyText(row.version) || !(row.releasedAt === null || historyDate(row.releasedAt)) || !historyDate(row.createdAt) || row.id === value.currentVersionId !== (row.version === value.currentVersion))
|
|
42004
|
+
return historyResponse();
|
|
42005
|
+
seen.add(row.id);
|
|
42006
|
+
previous = row.id;
|
|
42007
|
+
return Object.freeze({ id: row.id, version: row.version, releasedAt: row.releasedAt, createdAt: row.createdAt });
|
|
42008
|
+
});
|
|
42009
|
+
if (value.nextCursor !== null && (!versions2.length || value.nextCursor !== versions2.at(-1).id))
|
|
42010
|
+
return historyResponse();
|
|
42011
|
+
return Object.freeze({
|
|
42012
|
+
organizationId,
|
|
42013
|
+
skillId,
|
|
42014
|
+
slug: value.slug,
|
|
42015
|
+
currentVersion: value.currentVersion,
|
|
42016
|
+
currentVersionId: value.currentVersionId,
|
|
42017
|
+
versions: Object.freeze(versions2),
|
|
42018
|
+
nextCursor: value.nextCursor
|
|
42019
|
+
});
|
|
42020
|
+
}
|
|
42021
|
+
|
|
42022
|
+
class RemotePrivateSkillHistoryClient {
|
|
42023
|
+
apiOrigin;
|
|
42024
|
+
organizationId;
|
|
42025
|
+
userId;
|
|
42026
|
+
membershipId;
|
|
42027
|
+
#token;
|
|
42028
|
+
constructor(apiUrl, session) {
|
|
42029
|
+
const checked = parseWorkspaceSession(session, { userId: session?.user?.id, membershipId: session?.user?.membershipId });
|
|
42030
|
+
this.apiOrigin = normalizeSkillsApiOrigin(apiUrl);
|
|
42031
|
+
this.#token = checked.token;
|
|
42032
|
+
this.organizationId = checked.organization.id;
|
|
42033
|
+
this.userId = checked.user.id;
|
|
42034
|
+
this.membershipId = checked.user.membershipId;
|
|
42035
|
+
Object.freeze(this);
|
|
42036
|
+
}
|
|
42037
|
+
async listVersions(skillId, options = {}) {
|
|
42038
|
+
if (!publicationUuid(skillId) || options.limit !== undefined && (!Number.isSafeInteger(options.limit) || options.limit < 1 || options.limit > 50) || options.cursor !== undefined && !publicationUuid(options.cursor) || options.timeoutMs !== undefined && (!Number.isSafeInteger(options.timeoutMs) || options.timeoutMs < 1 || options.timeoutMs > 15000))
|
|
42039
|
+
return historyInput();
|
|
42040
|
+
const limit = options.limit ?? 20, cursor2 = options.cursor;
|
|
42041
|
+
const query = new URLSearchParams;
|
|
42042
|
+
if (options.limit !== undefined)
|
|
42043
|
+
query.set("limit", String(limit));
|
|
42044
|
+
if (cursor2 !== undefined)
|
|
42045
|
+
query.set("cursor", cursor2);
|
|
42046
|
+
const path = `/api/v1/skills/${skillId}/versions${query.size ? `?${query}` : ""}`;
|
|
42047
|
+
let value;
|
|
42048
|
+
try {
|
|
42049
|
+
value = await boundedJson(skillsApiRequestUrl(this.apiOrigin, path), { method: "GET" }, this.#token, false, options.timeoutMs, options.signal, false, this);
|
|
42050
|
+
} catch (error61) {
|
|
42051
|
+
if (error61 instanceof PrivatePublicationError && error61.code === "INVALID_PUBLICATION_RESPONSE")
|
|
42052
|
+
return historyResponse();
|
|
42053
|
+
throw new PrivatePublicationError("PRIVATE_HISTORY_UNAVAILABLE", "Unable to read private version history. Check the selected server, current membership and fresh sign-in; no skill or credential was changed.", false, error61 instanceof PrivatePublicationError ? error61.status : undefined);
|
|
42054
|
+
}
|
|
42055
|
+
return privateHistory(value, this.organizationId, skillId, limit, cursor2);
|
|
42056
|
+
}
|
|
42057
|
+
}
|
|
41959
42058
|
|
|
41960
42059
|
class RemotePrivatePublicationsClient {
|
|
41961
42060
|
apiOrigin;
|
|
@@ -42129,7 +42228,11 @@ var PRIVATE_PUBLICATION_MAX_BYTES, skillCreateFailures, failures2, PrivatePublic
|
|
|
42129
42228
|
throw new PrivatePublicationError("INVALID_PUBLICATION_INPUT", "Invalid publication input or recovery data.");
|
|
42130
42229
|
}, invalid4 = () => {
|
|
42131
42230
|
throw new PrivatePublicationError("INVALID_PUBLICATION_RESPONSE", "The server returned an invalid publication result.");
|
|
42132
|
-
}, publicationUuid = (v) => typeof v === "string" && /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/.test(v), hash4 = (v) => typeof v === "string" && /^[a-f0-9]{64}$/.test(v), record10 = (v) => !!v && typeof v === "object" && !Array.isArray(v), exact = (v, keys2) => record10(v) && Object.keys(v).sort().join(",") === keys2.sort().join(","), date5 = (v) => typeof v === "string" && /^\d{4}-\d\d-\d\dT[0-9:.]+(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/.test(v) && Number.isFinite(Date.parse(v)), publicationSha256 = (bytes) => createHash27("sha256").update(bytes).digest("hex")
|
|
42231
|
+
}, publicationUuid = (v) => typeof v === "string" && /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/.test(v), hash4 = (v) => typeof v === "string" && /^[a-f0-9]{64}$/.test(v), record10 = (v) => !!v && typeof v === "object" && !Array.isArray(v), exact = (v, keys2) => record10(v) && Object.keys(v).sort().join(",") === keys2.sort().join(","), date5 = (v) => typeof v === "string" && /^\d{4}-\d\d-\d\dT[0-9:.]+(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/.test(v) && Number.isFinite(Date.parse(v)), publicationSha256 = (bytes) => createHash27("sha256").update(bytes).digest("hex"), historyInput = () => {
|
|
42232
|
+
throw new PrivatePublicationError("INVALID_PRIVATE_HISTORY_INPUT", "Provide a private skill UUID, limit from 1 to 50, and an optional UUID cursor; timeoutMs must be from 1 to 15000.");
|
|
42233
|
+
}, historyResponse = () => {
|
|
42234
|
+
throw new PrivatePublicationError("INVALID_PRIVATE_HISTORY_RESPONSE", "The server returned invalid private version history.");
|
|
42235
|
+
}, historyText = (value) => typeof value === "string" && value.length > 0 && value.length <= 128 && !/[\p{Cc}\p{Cs}\u2028\u2029]/u.test(value);
|
|
42133
42236
|
var init_remote_private_publications = __esm(() => {
|
|
42134
42237
|
init_fleet_credentials();
|
|
42135
42238
|
init_remote_workspace_selection();
|
|
@@ -42244,6 +42347,10 @@ class RemoteSkillsAuthClient {
|
|
|
42244
42347
|
const origin = this.apiOrigin, captured = workspaceContext(context);
|
|
42245
42348
|
return new RemotePrivatePublicationsClient(origin, await this.switchWorkspace(email4, code, captured));
|
|
42246
42349
|
}
|
|
42350
|
+
async openPrivateSkillHistory(email4, code, context) {
|
|
42351
|
+
const origin = this.apiOrigin, captured = workspaceContext(context);
|
|
42352
|
+
return new RemotePrivateSkillHistoryClient(origin, await this.switchWorkspace(email4, code, captured));
|
|
42353
|
+
}
|
|
42247
42354
|
requestInvitationEmailChallenge(input2) {
|
|
42248
42355
|
return requestInvitationEmail(this.apiOrigin, "challenge", input2);
|
|
42249
42356
|
}
|
|
@@ -48574,7 +48681,7 @@ var init_remote_invitation_tools = __esm(() => {
|
|
|
48574
48681
|
});
|
|
48575
48682
|
|
|
48576
48683
|
// src/lib/private-publication-customer.ts
|
|
48577
|
-
function
|
|
48684
|
+
function preparePrivateSession(requested, action, open2) {
|
|
48578
48685
|
const selectors = [
|
|
48579
48686
|
"HASNA_PROFILE",
|
|
48580
48687
|
"HASNA_HOME",
|
|
@@ -48588,7 +48695,7 @@ function preparePrivatePublicationSession(requested) {
|
|
|
48588
48695
|
"SKILLS_API_KEY"
|
|
48589
48696
|
];
|
|
48590
48697
|
const before = new Map(selectors.map((key2) => [key2, process.env[key2]]));
|
|
48591
|
-
const profile = selectedSkillsProfile(process.env), pending = prepareProfileWorkspace(
|
|
48698
|
+
const profile = selectedSkillsProfile(process.env), pending = prepareProfileWorkspace(action);
|
|
48592
48699
|
const captured = requested ? { ...requested } : undefined;
|
|
48593
48700
|
const unchanged3 = () => {
|
|
48594
48701
|
if (selectors.some((key2) => process.env[key2] !== before.get(key2)) || selectedSkillsProfile(process.env) !== profile)
|
|
@@ -48602,12 +48709,15 @@ function preparePrivatePublicationSession(requested) {
|
|
|
48602
48709
|
throw new PrivatePublicationError("PUBLICATION_CONTEXT_REQUIRED", "Provide the observed user and membership IDs, or select an enrolled workspace profile.");
|
|
48603
48710
|
unchanged3();
|
|
48604
48711
|
target.unchanged();
|
|
48605
|
-
const client = await new RemoteSkillsAuthClient(target.origin)
|
|
48712
|
+
const client = await open2(new RemoteSkillsAuthClient(target.origin), email5, code2, context2);
|
|
48606
48713
|
unchanged3();
|
|
48607
48714
|
target.unchanged();
|
|
48608
48715
|
return client;
|
|
48609
48716
|
} };
|
|
48610
48717
|
}
|
|
48718
|
+
function preparePrivatePublicationSession(requested) {
|
|
48719
|
+
return preparePrivateSession(requested, "Manage private publications", (auth, email5, code2, context2) => auth.openPrivatePublications(email5, code2, context2));
|
|
48720
|
+
}
|
|
48611
48721
|
async function privatePublicationSession(email5, code2, requested) {
|
|
48612
48722
|
return preparePrivatePublicationSession(requested).verify(email5, code2);
|
|
48613
48723
|
}
|
package/bin/migrate.js
CHANGED
package/bin/server.js
CHANGED
|
@@ -24140,7 +24140,7 @@ restoreLaunchCwd();
|
|
|
24140
24140
|
// package.json
|
|
24141
24141
|
var package_default = {
|
|
24142
24142
|
name: "@hasna/skills",
|
|
24143
|
-
version: "0.10.
|
|
24143
|
+
version: "0.10.83",
|
|
24144
24144
|
description: "Skills library for AI coding agents",
|
|
24145
24145
|
type: "module",
|
|
24146
24146
|
bin: {
|
package/bin/worker.js
CHANGED
|
@@ -24143,7 +24143,7 @@ import { randomUUID as randomUUID6 } from "crypto";
|
|
|
24143
24143
|
// package.json
|
|
24144
24144
|
var package_default = {
|
|
24145
24145
|
name: "@hasna/skills",
|
|
24146
|
-
version: "0.10.
|
|
24146
|
+
version: "0.10.83",
|
|
24147
24147
|
description: "Skills library for AI coding agents",
|
|
24148
24148
|
type: "module",
|
|
24149
24149
|
bin: {
|
package/dist/index.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export { WorkspaceLeaveInputError, RemoteWorkspaceLeaveError, RemoteWorkspaceLea
|
|
|
53
53
|
export type { RemoteWorkspaceInvitation, RemoteWorkspaceInvitationsPage, RemoteWorkspaceInvitationResult, RemoteWorkspaceInvitationAcceptance, ListRemoteWorkspaceInvitations, IssueRemoteWorkspaceInvitation, ResendRemoteWorkspaceInvitation, RevokeRemoteWorkspaceInvitation, AcceptRemoteWorkspaceInvitation, RemoteWorkspaceInvitationErrorCode } from "./lib/remote-invitations.js";
|
|
54
54
|
export { WorkspaceInvitationInputError, RemoteWorkspaceInvitationError, RemoteWorkspaceInvitationUnconfirmedError, RemoteWorkspaceInvitationReadError } from "./lib/remote-invitations.js";
|
|
55
55
|
export { InvitationEmailInputError, RemoteInvitationEmailError, RemoteInvitationEmailUnconfirmedError, type RequestInvitationEmailChallenge, type AcceptInvitationEmailChallenge, type RemoteInvitationEmailChallenge, type RemoteInvitationEmailAcceptance, type RemoteInvitationEmailErrorCode } from "./lib/remote-invitation-recovery.js";
|
|
56
|
-
export { RemotePrivatePublicationsClient, PrivatePublicationError, PRIVATE_PUBLICATION_MAX_BYTES, type CreatePrivateSkillInput, type CreatedPrivateSkill, type PrivatePublicationDeclaration, type PrivatePublicationView, type PrivatePublicationState, type PrivatePublishingCapability } from "./lib/remote-private-publications.js";
|
|
56
|
+
export { RemotePrivatePublicationsClient, RemotePrivateSkillHistoryClient, PrivatePublicationError, PRIVATE_PUBLICATION_MAX_BYTES, type PrivateSkillVersion, type PrivateSkillVersionHistory, type PrivateSkillVersionHistoryOptions, type CreatePrivateSkillInput, type CreatedPrivateSkill, type PrivatePublicationDeclaration, type PrivatePublicationView, type PrivatePublicationState, type PrivatePublishingCapability } from "./lib/remote-private-publications.js";
|
|
57
57
|
export { preparePrivatePublication, readPrivatePublicationRecovery, continuePrivatePublication, inspectPrivatePublication, type PrivatePublicationRecovery, type PrivatePublicationResult } from "./lib/private-publication-recovery.js";
|
|
58
58
|
export { HttpProfileClient, createProfileClient, type ProfileClient, type AuthenticatedProfilePrincipal, type AuthenticatedProfileRole } from "./lib/profile-client.js";
|
|
59
59
|
export type { SkillSelection, SkillProfile, ResolvedSkillSelection, ResolvedSkillProfile, StationSkillStateInput, StationSkillState } from "./types/skill-selection.js";
|
package/dist/index.js
CHANGED
|
@@ -9643,7 +9643,7 @@ function hashClaudePluginCacheOrphanMarker(path, budget2, changes) {
|
|
|
9643
9643
|
if (!before)
|
|
9644
9644
|
return null;
|
|
9645
9645
|
const uid = process.getuid?.();
|
|
9646
|
-
if (!before.isFile() || uid === undefined || before.uid !== uid || before.size > 32)
|
|
9646
|
+
if (!before.isFile() || uid === undefined || before.uid !== uid || before.size > 32 || (before.mode & 73) !== 0)
|
|
9647
9647
|
throw new Error("Invalid Claude orphan marker file or owner");
|
|
9648
9648
|
const fd = openSync3(path, constants3.O_RDONLY | constants3.O_NOFOLLOW | constants3.O_NONBLOCK);
|
|
9649
9649
|
try {
|
|
@@ -10269,7 +10269,7 @@ function safe2(path) {
|
|
|
10269
10269
|
function same2(before, after) {
|
|
10270
10270
|
return Boolean(after && after.isDirectory() && before.dev === after.dev && before.ino === after.ino && before.mtimeMs === after.mtimeMs && before.ctimeMs === after.ctimeMs);
|
|
10271
10271
|
}
|
|
10272
|
-
function capture(path, budget2, excludedRoots, omittedRoots = [], rows) {
|
|
10272
|
+
function capture(path, budget2, excludedRoots, omittedRoots = [], rows, claudeMarkers) {
|
|
10273
10273
|
safe2(path);
|
|
10274
10274
|
if (omittedRoots.some((root2) => path === root2 || path.startsWith(root2 + "/")))
|
|
10275
10275
|
return { path, sha256: null };
|
|
@@ -10297,6 +10297,11 @@ function capture(path, budget2, excludedRoots, omittedRoots = [], rows) {
|
|
|
10297
10297
|
need3(child2.length <= AGENT_POLICY_LIMITS.pathCharacters, "Native discovery directory path limit exceeded");
|
|
10298
10298
|
const stat = lstatSync7(child2);
|
|
10299
10299
|
need3(stat.isFile() || stat.isDirectory(), "Refusing symlink or special native discovery directory member");
|
|
10300
|
+
if (claudeMarkers && isClaudePluginCacheOrphanMarker(child2)) {
|
|
10301
|
+
need3(hashClaudePluginCacheOrphanMarker(child2) !== null, "Claude orphan marker changed while reading directory");
|
|
10302
|
+
if (claudeMarkers === "omit")
|
|
10303
|
+
continue;
|
|
10304
|
+
}
|
|
10300
10305
|
const row = JSON.stringify([childRelative, stat.isDirectory() ? "directory" : "file"]) + `
|
|
10301
10306
|
`;
|
|
10302
10307
|
budget2.bytes += Buffer.byteLength(row);
|
|
@@ -10353,20 +10358,27 @@ function verifyDiscoveryDirectoryProjection(directories, omittedRoots, tolerance
|
|
|
10353
10358
|
witnessChanged(new NativeDiscoveryWitnessChange("membership", directories[i].path, "Native discovery directory membership changed outside retired Codex roots"), tolerance, tolerance?.acceptsMembership(directories[i].path) === true);
|
|
10354
10359
|
}
|
|
10355
10360
|
}
|
|
10356
|
-
function
|
|
10361
|
+
function captureOrdinaryDirectories(paths, excludedRoots, claudeMarkers) {
|
|
10357
10362
|
need3(Array.isArray(paths) && paths.length <= AGENT_POLICY_LIMITS.discoveryDirectories && new Set(paths).size === paths.length, "Invalid native discovery directory collection");
|
|
10358
10363
|
const budget2 = { entries: 0, bytes: 0 };
|
|
10359
10364
|
for (const root of excludedRoots)
|
|
10360
10365
|
safe2(root);
|
|
10361
|
-
return paths.map((path) => capture(path, budget2, excludedRoots));
|
|
10366
|
+
return paths.map((path) => capture(path, budget2, excludedRoots, [], undefined, claudeMarkers));
|
|
10367
|
+
}
|
|
10368
|
+
function captureDiscoveryDirectories(paths, excludedRoots = []) {
|
|
10369
|
+
return captureOrdinaryDirectories(paths, excludedRoots, "omit");
|
|
10362
10370
|
}
|
|
10363
10371
|
function verifyDiscoveryDirectories(directories, excludedRoots = [], tolerance) {
|
|
10364
10372
|
need3(Array.isArray(directories) && directories.length <= AGENT_POLICY_LIMITS.discoveryDirectories, "Invalid native discovery directory collection");
|
|
10365
10373
|
for (const directory of directories)
|
|
10366
10374
|
need3(directory && typeof directory === "object" && (directory.sha256 === null || typeof directory.sha256 === "string" && /^[a-f0-9]{64}$/.test(directory.sha256)), "Invalid native discovery directory digest");
|
|
10367
10375
|
const current = captureDiscoveryDirectories(directories.map((directory) => directory.path), excludedRoots);
|
|
10376
|
+
let legacy;
|
|
10368
10377
|
for (let i = 0;i < directories.length; i++)
|
|
10369
10378
|
if (current[i].sha256 !== directories[i].sha256) {
|
|
10379
|
+
legacy ??= captureOrdinaryDirectories(directories.map((directory) => directory.path), excludedRoots, "retain");
|
|
10380
|
+
if (legacy[i].sha256 === directories[i].sha256)
|
|
10381
|
+
continue;
|
|
10370
10382
|
witnessChanged(new NativeDiscoveryWitnessChange("membership", directories[i].path, `Native discovery directory membership changed; run skills hook install with a fresh discovery review: ${directories[i].path}`), tolerance, tolerance?.acceptsMembership(directories[i].path) === true);
|
|
10371
10383
|
}
|
|
10372
10384
|
}
|
|
@@ -15852,7 +15864,7 @@ import { basename as basename14, dirname as dirname25, isAbsolute as isAbsolute2
|
|
|
15852
15864
|
import { homedir as homedir5 } from "os";
|
|
15853
15865
|
import { isAbsolute as isAbsolute25, join as join37, resolve as resolve24 } from "path";
|
|
15854
15866
|
// package.json
|
|
15855
|
-
var version = "0.10.
|
|
15867
|
+
var version = "0.10.83";
|
|
15856
15868
|
var package_default = {
|
|
15857
15869
|
name: "@hasna/skills",
|
|
15858
15870
|
version,
|
|
@@ -19583,6 +19595,7 @@ var OPTIONAL_CONTEXT_FAILURES = new Set([
|
|
|
19583
19595
|
"CACHED_PROFILE_EXPIRED",
|
|
19584
19596
|
"CACHED_PROFILE_MISSING",
|
|
19585
19597
|
"CACHED_BUNDLE_MISSING",
|
|
19598
|
+
"PROFILE_LOCK_MISMATCH",
|
|
19586
19599
|
"SESSION_RECONCILIATION_REQUIRED",
|
|
19587
19600
|
"SESSION_RENEWAL_TIMEOUT",
|
|
19588
19601
|
"SESSION_WRITE_BUSY",
|
|
@@ -49531,7 +49544,7 @@ function checkedPublicationView(value, skillId, intentId, declaration) {
|
|
|
49531
49544
|
return invalid4();
|
|
49532
49545
|
return Object.freeze({ ...value });
|
|
49533
49546
|
}
|
|
49534
|
-
async function boundedJson(url2, init, token, mutation, budget3 = 15000, signal, create = false) {
|
|
49547
|
+
async function boundedJson(url2, init, token, mutation, budget3 = 15000, signal, create = false, readBinding) {
|
|
49535
49548
|
const controller = new AbortController;
|
|
49536
49549
|
let reader;
|
|
49537
49550
|
let response;
|
|
@@ -49547,8 +49560,18 @@ async function boundedJson(url2, init, token, mutation, budget3 = 15000, signal,
|
|
|
49547
49560
|
redirect: "error",
|
|
49548
49561
|
credentials: "omit",
|
|
49549
49562
|
signal: controller.signal,
|
|
49550
|
-
headers: {
|
|
49563
|
+
headers: {
|
|
49564
|
+
"Content-Type": "application/json",
|
|
49565
|
+
Authorization: `Bearer ${token}`,
|
|
49566
|
+
...readBinding ? {
|
|
49567
|
+
"x-skills-user-id": readBinding.userId,
|
|
49568
|
+
"x-skills-workspace-id": readBinding.organizationId,
|
|
49569
|
+
"x-skills-membership-id": readBinding.membershipId
|
|
49570
|
+
} : {}
|
|
49571
|
+
}
|
|
49551
49572
|
});
|
|
49573
|
+
if (readBinding && response.ok && response.status !== 200)
|
|
49574
|
+
return invalid4();
|
|
49552
49575
|
const length = response.headers.get("content-length");
|
|
49553
49576
|
if (length !== null && (!/^\d+$/.test(length) || Number(length) > 65536))
|
|
49554
49577
|
return invalid4();
|
|
@@ -49616,6 +49639,88 @@ async function boundedJson(url2, init, token, mutation, budget3 = 15000, signal,
|
|
|
49616
49639
|
response?.body?.cancel().catch(() => {});
|
|
49617
49640
|
}
|
|
49618
49641
|
}
|
|
49642
|
+
var historyInput = () => {
|
|
49643
|
+
throw new PrivatePublicationError("INVALID_PRIVATE_HISTORY_INPUT", "Provide a private skill UUID, limit from 1 to 50, and an optional UUID cursor; timeoutMs must be from 1 to 15000.");
|
|
49644
|
+
};
|
|
49645
|
+
var historyResponse = () => {
|
|
49646
|
+
throw new PrivatePublicationError("INVALID_PRIVATE_HISTORY_RESPONSE", "The server returned invalid private version history.");
|
|
49647
|
+
};
|
|
49648
|
+
var historyText = (value) => typeof value === "string" && value.length > 0 && value.length <= 128 && !/[\p{Cc}\p{Cs}\u2028\u2029]/u.test(value);
|
|
49649
|
+
function historyDate(value) {
|
|
49650
|
+
if (typeof value !== "string")
|
|
49651
|
+
return false;
|
|
49652
|
+
const parts = /^(\d{4})-(\d{2})-(\d{2})(T| )(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,9}))?(Z|[+-](\d{2})(?::(\d{2}))?)$/.exec(value);
|
|
49653
|
+
if (!parts)
|
|
49654
|
+
return false;
|
|
49655
|
+
const [, y, m, d, separator, h, minute, second, fraction, zone, offsetHour, offsetMinute] = parts;
|
|
49656
|
+
if (separator === " " ? zone === "Z" || (fraction?.length ?? 0) > 6 : zone !== "Z" && offsetMinute === undefined)
|
|
49657
|
+
return false;
|
|
49658
|
+
const year = Number(y), month = Number(m), day = Number(d);
|
|
49659
|
+
const leap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
49660
|
+
const days = [31, leap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
49661
|
+
return year > 0 && month >= 1 && month <= 12 && day >= 1 && day <= days[month - 1] && Number(h) <= 23 && Number(minute) <= 59 && Number(second) <= 59 && (zone === "Z" || Number(offsetHour) <= 23 && Number(offsetMinute ?? 0) <= 59);
|
|
49662
|
+
}
|
|
49663
|
+
function privateHistory(value, organizationId, skillId, limit, cursor2) {
|
|
49664
|
+
if (!record11(value) || value.organizationId !== organizationId || value.skillId !== skillId || typeof value.slug !== "string" || !/^[a-z0-9-]+$/.test(value.slug) || !(value.currentVersion === null || historyText(value.currentVersion)) || !(value.currentVersionId === null || publicationUuid(value.currentVersionId)) || value.currentVersion === null !== (value.currentVersionId === null) || !(value.nextCursor === null || publicationUuid(value.nextCursor)) || !Array.isArray(value.versions) || value.versions.length > limit)
|
|
49665
|
+
return historyResponse();
|
|
49666
|
+
const seen = new Set;
|
|
49667
|
+
let previous = cursor2;
|
|
49668
|
+
const versions2 = value.versions.map((row) => {
|
|
49669
|
+
if (!record11(row) || !publicationUuid(row.id) || seen.has(row.id) || previous !== undefined && row.id >= previous || !historyText(row.version) || !(row.releasedAt === null || historyDate(row.releasedAt)) || !historyDate(row.createdAt) || row.id === value.currentVersionId !== (row.version === value.currentVersion))
|
|
49670
|
+
return historyResponse();
|
|
49671
|
+
seen.add(row.id);
|
|
49672
|
+
previous = row.id;
|
|
49673
|
+
return Object.freeze({ id: row.id, version: row.version, releasedAt: row.releasedAt, createdAt: row.createdAt });
|
|
49674
|
+
});
|
|
49675
|
+
if (value.nextCursor !== null && (!versions2.length || value.nextCursor !== versions2.at(-1).id))
|
|
49676
|
+
return historyResponse();
|
|
49677
|
+
return Object.freeze({
|
|
49678
|
+
organizationId,
|
|
49679
|
+
skillId,
|
|
49680
|
+
slug: value.slug,
|
|
49681
|
+
currentVersion: value.currentVersion,
|
|
49682
|
+
currentVersionId: value.currentVersionId,
|
|
49683
|
+
versions: Object.freeze(versions2),
|
|
49684
|
+
nextCursor: value.nextCursor
|
|
49685
|
+
});
|
|
49686
|
+
}
|
|
49687
|
+
|
|
49688
|
+
class RemotePrivateSkillHistoryClient {
|
|
49689
|
+
apiOrigin;
|
|
49690
|
+
organizationId;
|
|
49691
|
+
userId;
|
|
49692
|
+
membershipId;
|
|
49693
|
+
#token;
|
|
49694
|
+
constructor(apiUrl, session) {
|
|
49695
|
+
const checked = parseWorkspaceSession(session, { userId: session?.user?.id, membershipId: session?.user?.membershipId });
|
|
49696
|
+
this.apiOrigin = normalizeSkillsApiOrigin(apiUrl);
|
|
49697
|
+
this.#token = checked.token;
|
|
49698
|
+
this.organizationId = checked.organization.id;
|
|
49699
|
+
this.userId = checked.user.id;
|
|
49700
|
+
this.membershipId = checked.user.membershipId;
|
|
49701
|
+
Object.freeze(this);
|
|
49702
|
+
}
|
|
49703
|
+
async listVersions(skillId, options = {}) {
|
|
49704
|
+
if (!publicationUuid(skillId) || options.limit !== undefined && (!Number.isSafeInteger(options.limit) || options.limit < 1 || options.limit > 50) || options.cursor !== undefined && !publicationUuid(options.cursor) || options.timeoutMs !== undefined && (!Number.isSafeInteger(options.timeoutMs) || options.timeoutMs < 1 || options.timeoutMs > 15000))
|
|
49705
|
+
return historyInput();
|
|
49706
|
+
const limit = options.limit ?? 20, cursor2 = options.cursor;
|
|
49707
|
+
const query = new URLSearchParams;
|
|
49708
|
+
if (options.limit !== undefined)
|
|
49709
|
+
query.set("limit", String(limit));
|
|
49710
|
+
if (cursor2 !== undefined)
|
|
49711
|
+
query.set("cursor", cursor2);
|
|
49712
|
+
const path = `/api/v1/skills/${skillId}/versions${query.size ? `?${query}` : ""}`;
|
|
49713
|
+
let value;
|
|
49714
|
+
try {
|
|
49715
|
+
value = await boundedJson(skillsApiRequestUrl(this.apiOrigin, path), { method: "GET" }, this.#token, false, options.timeoutMs, options.signal, false, this);
|
|
49716
|
+
} catch (error61) {
|
|
49717
|
+
if (error61 instanceof PrivatePublicationError && error61.code === "INVALID_PUBLICATION_RESPONSE")
|
|
49718
|
+
return historyResponse();
|
|
49719
|
+
throw new PrivatePublicationError("PRIVATE_HISTORY_UNAVAILABLE", "Unable to read private version history. Check the selected server, current membership and fresh sign-in; no skill or credential was changed.", false, error61 instanceof PrivatePublicationError ? error61.status : undefined);
|
|
49720
|
+
}
|
|
49721
|
+
return privateHistory(value, this.organizationId, skillId, limit, cursor2);
|
|
49722
|
+
}
|
|
49723
|
+
}
|
|
49619
49724
|
|
|
49620
49725
|
class RemotePrivatePublicationsClient {
|
|
49621
49726
|
apiOrigin;
|
|
@@ -49868,6 +49973,10 @@ class RemoteSkillsAuthClient {
|
|
|
49868
49973
|
const origin = this.apiOrigin, captured = workspaceContext(context);
|
|
49869
49974
|
return new RemotePrivatePublicationsClient(origin, await this.switchWorkspace(email4, code, captured));
|
|
49870
49975
|
}
|
|
49976
|
+
async openPrivateSkillHistory(email4, code, context) {
|
|
49977
|
+
const origin = this.apiOrigin, captured = workspaceContext(context);
|
|
49978
|
+
return new RemotePrivateSkillHistoryClient(origin, await this.switchWorkspace(email4, code, captured));
|
|
49979
|
+
}
|
|
49871
49980
|
requestInvitationEmailChallenge(input2) {
|
|
49872
49981
|
return requestInvitationEmail(this.apiOrigin, "challenge", input2);
|
|
49873
49982
|
}
|
|
@@ -53463,6 +53572,7 @@ export {
|
|
|
53463
53572
|
RemoteRouteUnsupportedError,
|
|
53464
53573
|
RemoteRequestError,
|
|
53465
53574
|
RemoteQuoteUnavailableError,
|
|
53575
|
+
RemotePrivateSkillHistoryClient,
|
|
53466
53576
|
RemotePrivatePublicationsClient,
|
|
53467
53577
|
RemoteInvitationEmailUnconfirmedError,
|
|
53468
53578
|
RemoteInvitationEmailError,
|
|
@@ -15,7 +15,8 @@ export declare function captureDiscoveryDirectoryProjection(paths: string[], omi
|
|
|
15
15
|
* membership change is a NativeDiscoveryWitnessChange: thrown, unless the live
|
|
16
16
|
* Codex prompt hook's tolerance accepts it. Invalid inventories always throw. */
|
|
17
17
|
export declare function verifyDiscoveryDirectoryProjection(directories: DiscoveryDirectoryProjection[], omittedRoots: readonly string[], tolerance?: NativeDiscoveryWitnessTolerance): void;
|
|
18
|
-
/** Read-only capture
|
|
18
|
+
/** Read-only membership capture, excluding validated Claude cleanup markers.
|
|
19
|
+
* Callers must still review source bytes; projected inventories remain exact. */
|
|
19
20
|
export declare function captureDiscoveryDirectories(paths: string[], excludedRoots?: readonly string[]): DiscoveryDirectory[];
|
|
20
21
|
/** A membership change is a NativeDiscoveryWitnessChange: thrown, unless the
|
|
21
22
|
* live Codex prompt hook's tolerance accepts it. Invalid collections always throw. */
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { RemotePrivatePublicationsClient } from "./remote-private-publications.js";
|
|
2
2
|
import type { RemoteWorkspaceContext } from "./remote-workspace-selection.js";
|
|
3
|
-
/** Capture before code input, so a later profile/origin change cannot retarget consent. */
|
|
4
3
|
export declare function preparePrivatePublicationSession(requested?: RemoteWorkspaceContext): {
|
|
5
4
|
origin: string;
|
|
6
5
|
verify(email: string, code: string): Promise<RemotePrivatePublicationsClient>;
|
|
7
6
|
};
|
|
7
|
+
export declare function preparePrivateSkillHistorySession(requested?: RemoteWorkspaceContext): {
|
|
8
|
+
origin: string;
|
|
9
|
+
verify(email: string, code: string): Promise<import("./remote-private-publications.js").RemotePrivateSkillHistoryClient>;
|
|
10
|
+
};
|
|
8
11
|
/** Neither the session nor a signed upload capability is saved to host credentials. */
|
|
9
12
|
export declare function privatePublicationSession(email: string, code: string, requested?: RemoteWorkspaceContext): Promise<RemotePrivatePublicationsClient>;
|
|
10
13
|
export declare function privatePublicationCustomerError(error: unknown): {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RequestInvitationEmailChallenge, type AcceptInvitationEmailChallenge } from "./remote-invitation-recovery.js";
|
|
2
|
-
import { RemotePrivatePublicationsClient } from "./remote-private-publications.js";
|
|
2
|
+
import { RemotePrivatePublicationsClient, RemotePrivateSkillHistoryClient } from "./remote-private-publications.js";
|
|
3
3
|
import { type ListRemoteWorkspaceInvitations, type IssueRemoteWorkspaceInvitation, type ResendRemoteWorkspaceInvitation, type RevokeRemoteWorkspaceInvitation, type AcceptRemoteWorkspaceInvitation } from "./remote-invitations.js";
|
|
4
4
|
import { type LeaveRemoteWorkspace } from "./remote-workspace-leave.js";
|
|
5
5
|
import { type RemoteWorkspaceContext, type RemoteWorkspaceSession, type RemoteAccountWorkspaceDiscovery } from "./remote-workspace-selection.js";
|
|
@@ -26,6 +26,8 @@ export declare class RemoteSkillsAuthClient {
|
|
|
26
26
|
constructor(apiUrl: string);
|
|
27
27
|
/** One fresh workspace-bound session for an entire publication. No credentials are saved. */
|
|
28
28
|
openPrivatePublications(email: string, code: string, context: RemoteWorkspaceContext): Promise<RemotePrivatePublicationsClient>;
|
|
29
|
+
/** Fresh workspace-bound, read-only private history session; no key is created or saved. */
|
|
30
|
+
openPrivateSkillHistory(email: string, code: string, context: RemoteWorkspaceContext): Promise<RemotePrivateSkillHistoryClient>;
|
|
29
31
|
requestInvitationEmailChallenge(input: RequestInvitationEmailChallenge): Promise<import("./remote-invitation-recovery.js").RemoteInvitationEmailChallenge>;
|
|
30
32
|
acceptInvitationEmailChallenge(input: AcceptInvitationEmailChallenge): Promise<import("./remote-invitation-recovery.js").RemoteInvitationEmailAcceptance>;
|
|
31
33
|
requestCode(email: string): Promise<any>;
|
|
@@ -64,6 +64,41 @@ export declare const publicationSha256: (bytes: Uint8Array | string) => string;
|
|
|
64
64
|
export declare function checkedPrivateSkillCreate(value: unknown): Omit<Required<CreatePrivateSkillInput>, "confirm">;
|
|
65
65
|
export declare function checkedPublicationDeclaration(value: unknown): PrivatePublicationDeclaration;
|
|
66
66
|
export declare function checkedPublicationView(value: unknown, skillId: string, intentId?: string, declaration?: PrivatePublicationDeclaration): PrivatePublicationView;
|
|
67
|
+
/** Metadata-only private history uses the existing interactive UUID route,
|
|
68
|
+
* distinct from the public slug/API-key version contract. */
|
|
69
|
+
export interface PrivateSkillVersion {
|
|
70
|
+
id: string;
|
|
71
|
+
version: string;
|
|
72
|
+
releasedAt: string | null;
|
|
73
|
+
createdAt: string;
|
|
74
|
+
}
|
|
75
|
+
export interface PrivateSkillVersionHistory {
|
|
76
|
+
organizationId: string;
|
|
77
|
+
skillId: string;
|
|
78
|
+
slug: string;
|
|
79
|
+
currentVersion: string | null;
|
|
80
|
+
currentVersionId: string | null;
|
|
81
|
+
versions: readonly PrivateSkillVersion[];
|
|
82
|
+
nextCursor: string | null;
|
|
83
|
+
}
|
|
84
|
+
export interface PrivateSkillVersionHistoryOptions {
|
|
85
|
+
limit?: number;
|
|
86
|
+
cursor?: string;
|
|
87
|
+
timeoutMs?: number;
|
|
88
|
+
signal?: AbortSignal;
|
|
89
|
+
}
|
|
90
|
+
/** Read-only session consumer; permits viewer history without granting any publication action.
|
|
91
|
+
* Tokens stay in a private field and are never persisted or serialized. */
|
|
92
|
+
export declare class RemotePrivateSkillHistoryClient {
|
|
93
|
+
#private;
|
|
94
|
+
readonly apiOrigin: string;
|
|
95
|
+
readonly organizationId: string;
|
|
96
|
+
readonly userId: string;
|
|
97
|
+
readonly membershipId: string;
|
|
98
|
+
constructor(apiUrl: string, session: RemoteWorkspaceSession);
|
|
99
|
+
/** One page and one GET. Follow nextCursor explicitly; an error never prints partial history. */
|
|
100
|
+
listVersions(skillId: string, options?: PrivateSkillVersionHistoryOptions): Promise<PrivateSkillVersionHistory>;
|
|
101
|
+
}
|
|
67
102
|
/** Explicit hosted contract, unrelated to registry publishSkill and its content revisions.
|
|
68
103
|
* Session tokens stay in private fields and are never written to credentials. */
|
|
69
104
|
export declare class RemotePrivatePublicationsClient {
|
|
@@ -49,7 +49,7 @@ var __require = import.meta.require;
|
|
|
49
49
|
// src/runtime-prerequisites.ts
|
|
50
50
|
import { isAbsolute as isAbsolute7 } from "path";
|
|
51
51
|
// package.json
|
|
52
|
-
var version = "0.10.
|
|
52
|
+
var version = "0.10.83";
|
|
53
53
|
var package_default = {
|
|
54
54
|
name: "@hasna/skills",
|
|
55
55
|
version,
|
|
@@ -2554,7 +2554,7 @@ function hashClaudePluginCacheOrphanMarker(path, budget, changes) {
|
|
|
2554
2554
|
if (!before)
|
|
2555
2555
|
return null;
|
|
2556
2556
|
const uid = process.getuid?.();
|
|
2557
|
-
if (!before.isFile() || uid === undefined || before.uid !== uid || before.size > 32)
|
|
2557
|
+
if (!before.isFile() || uid === undefined || before.uid !== uid || before.size > 32 || (before.mode & 73) !== 0)
|
|
2558
2558
|
throw new Error("Invalid Claude orphan marker file or owner");
|
|
2559
2559
|
const fd = openSync4(path, constants4.O_RDONLY | constants4.O_NOFOLLOW | constants4.O_NONBLOCK);
|
|
2560
2560
|
try {
|
|
@@ -3064,6 +3064,7 @@ var OPTIONAL_CONTEXT_FAILURES = new Set([
|
|
|
3064
3064
|
"CACHED_PROFILE_EXPIRED",
|
|
3065
3065
|
"CACHED_PROFILE_MISSING",
|
|
3066
3066
|
"CACHED_BUNDLE_MISSING",
|
|
3067
|
+
"PROFILE_LOCK_MISMATCH",
|
|
3067
3068
|
"SESSION_RECONCILIATION_REQUIRED",
|
|
3068
3069
|
"SESSION_RENEWAL_TIMEOUT",
|
|
3069
3070
|
"SESSION_WRITE_BUSY",
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export { WorkspaceLeaveInputError, RemoteWorkspaceLeaveError, RemoteWorkspaceLea
|
|
|
61
61
|
export type { RemoteWorkspaceInvitation, RemoteWorkspaceInvitationsPage, RemoteWorkspaceInvitationResult, RemoteWorkspaceInvitationAcceptance, ListRemoteWorkspaceInvitations, IssueRemoteWorkspaceInvitation, ResendRemoteWorkspaceInvitation, RevokeRemoteWorkspaceInvitation, AcceptRemoteWorkspaceInvitation, RemoteWorkspaceInvitationErrorCode } from "../lib/remote-invitations.js";
|
|
62
62
|
export { WorkspaceInvitationInputError, RemoteWorkspaceInvitationError, RemoteWorkspaceInvitationUnconfirmedError, RemoteWorkspaceInvitationReadError } from "../lib/remote-invitations.js";
|
|
63
63
|
export { InvitationEmailInputError, RemoteInvitationEmailError, RemoteInvitationEmailUnconfirmedError, type RequestInvitationEmailChallenge, type AcceptInvitationEmailChallenge, type RemoteInvitationEmailChallenge, type RemoteInvitationEmailAcceptance, type RemoteInvitationEmailErrorCode } from "../lib/remote-invitation-recovery.js";
|
|
64
|
-
export { RemotePrivatePublicationsClient, PrivatePublicationError, PRIVATE_PUBLICATION_MAX_BYTES, type CreatePrivateSkillInput, type CreatedPrivateSkill, type PrivatePublicationDeclaration, type PrivatePublicationView, type PrivatePublicationState, type PrivatePublishingCapability } from "../lib/remote-private-publications.js";
|
|
64
|
+
export { RemotePrivatePublicationsClient, RemotePrivateSkillHistoryClient, PrivatePublicationError, PRIVATE_PUBLICATION_MAX_BYTES, type PrivateSkillVersion, type PrivateSkillVersionHistory, type PrivateSkillVersionHistoryOptions, type CreatePrivateSkillInput, type CreatedPrivateSkill, type PrivatePublicationDeclaration, type PrivatePublicationView, type PrivatePublicationState, type PrivatePublishingCapability } from "../lib/remote-private-publications.js";
|
|
65
65
|
export { preparePrivatePublication, readPrivatePublicationRecovery, continuePrivatePublication, inspectPrivatePublication, type PrivatePublicationRecovery, type PrivatePublicationResult } from "../lib/private-publication-recovery.js";
|
|
66
66
|
export { createSkillOperationClient, SkillOperationClientError, SKILL_OPERATION_LIMITS, type SkillOperationClient, type SkillOperationTransport, type SkillOperationRequest, type SkillOperationResult, type SkillOperationJson, type SkillOperationRefusal, type SkillOperationClientErrorCode } from "./operations.js";
|
|
67
67
|
export type { RemoteCreditCheckoutOptions, RemoteCreditCheckout, RemoteCreditCheckoutErrorCode } from "../lib/remote-credit-checkout.js";
|