@hasna/skills 0.5.4 → 0.5.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.
package/dist/sdk/index.js CHANGED
@@ -19,14 +19,12 @@ var __toESM = (mod, isNodeMode, target) => {
19
19
  }
20
20
  target = mod != null ? __create(__getProtoOf(mod)) : {};
21
21
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
- if (mod && typeof mod === "object" || typeof mod === "function") {
23
- for (let key of __getOwnPropNames(mod))
24
- if (!__hasOwnProp.call(to, key))
25
- __defProp(to, key, {
26
- get: __accessProp.bind(mod, key),
27
- enumerable: true
28
- });
29
- }
22
+ for (let key of __getOwnPropNames(mod))
23
+ if (!__hasOwnProp.call(to, key))
24
+ __defProp(to, key, {
25
+ get: __accessProp.bind(mod, key),
26
+ enumerable: true
27
+ });
30
28
  if (canCache)
31
29
  cache.set(mod, to);
32
30
  return to;
@@ -48,8 +46,8 @@ var __export = (target, all) => {
48
46
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
49
47
  var __require = import.meta.require;
50
48
 
51
- // ../../node_modules/.bun/@smithy+types@4.18.0/node_modules/@smithy/types/dist-cjs/index.js
52
- var require_dist_cjs = __commonJS(function(exports) {
49
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+types@4.18.0/node_modules/@smithy/types/dist-cjs/index.js
50
+ var require_dist_cjs = __commonJS((exports) => {
53
51
  var HttpAuthLocation;
54
52
  (function(HttpAuthLocation2) {
55
53
  HttpAuthLocation2["HEADER"] = "header";
@@ -139,8 +137,8 @@ var require_dist_cjs = __commonJS(function(exports) {
139
137
  exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig;
140
138
  });
141
139
 
142
- // ../../node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js
143
- var require_transport = __commonJS(function(exports) {
140
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js
141
+ var require_transport = __commonJS((exports) => {
144
142
  var { SMITHY_CONTEXT_KEY } = require_dist_cjs();
145
143
  var getSmithyContext = (context) => context[SMITHY_CONTEXT_KEY] || (context[SMITHY_CONTEXT_KEY] = {});
146
144
  function hasOwn2(o, k) {
@@ -312,8 +310,8 @@ var require_transport = __commonJS(function(exports) {
312
310
  exports.toEndpointV1 = toEndpointV1;
313
311
  });
314
312
 
315
- // ../../node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js
316
- var require_schema = __commonJS(function(exports) {
313
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js
314
+ var require_schema = __commonJS((exports) => {
317
315
  var { getSmithyContext, HttpResponse, toEndpointV1 } = require_transport();
318
316
  var deref = (schemaRef) => {
319
317
  if (typeof schemaRef === "function") {
@@ -981,8 +979,8 @@ var require_schema = __commonJS(function(exports) {
981
979
  exports.translateTraits = translateTraits;
982
980
  });
983
981
 
984
- // ../../node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/client/index.js
985
- var require_client = __commonJS(function(exports) {
982
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/client/index.js
983
+ var require_client = __commonJS((exports) => {
986
984
  var { hasOwn: hasOwn2 } = require_transport();
987
985
  var { getSmithyContext, normalizeProvider } = require_transport();
988
986
  exports.getSmithyContext = getSmithyContext;
@@ -2061,8 +2059,8 @@ var require_client = __commonJS(function(exports) {
2061
2059
  exports.withBaseException = withBaseException;
2062
2060
  });
2063
2061
 
2064
- // ../../node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/config/index.js
2065
- var require_config = __commonJS(function(exports) {
2062
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/config/index.js
2063
+ var require_config = __commonJS((exports) => {
2066
2064
  var { homedir } = __require("os");
2067
2065
  var { sep, join: join3 } = __require("path");
2068
2066
  var { createHash: createHash2 } = __require("crypto");
@@ -2756,8 +2754,8 @@ var require_config = __commonJS(function(exports) {
2756
2754
  exports.resolveRegionConfig = resolveRegionConfig;
2757
2755
  });
2758
2756
 
2759
- // ../../node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js
2760
- var require_endpoints = __commonJS(function(exports) {
2757
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js
2758
+ var require_endpoints = __commonJS((exports) => {
2761
2759
  var { CONFIG_PREFIX_SEPARATOR, booleanSelector, SelectorType, loadConfig } = require_config();
2762
2760
  var { toEndpointV1, getSmithyContext, normalizeProvider, isValidHostLabel, hasOwn: hasOwn2 } = require_transport();
2763
2761
  exports.isValidHostLabel = isValidHostLabel;
@@ -3570,8 +3568,8 @@ var require_endpoints = __commonJS(function(exports) {
3570
3568
  exports.resolveParams = resolveParams;
3571
3569
  });
3572
3570
 
3573
- // ../../node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js
3574
- var require_serde = __commonJS(function(exports) {
3571
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js
3572
+ var require_serde = __commonJS((exports) => {
3575
3573
  var { createHmac: createHmac2, createHash: createHash2, getRandomValues } = __require("crypto");
3576
3574
  var { hasOwn: hasOwn2, HttpResponse } = require_transport();
3577
3575
  exports.hasOwn = hasOwn2;
@@ -5211,8 +5209,8 @@ ${value}\r
5211
5209
  exports.v4 = v4;
5212
5210
  });
5213
5211
 
5214
- // ../../node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.js
5215
- var require_checksum = __commonJS(function(exports) {
5212
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/checksum/index.js
5213
+ var require_checksum = __commonJS((exports) => {
5216
5214
  var { createReadStream } = __require("fs");
5217
5215
  var { Writable } = __require("stream");
5218
5216
  var { toUint8Array, concatBytes } = require_serde();
@@ -5827,8 +5825,8 @@ var require_checksum = __commonJS(function(exports) {
5827
5825
  exports.readableStreamHasher = readableStreamHasher;
5828
5826
  });
5829
5827
 
5830
- // ../../node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js
5831
- var require_event_streams = __commonJS(function(exports) {
5828
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js
5829
+ var require_event_streams = __commonJS((exports) => {
5832
5830
  var { Crc32 } = require_checksum();
5833
5831
  var { hasOwn: hasOwn2 } = require_transport();
5834
5832
  var { toHex, fromHex, toUtf8, fromUtf8 } = require_serde();
@@ -6719,8 +6717,8 @@ var require_event_streams = __commonJS(function(exports) {
6719
6717
  exports.universalEventStreamSerdeProvider = eventStreamSerdeProvider$1;
6720
6718
  });
6721
6719
 
6722
- // ../../node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js
6723
- var require_protocols = __commonJS(function(exports) {
6720
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js
6721
+ var require_protocols = __commonJS((exports) => {
6724
6722
  var { Uint8ArrayBlobAdapter, sdkStreamMixin, splitEvery, splitHeader, fromBase64, _parseEpochTimestamp, _parseRfc7231DateTime, _parseRfc3339DateTimeWithOffset, LazyJsonString, NumericValue, toUtf8, fromUtf8, generateIdempotencyToken, toBase64, dateToUtcString, quoteHeader } = require_serde();
6725
6723
  var { HttpRequest, HttpResponse, hasOwn: hasOwn2, isValidHostname } = require_transport();
6726
6724
  var { parseQueryString, parseUrl } = require_transport();
@@ -7723,8 +7721,8 @@ var require_protocols = __commonJS(function(exports) {
7723
7721
  exports.resolvedPath = resolvedPath;
7724
7722
  });
7725
7723
 
7726
- // ../../node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js
7727
- var require_retry = __commonJS(function(exports) {
7724
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js
7725
+ var require_retry = __commonJS((exports) => {
7728
7726
  var { Readable } = __require("stream");
7729
7727
  var { NoOpLogger, normalizeProvider } = require_client();
7730
7728
  var { HttpResponse, HttpRequest } = require_protocols();
@@ -8523,8 +8521,8 @@ var require_retry = __commonJS(function(exports) {
8523
8521
  exports.retryMiddlewareOptions = retryMiddlewareOptions;
8524
8522
  });
8525
8523
 
8526
- // ../../node_modules/.bun/@aws+lambda-invoke-store@0.3.0/node_modules/@aws/lambda-invoke-store/dist-cjs/invoke-store.js
8527
- var require_invoke_store = __commonJS(function(exports) {
8524
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws+lambda-invoke-store@0.3.0/node_modules/@aws/lambda-invoke-store/dist-cjs/invoke-store.js
8525
+ var require_invoke_store = __commonJS((exports) => {
8528
8526
  var PROTECTED_KEYS = {
8529
8527
  REQUEST_ID: Symbol.for("_AWS_LAMBDA_REQUEST_ID"),
8530
8528
  X_RAY_TRACE_ID: Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"),
@@ -8652,8 +8650,8 @@ var require_invoke_store = __commonJS(function(exports) {
8652
8650
  exports.InvokeStoreBase = InvokeStoreBase;
8653
8651
  });
8654
8652
 
8655
- // ../../node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/index.js
8656
- var require_dist_cjs2 = __commonJS(function(exports) {
8653
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/index.js
8654
+ var require_dist_cjs2 = __commonJS((exports) => {
8657
8655
  var { getSmithyContext, hasOwn: hasOwn2 } = require_transport();
8658
8656
  exports.getSmithyContext = getSmithyContext;
8659
8657
  var { HttpRequest } = require_protocols();
@@ -8980,8 +8978,8 @@ var require_dist_cjs2 = __commonJS(function(exports) {
8980
8978
  exports.setFeature = setFeature;
8981
8979
  });
8982
8980
 
8983
- // ../../node_modules/.bun/bowser@2.14.1/node_modules/bowser/es5.js
8984
- var require_es5 = __commonJS(function(exports, module) {
8981
+ // ../../../skills-release-055-20260909/node_modules/.bun/bowser@2.14.1/node_modules/bowser/es5.js
8982
+ var require_es5 = __commonJS((exports, module) => {
8985
8983
  (function(e, t) {
8986
8984
  typeof exports == "object" && typeof module == "object" ? module.exports = t() : typeof define == "function" && define.amd ? define([], t) : typeof exports == "object" ? exports.bowser = t() : e.bowser = t();
8987
8985
  })(exports, function() {
@@ -9820,8 +9818,8 @@ var require_es5 = __commonJS(function(exports, module) {
9820
9818
  });
9821
9819
  });
9822
9820
 
9823
- // ../../node_modules/.bun/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js
9824
- var require_client2 = __commonJS(function(exports) {
9821
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js
9822
+ var require_client2 = __commonJS((exports) => {
9825
9823
  var { Retry, RETRY_MODES } = require_retry();
9826
9824
  var { HttpRequest, parseUrl } = require_protocols();
9827
9825
  var { InvokeStore } = require_invoke_store();
@@ -10758,8 +10756,8 @@ More information can be found at: https://a.co/c895JFp`);
10758
10756
  exports.userAgentMiddleware = userAgentMiddleware;
10759
10757
  });
10760
10758
 
10761
- // ../../node_modules/.bun/@aws-sdk+checksums@3.1000.29/node_modules/@aws-sdk/checksums/dist-cjs/submodules/crc/index.js
10762
- var require_crc = __commonJS(function(exports) {
10759
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+checksums@3.1000.29/node_modules/@aws-sdk/checksums/dist-cjs/submodules/crc/index.js
10760
+ var require_crc = __commonJS((exports) => {
10763
10761
  var { Crc32, Crc32Js, Crc32Node } = require_checksum();
10764
10762
  exports.Crc32 = Crc32;
10765
10763
  exports.Crc32Js = Crc32Js;
@@ -10915,8 +10913,8 @@ var require_crc = __commonJS(function(exports) {
10915
10913
  exports.crc64NvmeCrtContainer = crc64NvmeCrtContainer;
10916
10914
  });
10917
10915
 
10918
- // ../../node_modules/.bun/@smithy+signature-v4@5.7.3/node_modules/@smithy/signature-v4/dist-cjs/index.js
10919
- var require_dist_cjs3 = __commonJS(function(exports) {
10916
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+signature-v4@5.7.3/node_modules/@smithy/signature-v4/dist-cjs/index.js
10917
+ var require_dist_cjs3 = __commonJS((exports) => {
10920
10918
  var { hasOwn: hasOwn2, fromUtf8, fromHex, toHex, toUint8Array: toUint8Array2, isArrayBuffer: isArrayBuffer2 } = require_serde();
10921
10919
  var { normalizeProvider: normalizeProvider2 } = require_client();
10922
10920
  var { escapeUri, HttpRequest: HttpRequest2 } = require_protocols();
@@ -11467,8 +11465,8 @@ ${toHex(hashedRequest)}`;
11467
11465
  exports.signatureV4aContainer = signatureV4aContainer;
11468
11466
  });
11469
11467
 
11470
- // ../../node_modules/.bun/@aws-sdk+signature-v4-multi-region@3.996.46/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js
11471
- var require_dist_cjs4 = __commonJS(function(exports) {
11468
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+signature-v4-multi-region@3.996.46/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js
11469
+ var require_dist_cjs4 = __commonJS((exports) => {
11472
11470
  var { SignatureV4, signatureV4aContainer } = require_dist_cjs3();
11473
11471
  var signatureV4CrtContainer = {
11474
11472
  CrtSignerV4: null
@@ -11599,8 +11597,8 @@ var require_dist_cjs4 = __commonJS(function(exports) {
11599
11597
  exports.signatureV4CrtContainer = signatureV4CrtContainer;
11600
11598
  });
11601
11599
 
11602
- // ../../node_modules/.bun/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js
11603
- var require_util = __commonJS(function(exports) {
11600
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js
11601
+ var require_util = __commonJS((exports) => {
11604
11602
  var { buildQueryString } = require_protocols();
11605
11603
  var validate = (str) => typeof str === "string" && str.indexOf("arn:") === 0 && str.split(":").length >= 6;
11606
11604
  var parse = (arn) => {
@@ -11657,8 +11655,8 @@ var require_util = __commonJS(function(exports) {
11657
11655
  exports.validate = validate;
11658
11656
  });
11659
11657
 
11660
- // ../../node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js
11661
- var require_cbor = __commonJS(function(exports) {
11658
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+core@3.33.3/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js
11659
+ var require_cbor = __commonJS((exports) => {
11662
11660
  var { nv, NumericValue, calculateBodyLength, generateIdempotencyToken, fromBase64, _parseEpochTimestamp } = require_serde();
11663
11661
  var { hasOwn: hasOwn2, getSmithyContext } = require_transport();
11664
11662
  var { HttpRequest: HttpRequest2, collectBody, SerdeContext, RpcProtocol } = require_protocols();
@@ -14107,8 +14105,8 @@ var require_cbor = __commonJS(function(exports) {
14107
14105
  exports.tagSymbol = tagSymbol;
14108
14106
  });
14109
14107
 
14110
- // ../../node_modules/.bun/@aws-sdk+xml-builder@3.972.40/node_modules/@aws-sdk/xml-builder/dist-cjs/index.js
14111
- var require_dist_cjs5 = __commonJS(function(exports) {
14108
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+xml-builder@3.972.40/node_modules/@aws-sdk/xml-builder/dist-cjs/index.js
14109
+ var require_dist_cjs5 = __commonJS((exports) => {
14112
14110
  var ATTR_ESCAPE_RE = /[&<>"]/g;
14113
14111
  var ATTR_ESCAPE_MAP = {
14114
14112
  "&": "&amp;",
@@ -14475,8 +14473,8 @@ var require_dist_cjs5 = __commonJS(function(exports) {
14475
14473
  exports.parseXML = parseXML;
14476
14474
  });
14477
14475
 
14478
- // ../../node_modules/.bun/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js
14479
- var require_protocols2 = __commonJS(function(exports) {
14476
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js
14477
+ var require_protocols2 = __commonJS((exports) => {
14480
14478
  var { SmithyRpcV2CborProtocol, loadSmithyRpcV2CborErrorCode } = require_cbor();
14481
14479
  var { TypeRegistry, NormalizedSchema, deref } = require_schema();
14482
14480
  var { decorateServiceException, getValueFromTextNode } = require_client();
@@ -17316,8 +17314,8 @@ var require_protocols2 = __commonJS(function(exports) {
17316
17314
  exports.parseXmlErrorBody = parseXmlErrorBody;
17317
17315
  });
17318
17316
 
17319
- // ../../node_modules/.bun/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js
17320
- var require_httpAuthSchemes = __commonJS(function(exports) {
17317
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+core@3.977.9/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js
17318
+ var require_httpAuthSchemes = __commonJS((exports) => {
17321
17319
  var { ProviderError, booleanSelector: booleanSelector2, SelectorType: SelectorType3, loadConfig } = require_config();
17322
17320
  var { setCredentialFeature } = require_client2();
17323
17321
  var { normalizeProvider: normalizeProvider2, memoizeIdentityProvider, isIdentityExpired, doesIdentityRequireRefresh } = require_dist_cjs2();
@@ -17646,7 +17644,7 @@ var require_httpAuthSchemes = __commonJS(function(exports) {
17646
17644
  exports.validateSigningProperties = validateSigningProperties;
17647
17645
  });
17648
17646
 
17649
- // ../../node_modules/.bun/@aws-sdk+credential-provider-env@3.972.70/node_modules/@aws-sdk/credential-provider-env/dist-es/fromEnv.js
17647
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-env@3.972.70/node_modules/@aws-sdk/credential-provider-env/dist-es/fromEnv.js
17650
17648
  var import_client8, import_config, ENV_KEY = "AWS_ACCESS_KEY_ID", ENV_SECRET = "AWS_SECRET_ACCESS_KEY", ENV_SESSION = "AWS_SESSION_TOKEN", ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION", ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE", ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID", fromEnv = (init) => async () => {
17651
17649
  init?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");
17652
17650
  const accessKeyId = process.env[ENV_KEY];
@@ -17674,22 +17672,22 @@ var init_fromEnv = __esm(() => {
17674
17672
  import_config = __toESM(require_config(), 1);
17675
17673
  });
17676
17674
 
17677
- // ../../node_modules/.bun/@aws-sdk+credential-provider-env@3.972.70/node_modules/@aws-sdk/credential-provider-env/dist-es/index.js
17675
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-env@3.972.70/node_modules/@aws-sdk/credential-provider-env/dist-es/index.js
17678
17676
  var exports_dist_es = {};
17679
17677
  __export(exports_dist_es, {
17680
- ENV_ACCOUNT_ID: () => ENV_ACCOUNT_ID,
17681
- ENV_CREDENTIAL_SCOPE: () => ENV_CREDENTIAL_SCOPE,
17682
- ENV_EXPIRATION: () => ENV_EXPIRATION,
17683
- ENV_KEY: () => ENV_KEY,
17684
- ENV_SECRET: () => ENV_SECRET,
17678
+ fromEnv: () => fromEnv,
17685
17679
  ENV_SESSION: () => ENV_SESSION,
17686
- fromEnv: () => fromEnv
17680
+ ENV_SECRET: () => ENV_SECRET,
17681
+ ENV_KEY: () => ENV_KEY,
17682
+ ENV_EXPIRATION: () => ENV_EXPIRATION,
17683
+ ENV_CREDENTIAL_SCOPE: () => ENV_CREDENTIAL_SCOPE,
17684
+ ENV_ACCOUNT_ID: () => ENV_ACCOUNT_ID
17687
17685
  });
17688
17686
  var init_dist_es = __esm(() => {
17689
17687
  init_fromEnv();
17690
17688
  });
17691
17689
 
17692
- // ../../node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/ImdsCredentials.js
17690
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/ImdsCredentials.js
17693
17691
  var isImdsCredentials = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.AccessKeyId === "string" && typeof arg.SecretAccessKey === "string" && typeof arg.Token === "string" && typeof arg.Expiration === "string", fromImdsCredentials = (creds) => ({
17694
17692
  accessKeyId: creds.AccessKeyId,
17695
17693
  secretAccessKey: creds.SecretAccessKey,
@@ -17698,14 +17696,14 @@ var isImdsCredentials = (arg) => Boolean(arg) && typeof arg === "object" && type
17698
17696
  ...creds.AccountId && { accountId: creds.AccountId }
17699
17697
  });
17700
17698
 
17701
- // ../../node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/RemoteProviderInit.js
17699
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/RemoteProviderInit.js
17702
17700
  var DEFAULT_TIMEOUT = 1000, DEFAULT_MAX_RETRIES = 0, providerConfigFromInit = ({ maxRetries = DEFAULT_MAX_RETRIES, timeout = DEFAULT_TIMEOUT }) => ({ maxRetries, timeout });
17703
17701
 
17704
- // ../../node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/node-http.js
17702
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/node-http.js
17705
17703
  import node_http from "http";
17706
17704
  var init_node_http = () => {};
17707
17705
 
17708
- // ../../node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js
17706
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js
17709
17707
  function httpRequest(options) {
17710
17708
  return new Promise((resolve, reject) => {
17711
17709
  const req = node_http.request({
@@ -17745,7 +17743,7 @@ var init_httpRequest = __esm(() => {
17745
17743
  import_config2 = __toESM(require_config(), 1);
17746
17744
  });
17747
17745
 
17748
- // ../../node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/retry.js
17746
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/retry.js
17749
17747
  var retry = (toRetry, maxRetries) => {
17750
17748
  let promise = toRetry();
17751
17749
  for (let i2 = 0;i2 < maxRetries; i2++) {
@@ -17754,7 +17752,7 @@ var retry = (toRetry, maxRetries) => {
17754
17752
  return promise;
17755
17753
  };
17756
17754
 
17757
- // ../../node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/fromContainerMetadata.js
17755
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/fromContainerMetadata.js
17758
17756
  var import_config3, ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI", ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI", ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN", fromContainerMetadata = (init = {}) => {
17759
17757
  const { timeout, maxRetries } = providerConfigFromInit(init);
17760
17758
  return () => retry(async () => {
@@ -17824,7 +17822,7 @@ var init_fromContainerMetadata = __esm(() => {
17824
17822
  GREENGRASS_PROTOCOLS = new Set(["http:", "https:"]);
17825
17823
  });
17826
17824
 
17827
- // ../../node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/error/InstanceMetadataV1FallbackError.js
17825
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/error/InstanceMetadataV1FallbackError.js
17828
17826
  var import_config4, InstanceMetadataV1FallbackError;
17829
17827
  var init_InstanceMetadataV1FallbackError = __esm(() => {
17830
17828
  import_config4 = __toESM(require_config(), 1);
@@ -17839,7 +17837,7 @@ var init_InstanceMetadataV1FallbackError = __esm(() => {
17839
17837
  };
17840
17838
  });
17841
17839
 
17842
- // ../../node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/config/Endpoint.js
17840
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/config/Endpoint.js
17843
17841
  var Endpoint;
17844
17842
  var init_Endpoint = __esm(() => {
17845
17843
  (function(Endpoint2) {
@@ -17848,7 +17846,7 @@ var init_Endpoint = __esm(() => {
17848
17846
  })(Endpoint || (Endpoint = {}));
17849
17847
  });
17850
17848
 
17851
- // ../../node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointConfigOptions.js
17849
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointConfigOptions.js
17852
17850
  var ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT", CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint", ENDPOINT_CONFIG_OPTIONS;
17853
17851
  var init_EndpointConfigOptions = __esm(() => {
17854
17852
  ENDPOINT_CONFIG_OPTIONS = {
@@ -17858,7 +17856,7 @@ var init_EndpointConfigOptions = __esm(() => {
17858
17856
  };
17859
17857
  });
17860
17858
 
17861
- // ../../node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointMode.js
17859
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointMode.js
17862
17860
  var EndpointMode;
17863
17861
  var init_EndpointMode = __esm(() => {
17864
17862
  (function(EndpointMode2) {
@@ -17867,7 +17865,7 @@ var init_EndpointMode = __esm(() => {
17867
17865
  })(EndpointMode || (EndpointMode = {}));
17868
17866
  });
17869
17867
 
17870
- // ../../node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointModeConfigOptions.js
17868
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointModeConfigOptions.js
17871
17869
  var ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE", CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode", ENDPOINT_MODE_CONFIG_OPTIONS;
17872
17870
  var init_EndpointModeConfigOptions = __esm(() => {
17873
17871
  init_EndpointMode();
@@ -17878,7 +17876,7 @@ var init_EndpointModeConfigOptions = __esm(() => {
17878
17876
  };
17879
17877
  });
17880
17878
 
17881
- // ../../node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/utils/getInstanceMetadataEndpoint.js
17879
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/utils/getInstanceMetadataEndpoint.js
17882
17880
  var import_config5, import_protocols, getInstanceMetadataEndpoint = async () => import_protocols.parseUrl(await getFromEndpointConfig() || await getFromEndpointModeConfig()), getFromEndpointConfig = async () => import_config5.loadConfig(ENDPOINT_CONFIG_OPTIONS)(), getFromEndpointModeConfig = async () => {
17883
17881
  const endpointMode = await import_config5.loadConfig(ENDPOINT_MODE_CONFIG_OPTIONS)();
17884
17882
  switch (endpointMode) {
@@ -17899,7 +17897,7 @@ var init_getInstanceMetadataEndpoint = __esm(() => {
17899
17897
  import_protocols = __toESM(require_protocols(), 1);
17900
17898
  });
17901
17899
 
17902
- // ../../node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/utils/getExtendedInstanceMetadataCredentials.js
17900
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/utils/getExtendedInstanceMetadataCredentials.js
17903
17901
  var STATIC_STABILITY_REFRESH_INTERVAL_SECONDS, STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS, STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html", getExtendedInstanceMetadataCredentials = (credentials, logger) => {
17904
17902
  const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS);
17905
17903
  const newExpiration = new Date(Date.now() + refreshInterval * 1000);
@@ -17917,7 +17915,7 @@ var init_getExtendedInstanceMetadataCredentials = __esm(() => {
17917
17915
  STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60;
17918
17916
  });
17919
17917
 
17920
- // ../../node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/utils/staticStabilityProvider.js
17918
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/utils/staticStabilityProvider.js
17921
17919
  var staticStabilityProvider = (provider, options = {}) => {
17922
17920
  const logger = options?.logger || console;
17923
17921
  let pastCredentials;
@@ -17944,7 +17942,7 @@ var init_staticStabilityProvider = __esm(() => {
17944
17942
  init_getExtendedInstanceMetadataCredentials();
17945
17943
  });
17946
17944
 
17947
- // ../../node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/fromInstanceMetadata.js
17945
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/fromInstanceMetadata.js
17948
17946
  var import_config6, IMDS_PATH = "/latest/meta-data/iam/security-credentials/", IMDS_TOKEN_PATH = "/latest/api/token", AWS_EC2_METADATA_V1_DISABLED = "AWS_EC2_METADATA_V1_DISABLED", PROFILE_AWS_EC2_METADATA_V1_DISABLED = "ec2_metadata_v1_disabled", X_AWS_EC2_METADATA_TOKEN = "x-aws-ec2-metadata-token", fromInstanceMetadata = (init = {}) => staticStabilityProvider(getInstanceMetadataProvider(init), { logger: init.logger }), getInstanceMetadataProvider = (init = {}) => {
17949
17947
  let disableFetchToken = false;
17950
17948
  const { logger, profile } = init;
@@ -18064,20 +18062,20 @@ var init_fromInstanceMetadata = __esm(() => {
18064
18062
  import_config6 = __toESM(require_config(), 1);
18065
18063
  });
18066
18064
 
18067
- // ../../node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/index.js
18065
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+credential-provider-imds@4.5.2/node_modules/@smithy/credential-provider-imds/dist-es/index.js
18068
18066
  var exports_dist_es2 = {};
18069
18067
  __export(exports_dist_es2, {
18070
- DEFAULT_MAX_RETRIES: () => DEFAULT_MAX_RETRIES,
18071
- DEFAULT_TIMEOUT: () => DEFAULT_TIMEOUT,
18072
- ENV_CMDS_AUTH_TOKEN: () => ENV_CMDS_AUTH_TOKEN,
18073
- ENV_CMDS_FULL_URI: () => ENV_CMDS_FULL_URI,
18074
- ENV_CMDS_RELATIVE_URI: () => ENV_CMDS_RELATIVE_URI,
18075
- Endpoint: () => Endpoint,
18076
- fromContainerMetadata: () => fromContainerMetadata,
18077
- fromInstanceMetadata: () => fromInstanceMetadata,
18078
- getInstanceMetadataEndpoint: () => getInstanceMetadataEndpoint,
18068
+ providerConfigFromInit: () => providerConfigFromInit,
18079
18069
  httpRequest: () => httpRequest,
18080
- providerConfigFromInit: () => providerConfigFromInit
18070
+ getInstanceMetadataEndpoint: () => getInstanceMetadataEndpoint,
18071
+ fromInstanceMetadata: () => fromInstanceMetadata,
18072
+ fromContainerMetadata: () => fromContainerMetadata,
18073
+ Endpoint: () => Endpoint,
18074
+ ENV_CMDS_RELATIVE_URI: () => ENV_CMDS_RELATIVE_URI,
18075
+ ENV_CMDS_FULL_URI: () => ENV_CMDS_FULL_URI,
18076
+ ENV_CMDS_AUTH_TOKEN: () => ENV_CMDS_AUTH_TOKEN,
18077
+ DEFAULT_TIMEOUT: () => DEFAULT_TIMEOUT,
18078
+ DEFAULT_MAX_RETRIES: () => DEFAULT_MAX_RETRIES
18081
18079
  });
18082
18080
  var init_dist_es2 = __esm(() => {
18083
18081
  init_fromContainerMetadata();
@@ -18087,8 +18085,8 @@ var init_dist_es2 = __esm(() => {
18087
18085
  init_Endpoint();
18088
18086
  });
18089
18087
 
18090
- // ../../node_modules/.bun/@smithy+node-http-handler@4.12.1/node_modules/@smithy/node-http-handler/dist-cjs/index.js
18091
- var require_dist_cjs6 = __commonJS(function(exports) {
18088
+ // ../../../skills-release-055-20260909/node_modules/.bun/@smithy+node-http-handler@4.12.1/node_modules/@smithy/node-http-handler/dist-cjs/index.js
18089
+ var require_dist_cjs6 = __commonJS((exports) => {
18092
18090
  var { hasOwn: hasOwn2 } = require_serde();
18093
18091
  var { streamCollector } = require_serde();
18094
18092
  exports.streamCollector = streamCollector;
@@ -18913,7 +18911,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
18913
18911
  exports.NodeHttpHandler = NodeHttpHandler;
18914
18912
  });
18915
18913
 
18916
- // ../../node_modules/.bun/@aws-sdk+credential-provider-http@3.972.72/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/checkUrl.js
18914
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-http@3.972.72/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/checkUrl.js
18917
18915
  var import_config7, ECS_CONTAINER_HOST = "169.254.170.2", EKS_CONTAINER_HOST_IPv4 = "169.254.170.23", EKS_CONTAINER_HOST_IPv6 = "[fd00:ec2::23]", checkUrl = (url, logger) => {
18918
18916
  if (url.protocol === "https:") {
18919
18917
  return;
@@ -18947,7 +18945,7 @@ var init_checkUrl = __esm(() => {
18947
18945
  import_config7 = __toESM(require_config(), 1);
18948
18946
  });
18949
18947
 
18950
- // ../../node_modules/.bun/@aws-sdk+credential-provider-http@3.972.72/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/requestHelpers.js
18948
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-http@3.972.72/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/requestHelpers.js
18951
18949
  function createGetRequest(url) {
18952
18950
  return new import_protocols2.HttpRequest({
18953
18951
  protocol: url.protocol,
@@ -18996,7 +18994,7 @@ var init_requestHelpers = __esm(() => {
18996
18994
  import_serde2 = __toESM(require_serde(), 1);
18997
18995
  });
18998
18996
 
18999
- // ../../node_modules/.bun/@aws-sdk+credential-provider-http@3.972.72/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/retry-wrapper.js
18997
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-http@3.972.72/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/retry-wrapper.js
19000
18998
  var retryWrapper = (toRetry, maxRetries, delayMs) => {
19001
18999
  return async () => {
19002
19000
  for (let i2 = 0;i2 < maxRetries; ++i2) {
@@ -19010,7 +19008,7 @@ var retryWrapper = (toRetry, maxRetries, delayMs) => {
19010
19008
  };
19011
19009
  };
19012
19010
 
19013
- // ../../node_modules/.bun/@aws-sdk+credential-provider-http@3.972.72/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js
19011
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-http@3.972.72/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js
19014
19012
  import fs from "fs/promises";
19015
19013
  var import_client9, import_config9, import_node_http_handler, AWS_CONTAINER_CREDENTIALS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI", DEFAULT_LINK_LOCAL_HOST = "http://169.254.170.2", AWS_CONTAINER_CREDENTIALS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI", AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE", AWS_CONTAINER_AUTHORIZATION_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN", fromHttp = (options = {}) => {
19016
19014
  options.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");
@@ -19076,7 +19074,7 @@ var init_fromHttp = __esm(() => {
19076
19074
  import_node_http_handler = __toESM(require_dist_cjs6(), 1);
19077
19075
  });
19078
19076
 
19079
- // ../../node_modules/.bun/@aws-sdk+credential-provider-http@3.972.72/node_modules/@aws-sdk/credential-provider-http/dist-es/index.js
19077
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-http@3.972.72/node_modules/@aws-sdk/credential-provider-http/dist-es/index.js
19080
19078
  var exports_dist_es3 = {};
19081
19079
  __export(exports_dist_es3, {
19082
19080
  fromHttp: () => fromHttp
@@ -19085,17 +19083,17 @@ var init_dist_es3 = __esm(() => {
19085
19083
  init_fromHttp();
19086
19084
  });
19087
19085
 
19088
- // ../../node_modules/.bun/@aws-sdk+credential-provider-sso@3.973.14/node_modules/@aws-sdk/credential-provider-sso/dist-es/isSsoProfile.js
19086
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-sso@3.973.14/node_modules/@aws-sdk/credential-provider-sso/dist-es/isSsoProfile.js
19089
19087
  var isSsoProfile = (arg) => arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string");
19090
19088
 
19091
- // ../../node_modules/.bun/@aws-sdk+token-providers@3.1116.0/node_modules/@aws-sdk/token-providers/dist-es/constants.js
19089
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+token-providers@3.1116.0/node_modules/@aws-sdk/token-providers/dist-es/constants.js
19092
19090
  var EXPIRE_WINDOW_MS, REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`;
19093
19091
  var init_constants = __esm(() => {
19094
19092
  EXPIRE_WINDOW_MS = 5 * 60 * 1000;
19095
19093
  });
19096
19094
 
19097
- // ../../node_modules/.bun/@aws-sdk+nested-clients@3.997.44/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js
19098
- var require_sso_oidc = __commonJS(function(exports) {
19095
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+nested-clients@3.997.44/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js
19096
+ var require_sso_oidc = __commonJS((exports) => {
19099
19097
  var { awsEndpointFunctions: awsEndpointFunctions2, emitWarningIfUnsupportedVersion: emitWarningIfUnsupportedVersion$1, createDefaultUserAgentProvider, NODE_APP_ID_CONFIG_OPTIONS, getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, resolveUserAgentConfig, resolveHostHeaderConfig, getUserAgentPlugin, getHostHeaderPlugin, getLoggerPlugin, getRecursionDetectionPlugin } = require_client2();
19100
19098
  var { NoAuthSigner, getHttpAuthSchemeEndpointRuleSetPlugin, DefaultIdentityProviderConfig, getHttpSigningPlugin } = require_dist_cjs2();
19101
19099
  var { normalizeProvider: normalizeProvider3, getSmithyContext: getSmithyContext3, ServiceException, NoOpLogger: NoOpLogger2, emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode, getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig, Client, makeBuilder: makeBuilder2, createAggregatedClient } = require_client();
@@ -19849,7 +19847,7 @@ var require_sso_oidc = __commonJS(function(exports) {
19849
19847
  exports.errorTypeRegistries = errorTypeRegistries2;
19850
19848
  });
19851
19849
 
19852
- // ../../node_modules/.bun/@aws-sdk+token-providers@3.1116.0/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js
19850
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+token-providers@3.1116.0/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js
19853
19851
  var getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => {
19854
19852
  const { SSOOIDCClient } = await Promise.resolve().then(() => __toESM(require_sso_oidc(), 1));
19855
19853
  const coalesce = (prop) => init.clientConfig?.[prop] ?? init.parentClientConfig?.[prop] ?? callerClientConfig?.[prop];
@@ -19861,7 +19859,7 @@ var getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => {
19861
19859
  return ssoOidcClient;
19862
19860
  };
19863
19861
 
19864
- // ../../node_modules/.bun/@aws-sdk+token-providers@3.1116.0/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js
19862
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+token-providers@3.1116.0/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js
19865
19863
  var getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}, callerClientConfig) => {
19866
19864
  const { CreateTokenCommand } = await Promise.resolve().then(() => __toESM(require_sso_oidc(), 1));
19867
19865
  const ssoOidcClient = await getSsoOidcClient(ssoRegion, init, callerClientConfig);
@@ -19874,7 +19872,7 @@ var getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}, callerClientConf
19874
19872
  };
19875
19873
  var init_getNewSsoOidcToken = () => {};
19876
19874
 
19877
- // ../../node_modules/.bun/@aws-sdk+token-providers@3.1116.0/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js
19875
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+token-providers@3.1116.0/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js
19878
19876
  var import_config11, validateTokenExpiry = (token) => {
19879
19877
  if (token.expiration && token.expiration.getTime() < Date.now()) {
19880
19878
  throw new import_config11.TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false);
@@ -19885,7 +19883,7 @@ var init_validateTokenExpiry = __esm(() => {
19885
19883
  import_config11 = __toESM(require_config(), 1);
19886
19884
  });
19887
19885
 
19888
- // ../../node_modules/.bun/@aws-sdk+token-providers@3.1116.0/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js
19886
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+token-providers@3.1116.0/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js
19889
19887
  var import_config12, validateTokenKey = (key, value, forRefresh = false) => {
19890
19888
  if (typeof value === "undefined") {
19891
19889
  throw new import_config12.TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false);
@@ -19896,7 +19894,7 @@ var init_validateTokenKey = __esm(() => {
19896
19894
  import_config12 = __toESM(require_config(), 1);
19897
19895
  });
19898
19896
 
19899
- // ../../node_modules/.bun/@aws-sdk+token-providers@3.1116.0/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js
19897
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+token-providers@3.1116.0/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js
19900
19898
  import { promises as fsPromises } from "fs";
19901
19899
  var import_config13, writeFile, writeSSOTokenToFile = (id, ssoToken) => {
19902
19900
  const tokenFilepath = import_config13.getSSOTokenFilepath(id);
@@ -19908,7 +19906,7 @@ var init_writeSSOTokenToFile = __esm(() => {
19908
19906
  ({ writeFile } = fsPromises);
19909
19907
  });
19910
19908
 
19911
- // ../../node_modules/.bun/@aws-sdk+token-providers@3.1116.0/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js
19909
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+token-providers@3.1116.0/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js
19912
19910
  var import_config14, lastRefreshAttemptTimes, fromSso = (init = {}) => async ({ callerClientConfig } = {}) => {
19913
19911
  init.logger?.debug("@aws-sdk/token-providers - fromSso");
19914
19912
  const profiles = await import_config14.parseKnownFiles(init);
@@ -19991,12 +19989,12 @@ var init_fromSso = __esm(() => {
19991
19989
  lastRefreshAttemptTimes = new Map;
19992
19990
  });
19993
19991
 
19994
- // ../../node_modules/.bun/@aws-sdk+token-providers@3.1116.0/node_modules/@aws-sdk/token-providers/dist-es/index.js
19992
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+token-providers@3.1116.0/node_modules/@aws-sdk/token-providers/dist-es/index.js
19995
19993
  var init_dist_es4 = __esm(() => {
19996
19994
  init_fromSso();
19997
19995
  });
19998
19996
 
19999
- // ../../node_modules/.bun/@aws-sdk+nested-clients@3.997.44/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js
19997
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+nested-clients@3.997.44/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js
20000
19998
  function createAwsAuthSigv4HttpAuthOption2(authParameters) {
20001
19999
  return {
20002
20000
  schemeId: "aws.auth#sigv4",
@@ -20444,17 +20442,17 @@ var init_sso = __esm(() => {
20444
20442
  $SSOClient = SSOClient;
20445
20443
  });
20446
20444
 
20447
- // ../../node_modules/.bun/@aws-sdk+credential-provider-sso@3.973.14/node_modules/@aws-sdk/credential-provider-sso/dist-es/loadSso.js
20445
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-sso@3.973.14/node_modules/@aws-sdk/credential-provider-sso/dist-es/loadSso.js
20448
20446
  var exports_loadSso = {};
20449
20447
  __export(exports_loadSso, {
20450
- GetRoleCredentialsCommand: () => $GetRoleCredentialsCommand,
20451
- SSOClient: () => $SSOClient
20448
+ SSOClient: () => $SSOClient,
20449
+ GetRoleCredentialsCommand: () => $GetRoleCredentialsCommand
20452
20450
  });
20453
20451
  var init_loadSso = __esm(() => {
20454
20452
  init_sso();
20455
20453
  });
20456
20454
 
20457
- // ../../node_modules/.bun/@aws-sdk+credential-provider-sso@3.973.14/node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js
20455
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-sso@3.973.14/node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js
20458
20456
  var import_client10, import_config15, SHOULD_FAIL_CREDENTIAL_CHAIN = false, resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, callerClientConfig, profile, filepath, configFilepath, ignoreCache, logger }) => {
20459
20457
  let token;
20460
20458
  const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`;
@@ -20543,7 +20541,7 @@ var init_resolveSSOCredentials = __esm(() => {
20543
20541
  import_config15 = __toESM(require_config(), 1);
20544
20542
  });
20545
20543
 
20546
- // ../../node_modules/.bun/@aws-sdk+credential-provider-sso@3.973.14/node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js
20544
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-sso@3.973.14/node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js
20547
20545
  var import_config16, validateSsoProfile = (profile, logger) => {
20548
20546
  const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;
20549
20547
  if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {
@@ -20556,7 +20554,7 @@ var init_validateSsoProfile = __esm(() => {
20556
20554
  import_config16 = __toESM(require_config(), 1);
20557
20555
  });
20558
20556
 
20559
- // ../../node_modules/.bun/@aws-sdk+credential-provider-sso@3.973.14/node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js
20557
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-sso@3.973.14/node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js
20560
20558
  var import_config17, fromSSO = (init = {}) => async ({ callerClientConfig } = {}) => {
20561
20559
  init.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");
20562
20560
  const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init;
@@ -20638,19 +20636,19 @@ var init_fromSSO = __esm(() => {
20638
20636
  import_config17 = __toESM(require_config(), 1);
20639
20637
  });
20640
20638
 
20641
- // ../../node_modules/.bun/@aws-sdk+credential-provider-sso@3.973.14/node_modules/@aws-sdk/credential-provider-sso/dist-es/index.js
20639
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-sso@3.973.14/node_modules/@aws-sdk/credential-provider-sso/dist-es/index.js
20642
20640
  var exports_dist_es4 = {};
20643
20641
  __export(exports_dist_es4, {
20644
- fromSSO: () => fromSSO,
20642
+ validateSsoProfile: () => validateSsoProfile,
20645
20643
  isSsoProfile: () => isSsoProfile,
20646
- validateSsoProfile: () => validateSsoProfile
20644
+ fromSSO: () => fromSSO
20647
20645
  });
20648
20646
  var init_dist_es5 = __esm(() => {
20649
20647
  init_fromSSO();
20650
20648
  init_validateSsoProfile();
20651
20649
  });
20652
20650
 
20653
- // ../../node_modules/.bun/@aws-sdk+credential-provider-ini@3.973.15/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveCredentialSource.js
20651
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-ini@3.973.15/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveCredentialSource.js
20654
20652
  var import_client11, import_config18, resolveCredentialSource = (credentialSource, profileName, logger) => {
20655
20653
  const sourceProvidersMap = {
20656
20654
  EcsContainer: async (options) => {
@@ -20681,8 +20679,8 @@ var init_resolveCredentialSource = __esm(() => {
20681
20679
  import_config18 = __toESM(require_config(), 1);
20682
20680
  });
20683
20681
 
20684
- // ../../node_modules/.bun/@aws-sdk+nested-clients@3.997.44/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js
20685
- var require_sts = __commonJS(function(exports) {
20682
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+nested-clients@3.997.44/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js
20683
+ var require_sts = __commonJS((exports) => {
20686
20684
  var { awsEndpointFunctions: awsEndpointFunctions3, emitWarningIfUnsupportedVersion: emitWarningIfUnsupportedVersion$12, createDefaultUserAgentProvider: createDefaultUserAgentProvider2, NODE_APP_ID_CONFIG_OPTIONS: NODE_APP_ID_CONFIG_OPTIONS2, getAwsRegionExtensionConfiguration: getAwsRegionExtensionConfiguration2, resolveAwsRegionExtensionConfiguration: resolveAwsRegionExtensionConfiguration2, resolveUserAgentConfig: resolveUserAgentConfig2, resolveHostHeaderConfig: resolveHostHeaderConfig2, getUserAgentPlugin: getUserAgentPlugin2, getHostHeaderPlugin: getHostHeaderPlugin2, getLoggerPlugin: getLoggerPlugin2, getRecursionDetectionPlugin: getRecursionDetectionPlugin2, setCredentialFeature: setCredentialFeature5, stsRegionDefaultResolver } = require_client2();
20687
20685
  var { NoAuthSigner: NoAuthSigner2, getHttpAuthSchemeEndpointRuleSetPlugin: getHttpAuthSchemeEndpointRuleSetPlugin2, DefaultIdentityProviderConfig: DefaultIdentityProviderConfig2, getHttpSigningPlugin: getHttpSigningPlugin2 } = require_dist_cjs2();
20688
20686
  var { normalizeProvider: normalizeProvider4, getSmithyContext: getSmithyContext4, ServiceException: ServiceException2, NoOpLogger: NoOpLogger3, emitWarningIfUnsupportedVersion: emitWarningIfUnsupportedVersion2, loadConfigsForDefaultMode: loadConfigsForDefaultMode2, getDefaultExtensionConfiguration: getDefaultExtensionConfiguration2, resolveDefaultRuntimeConfig: resolveDefaultRuntimeConfig2, Client: Client2, makeBuilder: makeBuilder3, createAggregatedClient: createAggregatedClient2 } = require_client();
@@ -21703,7 +21701,7 @@ var require_sts = __commonJS(function(exports) {
21703
21701
  exports.getDefaultRoleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity;
21704
21702
  });
21705
21703
 
21706
- // ../../node_modules/.bun/@aws-sdk+credential-provider-ini@3.973.15/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveAssumeRoleCredentials.js
21704
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-ini@3.973.15/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveAssumeRoleCredentials.js
21707
21705
  var import_client12, import_config19, isAssumeRoleProfile = (arg, { profile = "default", logger } = {}) => {
21708
21706
  return Boolean(arg) && typeof arg === "object" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 && ["undefined", "string"].indexOf(typeof arg.external_id) > -1 && ["undefined", "string"].indexOf(typeof arg.mfa_serial) > -1 && (isAssumeRoleWithSourceProfile(arg, { profile, logger }) || isCredentialSourceProfile(arg, { profile, logger }));
21709
21707
  }, isAssumeRoleWithSourceProfile = (arg, { profile, logger }) => {
@@ -21771,8 +21769,8 @@ var init_resolveAssumeRoleCredentials = __esm(() => {
21771
21769
  import_config19 = __toESM(require_config(), 1);
21772
21770
  });
21773
21771
 
21774
- // ../../node_modules/.bun/@aws-sdk+nested-clients@3.997.44/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js
21775
- var require_signin = __commonJS(function(exports) {
21772
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+nested-clients@3.997.44/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js
21773
+ var require_signin = __commonJS((exports) => {
21776
21774
  var { awsEndpointFunctions: awsEndpointFunctions3, emitWarningIfUnsupportedVersion: emitWarningIfUnsupportedVersion$12, createDefaultUserAgentProvider: createDefaultUserAgentProvider2, NODE_APP_ID_CONFIG_OPTIONS: NODE_APP_ID_CONFIG_OPTIONS2, getAwsRegionExtensionConfiguration: getAwsRegionExtensionConfiguration2, resolveAwsRegionExtensionConfiguration: resolveAwsRegionExtensionConfiguration2, resolveUserAgentConfig: resolveUserAgentConfig2, resolveHostHeaderConfig: resolveHostHeaderConfig2, getUserAgentPlugin: getUserAgentPlugin2, getHostHeaderPlugin: getHostHeaderPlugin2, getLoggerPlugin: getLoggerPlugin2, getRecursionDetectionPlugin: getRecursionDetectionPlugin2 } = require_client2();
21777
21775
  var { NoAuthSigner: NoAuthSigner2, getHttpAuthSchemeEndpointRuleSetPlugin: getHttpAuthSchemeEndpointRuleSetPlugin2, DefaultIdentityProviderConfig: DefaultIdentityProviderConfig2, getHttpSigningPlugin: getHttpSigningPlugin2 } = require_dist_cjs2();
21778
21776
  var { normalizeProvider: normalizeProvider4, getSmithyContext: getSmithyContext4, ServiceException: ServiceException2, NoOpLogger: NoOpLogger3, emitWarningIfUnsupportedVersion: emitWarningIfUnsupportedVersion2, loadConfigsForDefaultMode: loadConfigsForDefaultMode2, getDefaultExtensionConfiguration: getDefaultExtensionConfiguration2, resolveDefaultRuntimeConfig: resolveDefaultRuntimeConfig2, Client: Client2, makeBuilder: makeBuilder3, createAggregatedClient: createAggregatedClient2 } = require_client();
@@ -22503,7 +22501,7 @@ var require_signin = __commonJS(function(exports) {
22503
22501
  exports.errorTypeRegistries = errorTypeRegistries3;
22504
22502
  });
22505
22503
 
22506
- // ../../node_modules/.bun/@aws-sdk+credential-provider-login@3.972.77/node_modules/@aws-sdk/credential-provider-login/dist-es/LoginCredentialsFetcher.js
22504
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-login@3.972.77/node_modules/@aws-sdk/credential-provider-login/dist-es/LoginCredentialsFetcher.js
22507
22505
  import { createHash as createHash2, createPrivateKey, createPublicKey, sign } from "crypto";
22508
22506
  import { promises as fs2 } from "fs";
22509
22507
  import { homedir } from "os";
@@ -22767,7 +22765,7 @@ var init_LoginCredentialsFetcher = __esm(() => {
22767
22765
  };
22768
22766
  });
22769
22767
 
22770
- // ../../node_modules/.bun/@aws-sdk+credential-provider-login@3.972.77/node_modules/@aws-sdk/credential-provider-login/dist-es/fromLoginCredentials.js
22768
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-login@3.972.77/node_modules/@aws-sdk/credential-provider-login/dist-es/fromLoginCredentials.js
22771
22769
  var import_client13, import_config21, fromLoginCredentials = (init) => async ({ callerClientConfig } = {}) => {
22772
22770
  init?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");
22773
22771
  const profiles = await import_config21.parseKnownFiles(init || {});
@@ -22791,7 +22789,7 @@ var init_fromLoginCredentials = __esm(() => {
22791
22789
  import_config21 = __toESM(require_config(), 1);
22792
22790
  });
22793
22791
 
22794
- // ../../node_modules/.bun/@aws-sdk+credential-provider-login@3.972.77/node_modules/@aws-sdk/credential-provider-login/dist-es/index.js
22792
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-login@3.972.77/node_modules/@aws-sdk/credential-provider-login/dist-es/index.js
22795
22793
  var exports_dist_es5 = {};
22796
22794
  __export(exports_dist_es5, {
22797
22795
  fromLoginCredentials: () => fromLoginCredentials
@@ -22800,7 +22798,7 @@ var init_dist_es6 = __esm(() => {
22800
22798
  init_fromLoginCredentials();
22801
22799
  });
22802
22800
 
22803
- // ../../node_modules/.bun/@aws-sdk+credential-provider-ini@3.973.15/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveLoginCredentials.js
22801
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-ini@3.973.15/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveLoginCredentials.js
22804
22802
  var import_client14, isLoginProfile = (data) => {
22805
22803
  return Boolean(data && data.login_session);
22806
22804
  }, resolveLoginCredentials = async (profileName, options, callerClientConfig) => {
@@ -22815,7 +22813,7 @@ var init_resolveLoginCredentials = __esm(() => {
22815
22813
  import_client14 = __toESM(require_client2(), 1);
22816
22814
  });
22817
22815
 
22818
- // ../../node_modules/.bun/@aws-sdk+credential-provider-process@3.972.70/node_modules/@aws-sdk/credential-provider-process/dist-es/getValidatedProcessCredentials.js
22816
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-process@3.972.70/node_modules/@aws-sdk/credential-provider-process/dist-es/getValidatedProcessCredentials.js
22819
22817
  var import_client15, getValidatedProcessCredentials = (profileName, data, profiles) => {
22820
22818
  if (data.Version !== 1) {
22821
22819
  throw Error(`Profile ${profileName} credential_process did not return Version 1.`);
@@ -22849,7 +22847,7 @@ var init_getValidatedProcessCredentials = __esm(() => {
22849
22847
  import_client15 = __toESM(require_client2(), 1);
22850
22848
  });
22851
22849
 
22852
- // ../../node_modules/.bun/@aws-sdk+credential-provider-process@3.972.70/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js
22850
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-process@3.972.70/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js
22853
22851
  import { exec } from "child_process";
22854
22852
  import { promisify } from "util";
22855
22853
  var import_config22, resolveProcessCredentials = async (profileName, profiles, logger) => {
@@ -22884,7 +22882,7 @@ var init_resolveProcessCredentials = __esm(() => {
22884
22882
  import_config22 = __toESM(require_config(), 1);
22885
22883
  });
22886
22884
 
22887
- // ../../node_modules/.bun/@aws-sdk+credential-provider-process@3.972.70/node_modules/@aws-sdk/credential-provider-process/dist-es/fromProcess.js
22885
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-process@3.972.70/node_modules/@aws-sdk/credential-provider-process/dist-es/fromProcess.js
22888
22886
  var import_config23, fromProcess = (init = {}) => async ({ callerClientConfig } = {}) => {
22889
22887
  init.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");
22890
22888
  const profiles = await import_config23.parseKnownFiles(init);
@@ -22897,7 +22895,7 @@ var init_fromProcess = __esm(() => {
22897
22895
  import_config23 = __toESM(require_config(), 1);
22898
22896
  });
22899
22897
 
22900
- // ../../node_modules/.bun/@aws-sdk+credential-provider-process@3.972.70/node_modules/@aws-sdk/credential-provider-process/dist-es/index.js
22898
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-process@3.972.70/node_modules/@aws-sdk/credential-provider-process/dist-es/index.js
22901
22899
  var exports_dist_es6 = {};
22902
22900
  __export(exports_dist_es6, {
22903
22901
  fromProcess: () => fromProcess
@@ -22906,7 +22904,7 @@ var init_dist_es7 = __esm(() => {
22906
22904
  init_fromProcess();
22907
22905
  });
22908
22906
 
22909
- // ../../node_modules/.bun/@aws-sdk+credential-provider-ini@3.973.15/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProcessCredentials.js
22907
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-ini@3.973.15/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProcessCredentials.js
22910
22908
  var import_client16, isProcessProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string", resolveProcessCredentials2 = async (options, profile) => {
22911
22909
  const { fromProcess: fromProcess2 } = await Promise.resolve().then(() => (init_dist_es7(), exports_dist_es6));
22912
22910
  const credentials = await fromProcess2({
@@ -22919,7 +22917,7 @@ var init_resolveProcessCredentials2 = __esm(() => {
22919
22917
  import_client16 = __toESM(require_client2(), 1);
22920
22918
  });
22921
22919
 
22922
- // ../../node_modules/.bun/@aws-sdk+credential-provider-ini@3.973.15/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveSsoCredentials.js
22920
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-ini@3.973.15/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveSsoCredentials.js
22923
22921
  var import_client17, resolveSsoCredentials = async (profile, profileData, options = {}, callerClientConfig) => {
22924
22922
  const { fromSSO: fromSSO2 } = await Promise.resolve().then(() => (init_dist_es5(), exports_dist_es4));
22925
22923
  return fromSSO2({
@@ -22941,7 +22939,7 @@ var init_resolveSsoCredentials = __esm(() => {
22941
22939
  import_client17 = __toESM(require_client2(), 1);
22942
22940
  });
22943
22941
 
22944
- // ../../node_modules/.bun/@aws-sdk+credential-provider-ini@3.973.15/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveStaticCredentials.js
22942
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-ini@3.973.15/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveStaticCredentials.js
22945
22943
  var import_client18, isStaticCredsProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.aws_access_key_id === "string" && typeof arg.aws_secret_access_key === "string" && ["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1 && ["undefined", "string"].indexOf(typeof arg.aws_account_id) > -1, resolveStaticCredentials = async (profile, options) => {
22946
22944
  options?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");
22947
22945
  const credentials = {
@@ -22957,7 +22955,7 @@ var init_resolveStaticCredentials = __esm(() => {
22957
22955
  import_client18 = __toESM(require_client2(), 1);
22958
22956
  });
22959
22957
 
22960
- // ../../node_modules/.bun/@aws-sdk+credential-provider-web-identity@3.972.76/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromWebToken.js
22958
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-web-identity@3.972.76/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromWebToken.js
22961
22959
  var fromWebToken = (init) => async (awsIdentityProperties) => {
22962
22960
  init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");
22963
22961
  const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init;
@@ -22984,7 +22982,7 @@ var fromWebToken = (init) => async (awsIdentityProperties) => {
22984
22982
  });
22985
22983
  };
22986
22984
 
22987
- // ../../node_modules/.bun/@aws-sdk+credential-provider-web-identity@3.972.76/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js
22985
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-web-identity@3.972.76/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js
22988
22986
  import { readFileSync as readFileSync3 } from "fs";
22989
22987
  var import_client19, import_config24, ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE", ENV_ROLE_ARN = "AWS_ROLE_ARN", ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME", fromTokenFile = (init = {}) => async (awsIdentityProperties) => {
22990
22988
  init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");
@@ -23012,17 +23010,17 @@ var init_fromTokenFile = __esm(() => {
23012
23010
  import_config24 = __toESM(require_config(), 1);
23013
23011
  });
23014
23012
 
23015
- // ../../node_modules/.bun/@aws-sdk+credential-provider-web-identity@3.972.76/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/index.js
23013
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-web-identity@3.972.76/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/index.js
23016
23014
  var exports_dist_es7 = {};
23017
23015
  __export(exports_dist_es7, {
23018
- fromTokenFile: () => fromTokenFile,
23019
- fromWebToken: () => fromWebToken
23016
+ fromWebToken: () => fromWebToken,
23017
+ fromTokenFile: () => fromTokenFile
23020
23018
  });
23021
23019
  var init_dist_es8 = __esm(() => {
23022
23020
  init_fromTokenFile();
23023
23021
  });
23024
23022
 
23025
- // ../../node_modules/.bun/@aws-sdk+credential-provider-ini@3.973.15/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js
23023
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-ini@3.973.15/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js
23026
23024
  var import_client20, isWebIdentityProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.web_identity_token_file === "string" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1, resolveWebIdentityCredentials = async (profile, options, callerClientConfig) => {
23027
23025
  const { fromTokenFile: fromTokenFile2 } = await Promise.resolve().then(() => (init_dist_es8(), exports_dist_es7));
23028
23026
  const credentials = await fromTokenFile2({
@@ -23041,7 +23039,7 @@ var init_resolveWebIdentityCredentials = __esm(() => {
23041
23039
  import_client20 = __toESM(require_client2(), 1);
23042
23040
  });
23043
23041
 
23044
- // ../../node_modules/.bun/@aws-sdk+credential-provider-ini@3.973.15/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProfileData.js
23042
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-ini@3.973.15/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProfileData.js
23045
23043
  var import_config25, resolveProfileData = async (profileName, profiles, options, callerClientConfig, visitedProfiles = {}, isAssumeRoleRecursiveCall = false) => {
23046
23044
  const data = profiles[profileName];
23047
23045
  if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data)) {
@@ -23077,7 +23075,7 @@ var init_resolveProfileData = __esm(() => {
23077
23075
  import_config25 = __toESM(require_config(), 1);
23078
23076
  });
23079
23077
 
23080
- // ../../node_modules/.bun/@aws-sdk+credential-provider-ini@3.973.15/node_modules/@aws-sdk/credential-provider-ini/dist-es/fromIni.js
23078
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-ini@3.973.15/node_modules/@aws-sdk/credential-provider-ini/dist-es/fromIni.js
23081
23079
  var import_config26, fromIni = (init = {}) => async ({ callerClientConfig } = {}) => {
23082
23080
  init.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");
23083
23081
  const profiles = await import_config26.parseKnownFiles(init);
@@ -23090,7 +23088,7 @@ var init_fromIni = __esm(() => {
23090
23088
  import_config26 = __toESM(require_config(), 1);
23091
23089
  });
23092
23090
 
23093
- // ../../node_modules/.bun/@aws-sdk+credential-provider-ini@3.973.15/node_modules/@aws-sdk/credential-provider-ini/dist-es/index.js
23091
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-ini@3.973.15/node_modules/@aws-sdk/credential-provider-ini/dist-es/index.js
23094
23092
  var exports_dist_es8 = {};
23095
23093
  __export(exports_dist_es8, {
23096
23094
  fromIni: () => fromIni
@@ -23099,7 +23097,7 @@ var init_dist_es9 = __esm(() => {
23099
23097
  init_fromIni();
23100
23098
  });
23101
23099
 
23102
- // ../events/dist/index.js
23100
+ // ../../../skills-release-055-20260909/apps/events/dist/index.js
23103
23101
  import { chmod, mkdir, readFile, rename, writeFile as writeFile2 } from "fs/promises";
23104
23102
  import { Buffer as Buffer2 } from "buffer";
23105
23103
  import { existsSync as existsSync22 } from "fs";
@@ -24427,7 +24425,7 @@ var init_event_sink = __esm(() => {
24427
24425
  init_dist();
24428
24426
  });
24429
24427
 
24430
- // ../contracts/dist/client/transport.js
24428
+ // ../../../skills-release-055-20260909/apps/contracts/dist/client/transport.js
24431
24429
  import { isIP } from "net";
24432
24430
  import { spawnSync } from "child_process";
24433
24431
  import { closeSync, fstatSync, openSync, readFileSync } from "fs";
@@ -25256,7 +25254,9 @@ function normalizeSkillsApiOrigin(apiUrl) {
25256
25254
  throw new SkillsFleetCredentialError("A Skills API URL must use HTTPS (or loopback HTTP), without credentials, query or fragment", "INVALID_API_URL");
25257
25255
  }
25258
25256
  const pathname = url.pathname.replace(/\/+$/, "");
25259
- if (pathname === "/api" || pathname === "/api/v1") {
25257
+ if (url.origin === "https://api.hasna.com" && pathname === "/skills/v1") {
25258
+ url.pathname = "/skills";
25259
+ } else if (pathname === "/api" || pathname === "/api/v1") {
25260
25260
  url.pathname = "/";
25261
25261
  } else if (pathname.endsWith("/api/v1")) {
25262
25262
  url.pathname = pathname.slice(0, -"/api/v1".length) || "/";
@@ -25265,6 +25265,21 @@ function normalizeSkillsApiOrigin(apiUrl) {
25265
25265
  }
25266
25266
  return url.toString().replace(/\/+$/, "");
25267
25267
  }
25268
+ function skillsApiRequestUrl(apiUrl, route) {
25269
+ const origin = normalizeSkillsApiOrigin(apiUrl);
25270
+ if (!route.startsWith("/api/") || route.includes("#") || route.includes("\\")) {
25271
+ throw new SkillsFleetCredentialError("Invalid Skills API route", "INVALID_API_URL");
25272
+ }
25273
+ if (origin === "https://api.hasna.com/skills") {
25274
+ if (route === "/api/auth/whoami")
25275
+ return `${origin}/v1/auth/whoami`;
25276
+ if (!route.startsWith("/api/v1/")) {
25277
+ throw new SkillsFleetCredentialError("The internal Skills gateway has no established login contract yet. Select an explicitly configured instance with supported authentication.", "GATEWAY_AUTH_UNAVAILABLE");
25278
+ }
25279
+ return `${origin}${route.slice("/api".length)}`;
25280
+ }
25281
+ return `${origin}${route}`;
25282
+ }
25268
25283
  function configuredSkillsApiUrl(env = process.env, keychain, profile) {
25269
25284
  const declared = SKILLS_API_URL_ENV_KEYS.filter((key) => env[key] !== undefined).map((key) => ({ key, value: env[key] }));
25270
25285
  for (const entry of declared) {
@@ -25481,7 +25496,7 @@ class MissingSkillsFleetError extends Error {
25481
25496
  // package.json
25482
25497
  var package_default = {
25483
25498
  name: "@hasna/skills",
25484
- version: "0.5.4",
25499
+ version: "0.5.6",
25485
25500
  description: "Skills library for AI coding agents",
25486
25501
  type: "module",
25487
25502
  bin: {
@@ -26254,7 +26269,7 @@ function verifyBundleSignature(bytes, signature, key) {
26254
26269
  return expected.length === actual.length && timingSafeEqual(expected, actual);
26255
26270
  }
26256
26271
 
26257
- // ../../node_modules/.bun/@aws-sdk+checksums@3.1000.29/node_modules/@aws-sdk/checksums/dist-cjs/submodules/flexible-checksums/index.js
26272
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+checksums@3.1000.29/node_modules/@aws-sdk/checksums/dist-cjs/submodules/flexible-checksums/index.js
26258
26273
  var { setFeature } = require_client2();
26259
26274
  var { HttpRequest } = require_protocols();
26260
26275
  var { isArrayBuffer, toUint8Array, createBufferedReadable, createChecksumStream } = require_serde();
@@ -26647,10 +26662,10 @@ var $NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS = NODE_RESPONSE_CHECKSUM_V
26647
26662
  var $getFlexibleChecksumsPlugin = getFlexibleChecksumsPlugin;
26648
26663
  var $resolveFlexibleChecksumsConfig = resolveFlexibleChecksumsConfig;
26649
26664
 
26650
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/S3Client.js
26665
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/S3Client.js
26651
26666
  var import_client26 = __toESM(require_client2(), 1);
26652
26667
 
26653
- // ../../node_modules/.bun/@aws-sdk+middleware-sdk-s3@3.972.75/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/submodules/s3/index.js
26668
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+middleware-sdk-s3@3.972.75/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/submodules/s3/index.js
26654
26669
  var { NoOpLogger, getSmithyContext } = require_client();
26655
26670
  var { HttpRequest: HttpRequest2, HttpResponse } = require_protocols();
26656
26671
  var { parseRfc7231DateTime } = require_serde();
@@ -27255,7 +27270,7 @@ var $getThrow200ExceptionsPlugin = getThrow200ExceptionsPlugin;
27255
27270
  var $getValidateBucketNamePlugin = getValidateBucketNamePlugin;
27256
27271
  var $resolveS3Config = resolveS3Config;
27257
27272
 
27258
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/S3Client.js
27273
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/S3Client.js
27259
27274
  var import_core = __toESM(require_dist_cjs2(), 1);
27260
27275
  var import_client27 = __toESM(require_client(), 1);
27261
27276
  var import_config29 = __toESM(require_config(), 1);
@@ -27265,17 +27280,17 @@ var import_protocols6 = __toESM(require_protocols(), 1);
27265
27280
  var import_retry4 = __toESM(require_retry(), 1);
27266
27281
  var import_schema2 = __toESM(require_schema(), 1);
27267
27282
 
27268
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/auth/httpAuthSchemeProvider.js
27283
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/auth/httpAuthSchemeProvider.js
27269
27284
  var import_httpAuthSchemes = __toESM(require_httpAuthSchemes(), 1);
27270
27285
  var import_signature_v4_multi_region = __toESM(require_dist_cjs4(), 1);
27271
27286
  var import_client5 = __toESM(require_client(), 1);
27272
27287
  var import_endpoints3 = __toESM(require_endpoints(), 1);
27273
27288
 
27274
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/endpoint/endpointResolver.js
27289
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/endpoint/endpointResolver.js
27275
27290
  var import_client4 = __toESM(require_client2(), 1);
27276
27291
  var import_endpoints2 = __toESM(require_endpoints(), 1);
27277
27292
 
27278
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/endpoint/bdd.js
27293
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/endpoint/bdd.js
27279
27294
  var import_endpoints = __toESM(require_endpoints(), 1);
27280
27295
  var aw = "ref";
27281
27296
  var ax = "argv";
@@ -29219,7 +29234,7 @@ var nodes = new Int32Array([
29219
29234
  ]);
29220
29235
  var bdd = import_endpoints.BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
29221
29236
 
29222
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/endpoint/endpointResolver.js
29237
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/endpoint/endpointResolver.js
29223
29238
  var cache = new import_endpoints2.EndpointCache({
29224
29239
  size: 50,
29225
29240
  params: [
@@ -29247,7 +29262,7 @@ var defaultEndpointResolver = (endpointParams, context = {}) => {
29247
29262
  };
29248
29263
  import_endpoints2.customEndpointFunctions.aws = import_client4.awsEndpointFunctions;
29249
29264
 
29250
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/auth/httpAuthSchemeProvider.js
29265
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/auth/httpAuthSchemeProvider.js
29251
29266
  var createEndpointRuleSetHttpAuthSchemeParametersProvider = (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => {
29252
29267
  if (!input) {
29253
29268
  throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");
@@ -29363,11 +29378,11 @@ var resolveHttpAuthSchemeConfig = (config) => {
29363
29378
  });
29364
29379
  };
29365
29380
 
29366
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/commandBuilder.js
29381
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/commandBuilder.js
29367
29382
  var import_client6 = __toESM(require_client(), 1);
29368
29383
  var import_endpoints4 = __toESM(require_endpoints(), 1);
29369
29384
 
29370
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/endpoint/EndpointParameters.js
29385
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/endpoint/EndpointParameters.js
29371
29386
  var resolveClientEndpointParameters = (options) => {
29372
29387
  return Object.assign(options, {
29373
29388
  useFipsEndpoint: options.useFipsEndpoint ?? false,
@@ -29393,7 +29408,7 @@ var commonParams = {
29393
29408
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
29394
29409
  };
29395
29410
 
29396
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/commandBuilder.js
29411
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/commandBuilder.js
29397
29412
  var command = import_client6.makeBuilder(commonParams, "AmazonS3", "S3Client", import_endpoints4.getEndpointPlugin);
29398
29413
  var _ep0 = {
29399
29414
  Bucket: { type: "contextParams", name: "Bucket" },
@@ -29425,10 +29440,10 @@ var _mw11 = (Command, cs, config, o2) => [
29425
29440
  $getSsecPlugin(config)
29426
29441
  ];
29427
29442
 
29428
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/schemas/schemas_0.js
29443
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/schemas/schemas_0.js
29429
29444
  var import_schema = __toESM(require_schema(), 1);
29430
29445
 
29431
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/models/S3ServiceException.js
29446
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/models/S3ServiceException.js
29432
29447
  var import_client7 = __toESM(require_client(), 1);
29433
29448
  class S3ServiceException extends import_client7.ServiceException {
29434
29449
  constructor(options) {
@@ -29437,7 +29452,7 @@ class S3ServiceException extends import_client7.ServiceException {
29437
29452
  }
29438
29453
  }
29439
29454
 
29440
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/models/errors.js
29455
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/models/errors.js
29441
29456
  class NoSuchUpload extends S3ServiceException {
29442
29457
  name = "NoSuchUpload";
29443
29458
  $fault = "client";
@@ -29715,7 +29730,7 @@ class ObjectAlreadyInActiveTierError extends S3ServiceException {
29715
29730
  }
29716
29731
  }
29717
29732
 
29718
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/schemas/schemas_0.js
29733
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/schemas/schemas_0.js
29719
29734
  var _A = "Account";
29720
29735
  var _AAO = "AnalyticsAndOperator";
29721
29736
  var _AC = "AccelerateConfiguration";
@@ -35167,10 +35182,10 @@ var WriteGetObjectResponse$ = [
35167
35182
  () => __Unit
35168
35183
  ];
35169
35184
 
35170
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/commands/CreateSessionCommand.js
35185
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/commands/CreateSessionCommand.js
35171
35186
  class CreateSessionCommand extends command(_ep4, _mw0, "CreateSession", CreateSession$) {
35172
35187
  }
35173
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/package.json
35188
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/package.json
35174
35189
  var package_default2 = {
35175
35190
  name: "@aws-sdk/client-s3",
35176
35191
  version: "3.1127.0",
@@ -35255,15 +35270,15 @@ var package_default2 = {
35255
35270
  }
35256
35271
  };
35257
35272
 
35258
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.js
35273
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.js
35259
35274
  var import_client22 = __toESM(require_client2(), 1);
35260
35275
  var import_httpAuthSchemes3 = __toESM(require_httpAuthSchemes(), 1);
35261
35276
 
35262
- // ../../node_modules/.bun/@aws-sdk+credential-provider-node@3.972.82/node_modules/@aws-sdk/credential-provider-node/dist-es/defaultProvider.js
35277
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-node@3.972.82/node_modules/@aws-sdk/credential-provider-node/dist-es/defaultProvider.js
35263
35278
  init_dist_es();
35264
35279
  var import_config27 = __toESM(require_config(), 1);
35265
35280
 
35266
- // ../../node_modules/.bun/@aws-sdk+credential-provider-node@3.972.82/node_modules/@aws-sdk/credential-provider-node/dist-es/remoteProvider.js
35281
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-node@3.972.82/node_modules/@aws-sdk/credential-provider-node/dist-es/remoteProvider.js
35267
35282
  var import_config10 = __toESM(require_config(), 1);
35268
35283
  var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED";
35269
35284
  var remoteProvider = async (init) => {
@@ -35282,7 +35297,7 @@ var remoteProvider = async (init) => {
35282
35297
  return fromInstanceMetadata2(init);
35283
35298
  };
35284
35299
 
35285
- // ../../node_modules/.bun/@aws-sdk+credential-provider-node@3.972.82/node_modules/@aws-sdk/credential-provider-node/dist-es/runtime/memoize-chain.js
35300
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-node@3.972.82/node_modules/@aws-sdk/credential-provider-node/dist-es/runtime/memoize-chain.js
35286
35301
  function memoizeChain(providers, treatAsExpired) {
35287
35302
  const chain2 = internalCreateChain(providers);
35288
35303
  let activeLock;
@@ -35346,7 +35361,7 @@ var internalCreateChain = (providers) => async (awsIdentityProperties) => {
35346
35361
  throw lastProviderError;
35347
35362
  };
35348
35363
 
35349
- // ../../node_modules/.bun/@aws-sdk+credential-provider-node@3.972.82/node_modules/@aws-sdk/credential-provider-node/dist-es/defaultProvider.js
35364
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+credential-provider-node@3.972.82/node_modules/@aws-sdk/credential-provider-node/dist-es/defaultProvider.js
35350
35365
  var multipleCredentialSourceWarningEmitted = false;
35351
35366
  var defaultProvider = (init = {}) => memoizeChain([
35352
35367
  async () => {
@@ -35412,7 +35427,7 @@ var defaultProvider = (init = {}) => memoizeChain([
35412
35427
  }
35413
35428
  ], credentialsTreatedAsExpired);
35414
35429
  var credentialsTreatedAsExpired = (credentials) => credentials?.expiration !== undefined && credentials.expiration.getTime() - Date.now() < 300000;
35415
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.js
35430
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.js
35416
35431
  var import_checksum2 = __toESM(require_checksum(), 1);
35417
35432
  var import_client23 = __toESM(require_client(), 1);
35418
35433
  var import_config28 = __toESM(require_config(), 1);
@@ -35421,7 +35436,7 @@ var import_retry3 = __toESM(require_retry(), 1);
35421
35436
  var import_serde4 = __toESM(require_serde(), 1);
35422
35437
  var import_node_http_handler2 = __toESM(require_dist_cjs6(), 1);
35423
35438
 
35424
- // ../../node_modules/.bun/@aws-sdk+checksums@3.1000.29/node_modules/@aws-sdk/checksums/dist-cjs/submodules/sha/index.js
35439
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+checksums@3.1000.29/node_modules/@aws-sdk/checksums/dist-cjs/submodules/sha/index.js
35425
35440
  var { toUint8Array: toUint8Array2, concatBytes } = require_serde();
35426
35441
  var { createHmac: createHmac2, createHash: createHash3 } = __require("crypto");
35427
35442
  var { Sha256: Sha2562, Sha256Js, Sha256Node } = require_checksum();
@@ -35650,7 +35665,7 @@ var subtle = typeof digest === "function" && typeof sign2 === "function" && type
35650
35665
  var MAX_PENDING_BYTES = 8 * 1024 * 1024;
35651
35666
  var $Sha1 = Sha1Node;
35652
35667
 
35653
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.shared.js
35668
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.shared.js
35654
35669
  var import_httpAuthSchemes2 = __toESM(require_httpAuthSchemes(), 1);
35655
35670
  var import_signature_v4_multi_region2 = __toESM(require_dist_cjs4(), 1);
35656
35671
  var import_checksum = __toESM(require_checksum(), 1);
@@ -35702,7 +35717,7 @@ var getRuntimeConfig2 = (config) => {
35702
35717
  };
35703
35718
  };
35704
35719
 
35705
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.js
35720
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.js
35706
35721
  var getRuntimeConfig3 = (config) => {
35707
35722
  import_client23.emitWarningIfUnsupportedVersion(process.version);
35708
35723
  const defaultsMode = import_config28.resolveDefaultsModeConfig(config);
@@ -35743,12 +35758,12 @@ var getRuntimeConfig3 = (config) => {
35743
35758
  };
35744
35759
  };
35745
35760
 
35746
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/runtimeExtensions.js
35761
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/runtimeExtensions.js
35747
35762
  var import_client24 = __toESM(require_client2(), 1);
35748
35763
  var import_client25 = __toESM(require_client(), 1);
35749
35764
  var import_protocols5 = __toESM(require_protocols(), 1);
35750
35765
 
35751
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/auth/httpAuthExtensionConfiguration.js
35766
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/auth/httpAuthExtensionConfiguration.js
35752
35767
  var getHttpAuthExtensionConfiguration2 = (runtimeConfig) => {
35753
35768
  const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
35754
35769
  let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
@@ -35787,14 +35802,14 @@ var resolveHttpAuthRuntimeConfig2 = (config) => {
35787
35802
  };
35788
35803
  };
35789
35804
 
35790
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/runtimeExtensions.js
35805
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/runtimeExtensions.js
35791
35806
  var resolveRuntimeExtensions2 = (runtimeConfig, extensions) => {
35792
35807
  const extensionConfiguration = Object.assign(import_client24.getAwsRegionExtensionConfiguration(runtimeConfig), import_client25.getDefaultExtensionConfiguration(runtimeConfig), import_protocols5.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration2(runtimeConfig));
35793
35808
  extensions.forEach((extension) => extension.configure(extensionConfiguration));
35794
35809
  return Object.assign(runtimeConfig, import_client24.resolveAwsRegionExtensionConfiguration(extensionConfiguration), import_client25.resolveDefaultRuntimeConfig(extensionConfiguration), import_protocols5.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig2(extensionConfiguration));
35795
35810
  };
35796
35811
 
35797
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/S3Client.js
35812
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/S3Client.js
35798
35813
  class S3Client extends import_client27.Client {
35799
35814
  config;
35800
35815
  constructor(...[configuration]) {
@@ -35839,15 +35854,15 @@ class S3Client extends import_client27.Client {
35839
35854
  }
35840
35855
  }
35841
35856
 
35842
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteObjectCommand.js
35857
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteObjectCommand.js
35843
35858
  class DeleteObjectCommand extends command(_ep0, _mw0, "DeleteObject", DeleteObject$) {
35844
35859
  }
35845
35860
 
35846
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectCommand.js
35861
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectCommand.js
35847
35862
  class GetObjectCommand extends command(_ep0, _mw7, "GetObject", GetObject$) {
35848
35863
  }
35849
35864
 
35850
- // ../../node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectCommand.js
35865
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-s3@3.1127.0/node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectCommand.js
35851
35866
  class PutObjectCommand extends command(_ep0, _mw11, "PutObject", PutObject$) {
35852
35867
  }
35853
35868
 
@@ -37116,10 +37131,16 @@ class SqliteSkillsStore {
37116
37131
  const orgId = input.principal.orgId;
37117
37132
  const now = nowIso();
37118
37133
  return this.db.transaction(() => {
37119
- const previous = this.get("SELECT revision_id, revision_number, bundle_sha256, bundle_byte_size, skill_md, tombstoned_at FROM skills_registry WHERE org_id = ? AND slug = ?", [orgId, input.slug]);
37134
+ const previous = this.get("SELECT revision_id, revision_number, bundle_sha256, bundle_byte_size, skill_md, tombstoned_at, source FROM skills_registry WHERE org_id = ? AND slug = ?", [orgId, input.slug]);
37120
37135
  const previousSha = typeof previous?.bundle_sha256 === "string" ? previous.bundle_sha256 : null;
37121
37136
  const previousRevisionId = typeof previous?.revision_id === "string" && previous.revision_id ? previous.revision_id : null;
37122
37137
  const tombstoned = previous?.tombstoned_at != null;
37138
+ if (input.seedBundledOnly && input.expectedRevisionId && !previous) {
37139
+ throw new SkillRevisionConflictError(input.slug, input.expectedRevisionId, null);
37140
+ }
37141
+ if (input.seedBundledOnly && previous && (tombstoned || previous.source !== "bundled")) {
37142
+ throw new SkillRevisionConflictError(input.slug, input.expectedRevisionId, previousRevisionId);
37143
+ }
37123
37144
  const carriedSkillMd = typeof input.skillMd === "string" ? input.skillMd : typeof previous?.skill_md === "string" ? previous.skill_md : null;
37124
37145
  if (previous && !tombstoned && input.expectedRevisionId !== previousRevisionId) {
37125
37146
  throw new SkillRevisionConflictError(input.slug, input.expectedRevisionId, previousRevisionId);
@@ -37193,8 +37214,9 @@ class SqliteSkillsStore {
37193
37214
  tombstoned_at = NULL,
37194
37215
  tombstone_purge_after = NULL,
37195
37216
  updated_at = excluded.updated_at
37196
- WHERE skills_registry.tombstoned_at IS NOT NULL
37197
- OR skills_registry.revision_id = ?
37217
+ WHERE (skills_registry.tombstoned_at IS NOT NULL OR skills_registry.revision_id = ?)
37218
+ AND (? = 0 OR (skills_registry.tombstoned_at IS NULL AND skills_registry.source = 'bundled'
37219
+ AND skills_registry.revision_id = ?))
37198
37220
  RETURNING *`, [
37199
37221
  orgId,
37200
37222
  input.slug,
@@ -37212,6 +37234,8 @@ class SqliteSkillsStore {
37212
37234
  revisionId,
37213
37235
  now,
37214
37236
  now,
37237
+ input.expectedRevisionId ?? NO_REVISION_SENTINEL,
37238
+ input.seedBundledOnly ? 1 : 0,
37215
37239
  input.expectedRevisionId ?? NO_REVISION_SENTINEL
37216
37240
  ]);
37217
37241
  if (!row) {
@@ -42257,6 +42281,12 @@ async function storePublishedSkill(store, artifactStorage, principal, parsed, ex
42257
42281
  principal,
42258
42282
  ...expectedRevisionId ? { expectedRevisionId } : {}
42259
42283
  };
42284
+ if (input.seedBundledOnly && expectedRevisionId && !current) {
42285
+ throw new SkillRevisionConflictError(input.slug, expectedRevisionId, null);
42286
+ }
42287
+ if (input.seedBundledOnly && current && (current.tombstonedAt || current.source !== "bundled")) {
42288
+ throw new SkillRevisionConflictError(input.slug, expectedRevisionId, current.revisionId);
42289
+ }
42260
42290
  if (current && !current.tombstonedAt && expectedRevisionId !== current.revisionId) {
42261
42291
  throw new SkillRevisionConflictError(input.slug, expectedRevisionId, current.revisionId);
42262
42292
  }
@@ -42506,6 +42536,15 @@ async function seedBundledCorpus(options) {
42506
42536
  result.skipped.push(slug);
42507
42537
  continue;
42508
42538
  }
42539
+ const current = await options.store.getSkill(options.principal, slug);
42540
+ if (current) {
42541
+ const previousVersion = current.version ? await options.store.getSkillVersion(options.principal, slug, current.version) : null;
42542
+ const provenance = previousVersion?.manifest.provenance;
42543
+ if (current.tombstonedAt || current.source !== "bundled" || provenance?.seededFrom !== "bundled-corpus" || provenance.seededRevisionId !== current.revisionId) {
42544
+ result.skipped.push(slug);
42545
+ continue;
42546
+ }
42547
+ }
42509
42548
  const dir = getSkillPath(slug);
42510
42549
  if (!existsSync15(dir)) {
42511
42550
  result.skipped.push(slug);
@@ -42515,32 +42554,40 @@ async function seedBundledCorpus(options) {
42515
42554
  const packed = packSkillBundle(dir, { maxUnpackedBytes: 50000000 });
42516
42555
  const skillMdPath = join19(dir, "SKILL.md");
42517
42556
  const skillMd = existsSync15(skillMdPath) ? readFileSync16(skillMdPath, "utf-8") : undefined;
42518
- const current = await options.store.getSkill(options.principal, slug);
42557
+ const content = {
42558
+ slug,
42559
+ displayName: manifest.displayName ?? skill.displayName ?? slug,
42560
+ description: manifest.description ?? skill.description ?? slug,
42561
+ category: manifest.category ?? skill.category ?? "Development Tools",
42562
+ tags: manifest.tags ?? skill.tags ?? [],
42563
+ source: "bundled",
42564
+ kind: manifest.kind ?? "instruction",
42565
+ version: version2,
42566
+ ...skillMd ? { skillMd } : {},
42567
+ bundleSha256: packed.sha256,
42568
+ bundleByteSize: packed.bytes.byteLength
42569
+ };
42519
42570
  const { record } = await storePublishedSkill(options.store, options.artifactStorage, options.principal, {
42520
42571
  input: {
42521
- slug,
42522
- displayName: manifest.displayName ?? skill.displayName ?? slug,
42523
- description: manifest.description ?? skill.description ?? slug,
42524
- category: manifest.category ?? skill.category ?? "Development Tools",
42525
- tags: manifest.tags ?? skill.tags ?? [],
42526
- source: "bundled",
42527
- kind: manifest.kind ?? "instruction",
42528
- version: version2,
42529
- ...skillMd ? { skillMd } : {},
42572
+ ...content,
42573
+ seedBundledOnly: true,
42530
42574
  bundle: { sha256: packed.sha256, byteSize: packed.bytes.byteLength, contentType: "application/gzip", storageKind: "db" },
42531
42575
  versionManifest: {
42532
42576
  files: packed.paths,
42533
42577
  fileCount: packed.fileCount,
42534
42578
  unpackedByteSize: packed.unpackedByteSize,
42535
42579
  bundleSha256: packed.sha256,
42536
- provenance: { seededFrom: "bundled-corpus", packageVersion: package_default.version }
42580
+ provenance: { seededFrom: "bundled-corpus", packageVersion: package_default.version, seededRevisionId: revisionIdOfRecord(content) }
42537
42581
  }
42538
42582
  },
42539
42583
  bundleBytes: packed.bytes
42540
42584
  }, current?.revisionId);
42541
42585
  result.seeded.push(`${record.slug}@${version2}`);
42542
42586
  } catch (error) {
42543
- result.failed.push({ slug, error: error.message });
42587
+ if (error instanceof SkillRevisionConflictError)
42588
+ result.skipped.push(slug);
42589
+ else
42590
+ result.failed.push({ slug, error: error.message });
42544
42591
  }
42545
42592
  }
42546
42593
  log(`skills: bundled corpus seed v${version2}: ${result.seeded.length} seeded, ${result.skipped.length} skipped, ${result.failed.length} failed`);
@@ -42750,6 +42797,12 @@ class MemorySkillsStore {
42750
42797
  const key = skillKey(input.principal.orgId, input.slug);
42751
42798
  const now = nowIso();
42752
42799
  const previous = this.skills.get(key);
42800
+ if (input.seedBundledOnly && input.expectedRevisionId && !previous) {
42801
+ throw new SkillRevisionConflictError(input.slug, input.expectedRevisionId, null);
42802
+ }
42803
+ if (input.seedBundledOnly && previous && (previous.tombstonedAt || previous.source !== "bundled")) {
42804
+ throw new SkillRevisionConflictError(input.slug, input.expectedRevisionId, previous.revisionId);
42805
+ }
42753
42806
  if (previous && !previous.tombstonedAt && input.expectedRevisionId !== previous.revisionId) {
42754
42807
  throw new SkillRevisionConflictError(input.slug, input.expectedRevisionId, previous.revisionId);
42755
42808
  }
@@ -43203,13 +43256,19 @@ class PostgresSkillsStore {
43203
43256
  const orgId = input.principal.orgId;
43204
43257
  return await this.sql.begin(async (tx) => {
43205
43258
  const previousRows = await tx`
43206
- SELECT revision_id, revision_number, bundle_sha256, bundle_byte_size, skill_md, tombstoned_at
43259
+ SELECT revision_id, revision_number, bundle_sha256, bundle_byte_size, skill_md, tombstoned_at, source
43207
43260
  FROM skills_registry WHERE org_id = ${orgId} AND slug = ${input.slug} LIMIT 1
43208
43261
  `;
43209
43262
  const previous = previousRows[0];
43210
43263
  const previousSha = typeof previous?.bundle_sha256 === "string" ? String(previous.bundle_sha256) : null;
43211
43264
  const previousRevisionId = typeof previous?.revision_id === "string" && previous.revision_id ? String(previous.revision_id) : null;
43212
43265
  const tombstoned = previous?.tombstoned_at != null;
43266
+ if (input.seedBundledOnly && input.expectedRevisionId && !previous) {
43267
+ throw new SkillRevisionConflictError(input.slug, input.expectedRevisionId, null);
43268
+ }
43269
+ if (input.seedBundledOnly && previous && (tombstoned || previous.source !== "bundled")) {
43270
+ throw new SkillRevisionConflictError(input.slug, input.expectedRevisionId, previousRevisionId);
43271
+ }
43213
43272
  const carriedSkillMd = typeof input.skillMd === "string" ? input.skillMd : typeof previous?.skill_md === "string" ? String(previous.skill_md) : null;
43214
43273
  if (previous && !tombstoned && input.expectedRevisionId !== previousRevisionId) {
43215
43274
  throw new SkillRevisionConflictError(input.slug, input.expectedRevisionId, previousRevisionId);
@@ -43250,6 +43309,12 @@ class PostgresSkillsStore {
43250
43309
  body_blob = EXCLUDED.body_blob
43251
43310
  `;
43252
43311
  }
43312
+ if (input.seedBundledOnly) {
43313
+ const seedRows = await tx`SELECT revision_id FROM skills_registry WHERE org_id = ${orgId} AND slug = ${input.slug} FOR UPDATE`;
43314
+ if (input.expectedRevisionId && !seedRows[0]) {
43315
+ throw new SkillRevisionConflictError(input.slug, input.expectedRevisionId, null);
43316
+ }
43317
+ }
43253
43318
  const rows = await tx`
43254
43319
  INSERT INTO skills_registry (org_id, slug, display_name, description, category, tags_json, source, kind, version, skill_md,
43255
43320
  bundle_sha256, bundle_byte_size, published_by_user_id, revision_id, revision_number, updated_at)
@@ -43278,8 +43343,11 @@ class PostgresSkillsStore {
43278
43343
  tombstoned_at = NULL,
43279
43344
  tombstone_purge_after = NULL,
43280
43345
  updated_at = EXCLUDED.updated_at
43281
- WHERE skills_registry.tombstoned_at IS NOT NULL
43282
- OR skills_registry.revision_id = ${input.expectedRevisionId ?? NO_REVISION_SENTINEL2}
43346
+ WHERE (skills_registry.tombstoned_at IS NOT NULL
43347
+ OR skills_registry.revision_id = ${input.expectedRevisionId ?? NO_REVISION_SENTINEL2})
43348
+ AND (NOT ${Boolean(input.seedBundledOnly)} OR
43349
+ (skills_registry.tombstoned_at IS NULL AND skills_registry.source = 'bundled'
43350
+ AND skills_registry.revision_id = ${input.expectedRevisionId ?? NO_REVISION_SENTINEL2}))
43283
43351
  RETURNING *
43284
43352
  `;
43285
43353
  if (!rows[0]) {
@@ -43694,6 +43762,15 @@ async function createSkillsFetchHandler(options = {}) {
43694
43762
  }
43695
43763
  return async function fetch2(request) {
43696
43764
  const url = new URL(request.url);
43765
+ const versionedAliases = {
43766
+ "/v1/health": "/health",
43767
+ "/v1/auth/whoami": "/api/auth/whoami"
43768
+ };
43769
+ const alias = versionedAliases[url.pathname] ?? (url.pathname === "/v1" || url.pathname.startsWith("/v1/") ? `/api${url.pathname}` : undefined);
43770
+ if (alias) {
43771
+ url.pathname = alias;
43772
+ request = new Request(url, request);
43773
+ }
43697
43774
  const segments = pathSegments(url.pathname);
43698
43775
  try {
43699
43776
  if (request.method === "GET" && url.pathname === "/health") {
@@ -44055,119 +44132,119 @@ var bundledRegistry = {
44055
44132
  var currentVersionService = {
44056
44133
  resolveVersion: (record) => record.version
44057
44134
  };
44058
- // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/external.js
44135
+ // ../../../skills-release-055-20260909/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/external.js
44059
44136
  var exports_external = {};
44060
44137
  __export(exports_external, {
44061
- BRAND: () => BRAND,
44062
- DIRTY: () => DIRTY,
44063
- EMPTY_PATH: () => EMPTY_PATH,
44064
- INVALID: () => INVALID,
44065
- NEVER: () => NEVER,
44066
- OK: () => OK,
44067
- ParseStatus: () => ParseStatus,
44068
- Schema: () => ZodType,
44069
- ZodAny: () => ZodAny,
44070
- ZodArray: () => ZodArray,
44071
- ZodBigInt: () => ZodBigInt,
44072
- ZodBoolean: () => ZodBoolean,
44073
- ZodBranded: () => ZodBranded,
44074
- ZodCatch: () => ZodCatch,
44075
- ZodDate: () => ZodDate,
44076
- ZodDefault: () => ZodDefault,
44077
- ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
44078
- ZodEffects: () => ZodEffects,
44079
- ZodEnum: () => ZodEnum,
44080
- ZodError: () => ZodError,
44081
- ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
44082
- ZodFunction: () => ZodFunction,
44083
- ZodIntersection: () => ZodIntersection,
44084
- ZodIssueCode: () => ZodIssueCode,
44085
- ZodLazy: () => ZodLazy,
44086
- ZodLiteral: () => ZodLiteral,
44087
- ZodMap: () => ZodMap,
44088
- ZodNaN: () => ZodNaN,
44089
- ZodNativeEnum: () => ZodNativeEnum,
44090
- ZodNever: () => ZodNever,
44091
- ZodNull: () => ZodNull,
44092
- ZodNullable: () => ZodNullable,
44093
- ZodNumber: () => ZodNumber,
44094
- ZodObject: () => ZodObject,
44095
- ZodOptional: () => ZodOptional,
44096
- ZodParsedType: () => ZodParsedType,
44097
- ZodPipeline: () => ZodPipeline,
44098
- ZodPromise: () => ZodPromise,
44099
- ZodReadonly: () => ZodReadonly,
44100
- ZodRecord: () => ZodRecord,
44101
- ZodSchema: () => ZodType,
44102
- ZodSet: () => ZodSet,
44103
- ZodString: () => ZodString,
44104
- ZodSymbol: () => ZodSymbol,
44105
- ZodTransformer: () => ZodEffects,
44106
- ZodTuple: () => ZodTuple,
44107
- ZodType: () => ZodType,
44108
- ZodUndefined: () => ZodUndefined,
44109
- ZodUnion: () => ZodUnion,
44110
- ZodUnknown: () => ZodUnknown,
44111
- ZodVoid: () => ZodVoid,
44112
- addIssueToContext: () => addIssueToContext,
44113
- any: () => anyType,
44114
- array: () => arrayType,
44115
- bigint: () => bigIntType,
44116
- boolean: () => booleanType,
44117
- coerce: () => coerce,
44118
- custom: () => custom,
44119
- date: () => dateType,
44120
- datetimeRegex: () => datetimeRegex,
44121
- defaultErrorMap: () => en_default,
44122
- discriminatedUnion: () => discriminatedUnionType,
44123
- effect: () => effectsType,
44124
- enum: () => enumType,
44125
- function: () => functionType,
44126
- getErrorMap: () => getErrorMap,
44127
- getParsedType: () => getParsedType,
44128
- instanceof: () => instanceOfType,
44129
- intersection: () => intersectionType,
44130
- isAborted: () => isAborted,
44131
- isAsync: () => isAsync,
44132
- isDirty: () => isDirty,
44133
- isValid: () => isValid,
44134
- late: () => late,
44135
- lazy: () => lazyType,
44136
- literal: () => literalType,
44137
- makeIssue: () => makeIssue,
44138
- map: () => mapType,
44139
- nan: () => nanType,
44140
- nativeEnum: () => nativeEnumType,
44141
- never: () => neverType,
44142
- null: () => nullType,
44143
- nullable: () => nullableType,
44144
- number: () => numberType,
44145
- object: () => objectType,
44146
- objectUtil: () => objectUtil,
44147
- oboolean: () => oboolean,
44148
- onumber: () => onumber,
44149
- optional: () => optionalType,
44150
- ostring: () => ostring,
44151
- pipeline: () => pipelineType,
44152
- preprocess: () => preprocessType,
44153
- promise: () => promiseType,
44154
- quotelessJson: () => quotelessJson,
44155
- record: () => recordType,
44156
- set: () => setType,
44157
- setErrorMap: () => setErrorMap,
44158
- strictObject: () => strictObjectType,
44159
- string: () => stringType,
44160
- symbol: () => symbolType,
44161
- transformer: () => effectsType,
44162
- tuple: () => tupleType,
44163
- undefined: () => undefinedType,
44164
- union: () => unionType,
44165
- unknown: () => unknownType,
44138
+ void: () => voidType,
44166
44139
  util: () => util,
44167
- void: () => voidType
44140
+ unknown: () => unknownType,
44141
+ union: () => unionType,
44142
+ undefined: () => undefinedType,
44143
+ tuple: () => tupleType,
44144
+ transformer: () => effectsType,
44145
+ symbol: () => symbolType,
44146
+ string: () => stringType,
44147
+ strictObject: () => strictObjectType,
44148
+ setErrorMap: () => setErrorMap,
44149
+ set: () => setType,
44150
+ record: () => recordType,
44151
+ quotelessJson: () => quotelessJson,
44152
+ promise: () => promiseType,
44153
+ preprocess: () => preprocessType,
44154
+ pipeline: () => pipelineType,
44155
+ ostring: () => ostring,
44156
+ optional: () => optionalType,
44157
+ onumber: () => onumber,
44158
+ oboolean: () => oboolean,
44159
+ objectUtil: () => objectUtil,
44160
+ object: () => objectType,
44161
+ number: () => numberType,
44162
+ nullable: () => nullableType,
44163
+ null: () => nullType,
44164
+ never: () => neverType,
44165
+ nativeEnum: () => nativeEnumType,
44166
+ nan: () => nanType,
44167
+ map: () => mapType,
44168
+ makeIssue: () => makeIssue,
44169
+ literal: () => literalType,
44170
+ lazy: () => lazyType,
44171
+ late: () => late,
44172
+ isValid: () => isValid,
44173
+ isDirty: () => isDirty,
44174
+ isAsync: () => isAsync,
44175
+ isAborted: () => isAborted,
44176
+ intersection: () => intersectionType,
44177
+ instanceof: () => instanceOfType,
44178
+ getParsedType: () => getParsedType,
44179
+ getErrorMap: () => getErrorMap,
44180
+ function: () => functionType,
44181
+ enum: () => enumType,
44182
+ effect: () => effectsType,
44183
+ discriminatedUnion: () => discriminatedUnionType,
44184
+ defaultErrorMap: () => en_default,
44185
+ datetimeRegex: () => datetimeRegex,
44186
+ date: () => dateType,
44187
+ custom: () => custom,
44188
+ coerce: () => coerce,
44189
+ boolean: () => booleanType,
44190
+ bigint: () => bigIntType,
44191
+ array: () => arrayType,
44192
+ any: () => anyType,
44193
+ addIssueToContext: () => addIssueToContext,
44194
+ ZodVoid: () => ZodVoid,
44195
+ ZodUnknown: () => ZodUnknown,
44196
+ ZodUnion: () => ZodUnion,
44197
+ ZodUndefined: () => ZodUndefined,
44198
+ ZodType: () => ZodType,
44199
+ ZodTuple: () => ZodTuple,
44200
+ ZodTransformer: () => ZodEffects,
44201
+ ZodSymbol: () => ZodSymbol,
44202
+ ZodString: () => ZodString,
44203
+ ZodSet: () => ZodSet,
44204
+ ZodSchema: () => ZodType,
44205
+ ZodRecord: () => ZodRecord,
44206
+ ZodReadonly: () => ZodReadonly,
44207
+ ZodPromise: () => ZodPromise,
44208
+ ZodPipeline: () => ZodPipeline,
44209
+ ZodParsedType: () => ZodParsedType,
44210
+ ZodOptional: () => ZodOptional,
44211
+ ZodObject: () => ZodObject,
44212
+ ZodNumber: () => ZodNumber,
44213
+ ZodNullable: () => ZodNullable,
44214
+ ZodNull: () => ZodNull,
44215
+ ZodNever: () => ZodNever,
44216
+ ZodNativeEnum: () => ZodNativeEnum,
44217
+ ZodNaN: () => ZodNaN,
44218
+ ZodMap: () => ZodMap,
44219
+ ZodLiteral: () => ZodLiteral,
44220
+ ZodLazy: () => ZodLazy,
44221
+ ZodIssueCode: () => ZodIssueCode,
44222
+ ZodIntersection: () => ZodIntersection,
44223
+ ZodFunction: () => ZodFunction,
44224
+ ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
44225
+ ZodError: () => ZodError,
44226
+ ZodEnum: () => ZodEnum,
44227
+ ZodEffects: () => ZodEffects,
44228
+ ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
44229
+ ZodDefault: () => ZodDefault,
44230
+ ZodDate: () => ZodDate,
44231
+ ZodCatch: () => ZodCatch,
44232
+ ZodBranded: () => ZodBranded,
44233
+ ZodBoolean: () => ZodBoolean,
44234
+ ZodBigInt: () => ZodBigInt,
44235
+ ZodArray: () => ZodArray,
44236
+ ZodAny: () => ZodAny,
44237
+ Schema: () => ZodType,
44238
+ ParseStatus: () => ParseStatus,
44239
+ OK: () => OK,
44240
+ NEVER: () => NEVER,
44241
+ INVALID: () => INVALID,
44242
+ EMPTY_PATH: () => EMPTY_PATH,
44243
+ DIRTY: () => DIRTY,
44244
+ BRAND: () => BRAND
44168
44245
  });
44169
44246
 
44170
- // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/util.js
44247
+ // ../../../skills-release-055-20260909/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/util.js
44171
44248
  var util;
44172
44249
  (function(util2) {
44173
44250
  util2.assertEqual = (_) => {};
@@ -44298,7 +44375,7 @@ var getParsedType = (data) => {
44298
44375
  }
44299
44376
  };
44300
44377
 
44301
- // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/ZodError.js
44378
+ // ../../../skills-release-055-20260909/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/ZodError.js
44302
44379
  var ZodIssueCode = util.arrayToEnum([
44303
44380
  "invalid_type",
44304
44381
  "invalid_literal",
@@ -44417,7 +44494,7 @@ ZodError.create = (issues) => {
44417
44494
  return error;
44418
44495
  };
44419
44496
 
44420
- // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/locales/en.js
44497
+ // ../../../skills-release-055-20260909/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/locales/en.js
44421
44498
  var errorMap = (issue, _ctx) => {
44422
44499
  let message;
44423
44500
  switch (issue.code) {
@@ -44520,7 +44597,7 @@ var errorMap = (issue, _ctx) => {
44520
44597
  };
44521
44598
  var en_default = errorMap;
44522
44599
 
44523
- // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/errors.js
44600
+ // ../../../skills-release-055-20260909/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/errors.js
44524
44601
  var overrideErrorMap = en_default;
44525
44602
  function setErrorMap(map) {
44526
44603
  overrideErrorMap = map;
@@ -44528,7 +44605,7 @@ function setErrorMap(map) {
44528
44605
  function getErrorMap() {
44529
44606
  return overrideErrorMap;
44530
44607
  }
44531
- // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
44608
+ // ../../../skills-release-055-20260909/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
44532
44609
  var makeIssue = (params) => {
44533
44610
  const { data, path, errorMaps, issueData } = params;
44534
44611
  const fullPath = [...path, ...issueData.path || []];
@@ -44634,14 +44711,14 @@ var isAborted = (x2) => x2.status === "aborted";
44634
44711
  var isDirty = (x2) => x2.status === "dirty";
44635
44712
  var isValid = (x2) => x2.status === "valid";
44636
44713
  var isAsync = (x2) => typeof Promise !== "undefined" && x2 instanceof Promise;
44637
- // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js
44714
+ // ../../../skills-release-055-20260909/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js
44638
44715
  var errorUtil;
44639
44716
  (function(errorUtil2) {
44640
44717
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
44641
44718
  errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
44642
44719
  })(errorUtil || (errorUtil = {}));
44643
44720
 
44644
- // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/types.js
44721
+ // ../../../skills-release-055-20260909/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/types.js
44645
44722
  class ParseInputLazyPath {
44646
44723
  constructor(parent, value, path, key) {
44647
44724
  this._cachedPath = [];
@@ -48889,7 +48966,7 @@ function createReceiptService(store) {
48889
48966
  // src/sdk/execution/dispatchers/ecs.ts
48890
48967
  import { createHash as createHash11 } from "crypto";
48891
48968
 
48892
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/ECSClient.js
48969
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/ECSClient.js
48893
48970
  var import_client36 = __toESM(require_client2(), 1);
48894
48971
  var import_core2 = __toESM(require_dist_cjs2(), 1);
48895
48972
  var import_client37 = __toESM(require_client(), 1);
@@ -48899,7 +48976,7 @@ var import_protocols10 = __toESM(require_protocols(), 1);
48899
48976
  var import_retry6 = __toESM(require_retry(), 1);
48900
48977
  var import_schema4 = __toESM(require_schema(), 1);
48901
48978
 
48902
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/auth/httpAuthSchemeProvider.js
48979
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/auth/httpAuthSchemeProvider.js
48903
48980
  var import_httpAuthSchemes4 = __toESM(require_httpAuthSchemes(), 1);
48904
48981
  var import_client28 = __toESM(require_client(), 1);
48905
48982
  var defaultECSHttpAuthSchemeParametersProvider = async (config, context, input) => {
@@ -48941,7 +49018,7 @@ var resolveHttpAuthSchemeConfig3 = (config) => {
48941
49018
  });
48942
49019
  };
48943
49020
 
48944
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/endpoint/EndpointParameters.js
49021
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/endpoint/EndpointParameters.js
48945
49022
  var resolveClientEndpointParameters3 = (options) => {
48946
49023
  return Object.assign(options, {
48947
49024
  useDualstackEndpoint: options.useDualstackEndpoint ?? false,
@@ -48955,7 +49032,7 @@ var commonParams3 = {
48955
49032
  Region: { type: "builtInParams", name: "region" },
48956
49033
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
48957
49034
  };
48958
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/package.json
49035
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/package.json
48959
49036
  var package_default3 = {
48960
49037
  name: "@aws-sdk/client-ecs",
48961
49038
  version: "3.1127.0",
@@ -49028,7 +49105,7 @@ var package_default3 = {
49028
49105
  }
49029
49106
  };
49030
49107
 
49031
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/runtimeConfig.js
49108
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/runtimeConfig.js
49032
49109
  var import_client32 = __toESM(require_client2(), 1);
49033
49110
  var import_httpAuthSchemes6 = __toESM(require_httpAuthSchemes(), 1);
49034
49111
  var import_client33 = __toESM(require_client(), 1);
@@ -49037,7 +49114,7 @@ var import_retry5 = __toESM(require_retry(), 1);
49037
49114
  var import_serde6 = __toESM(require_serde(), 1);
49038
49115
  var import_node_http_handler3 = __toESM(require_dist_cjs6(), 1);
49039
49116
 
49040
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/runtimeConfig.shared.js
49117
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/runtimeConfig.shared.js
49041
49118
  var import_httpAuthSchemes5 = __toESM(require_httpAuthSchemes(), 1);
49042
49119
  var import_protocols7 = __toESM(require_protocols2(), 1);
49043
49120
  var import_checksum3 = __toESM(require_checksum(), 1);
@@ -49045,11 +49122,11 @@ var import_client31 = __toESM(require_client(), 1);
49045
49122
  var import_protocols8 = __toESM(require_protocols(), 1);
49046
49123
  var import_serde5 = __toESM(require_serde(), 1);
49047
49124
 
49048
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/endpoint/endpointResolver.js
49125
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/endpoint/endpointResolver.js
49049
49126
  var import_client29 = __toESM(require_client2(), 1);
49050
49127
  var import_endpoints7 = __toESM(require_endpoints(), 1);
49051
49128
 
49052
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/endpoint/bdd.js
49129
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/endpoint/bdd.js
49053
49130
  var import_endpoints6 = __toESM(require_endpoints(), 1);
49054
49131
  var k3 = "ref";
49055
49132
  var a3 = -1;
@@ -49132,7 +49209,7 @@ var nodes3 = new Int32Array([
49132
49209
  ]);
49133
49210
  var bdd3 = import_endpoints6.BinaryDecisionDiagram.from(nodes3, root3, _data3.conditions, _data3.results);
49134
49211
 
49135
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/endpoint/endpointResolver.js
49212
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/endpoint/endpointResolver.js
49136
49213
  var cache3 = new import_endpoints7.EndpointCache({
49137
49214
  size: 50,
49138
49215
  params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"]
@@ -49145,10 +49222,10 @@ var defaultEndpointResolver3 = (endpointParams, context = {}) => {
49145
49222
  };
49146
49223
  import_endpoints7.customEndpointFunctions.aws = import_client29.awsEndpointFunctions;
49147
49224
 
49148
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/schemas/schemas_0.js
49225
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/schemas/schemas_0.js
49149
49226
  var import_schema3 = __toESM(require_schema(), 1);
49150
49227
 
49151
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/models/ECSServiceException.js
49228
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/models/ECSServiceException.js
49152
49229
  var import_client30 = __toESM(require_client(), 1);
49153
49230
  class ECSServiceException extends import_client30.ServiceException {
49154
49231
  constructor(options) {
@@ -49157,7 +49234,7 @@ class ECSServiceException extends import_client30.ServiceException {
49157
49234
  }
49158
49235
  }
49159
49236
 
49160
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/models/errors.js
49237
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/models/errors.js
49161
49238
  class AccessDeniedException extends ECSServiceException {
49162
49239
  name = "AccessDeniedException";
49163
49240
  $fault = "client";
@@ -49550,7 +49627,7 @@ class BlockedException extends ECSServiceException {
49550
49627
  }
49551
49628
  }
49552
49629
 
49553
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/schemas/schemas_0.js
49630
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/schemas/schemas_0.js
49554
49631
  var _A2 = "Attachment";
49555
49632
  var _ACR = "AcceleratorCountRequest";
49556
49633
  var _AD2 = "AttachmentDetails";
@@ -51937,7 +52014,7 @@ var StopTask$ = [
51937
52014
  () => StopTaskResponse$
51938
52015
  ];
51939
52016
 
51940
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/runtimeConfig.shared.js
52017
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/runtimeConfig.shared.js
51941
52018
  var getRuntimeConfig4 = (config) => {
51942
52019
  return {
51943
52020
  apiVersion: "2014-11-13",
@@ -51971,7 +52048,7 @@ var getRuntimeConfig4 = (config) => {
51971
52048
  };
51972
52049
  };
51973
52050
 
51974
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/runtimeConfig.js
52051
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/runtimeConfig.js
51975
52052
  var getRuntimeConfig5 = (config) => {
51976
52053
  import_client33.emitWarningIfUnsupportedVersion(process.version);
51977
52054
  const defaultsMode = import_config38.resolveDefaultsModeConfig(config);
@@ -52005,12 +52082,12 @@ var getRuntimeConfig5 = (config) => {
52005
52082
  };
52006
52083
  };
52007
52084
 
52008
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/runtimeExtensions.js
52085
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/runtimeExtensions.js
52009
52086
  var import_client34 = __toESM(require_client2(), 1);
52010
52087
  var import_client35 = __toESM(require_client(), 1);
52011
52088
  var import_protocols9 = __toESM(require_protocols(), 1);
52012
52089
 
52013
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/auth/httpAuthExtensionConfiguration.js
52090
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/auth/httpAuthExtensionConfiguration.js
52014
52091
  var getHttpAuthExtensionConfiguration3 = (runtimeConfig) => {
52015
52092
  const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
52016
52093
  let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
@@ -52049,14 +52126,14 @@ var resolveHttpAuthRuntimeConfig3 = (config) => {
52049
52126
  };
52050
52127
  };
52051
52128
 
52052
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/runtimeExtensions.js
52129
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/runtimeExtensions.js
52053
52130
  var resolveRuntimeExtensions3 = (runtimeConfig, extensions) => {
52054
52131
  const extensionConfiguration = Object.assign(import_client34.getAwsRegionExtensionConfiguration(runtimeConfig), import_client35.getDefaultExtensionConfiguration(runtimeConfig), import_protocols9.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration3(runtimeConfig));
52055
52132
  extensions.forEach((extension) => extension.configure(extensionConfiguration));
52056
52133
  return Object.assign(runtimeConfig, import_client34.resolveAwsRegionExtensionConfiguration(extensionConfiguration), import_client35.resolveDefaultRuntimeConfig(extensionConfiguration), import_protocols9.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig3(extensionConfiguration));
52057
52134
  };
52058
52135
 
52059
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/ECSClient.js
52136
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/ECSClient.js
52060
52137
  class ECSClient extends import_client37.Client {
52061
52138
  config;
52062
52139
  constructor(...[configuration]) {
@@ -52092,32 +52169,38 @@ class ECSClient extends import_client37.Client {
52092
52169
  }
52093
52170
  }
52094
52171
 
52095
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/commandBuilder.js
52172
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/commandBuilder.js
52096
52173
  var import_client38 = __toESM(require_client(), 1);
52097
52174
  var import_endpoints9 = __toESM(require_endpoints(), 1);
52098
52175
  var command3 = import_client38.makeBuilder(commonParams3, "AmazonEC2ContainerServiceV20141113", "ECSClient", import_endpoints9.getEndpointPlugin);
52099
52176
  var _ep03 = {};
52100
52177
  var _mw03 = (Command, cs, config, o2) => [];
52101
52178
 
52102
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/commands/DescribeTasksCommand.js
52179
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/commands/DescribeTasksCommand.js
52103
52180
  class DescribeTasksCommand extends command3(_ep03, _mw03, "DescribeTasks", DescribeTasks$) {
52104
52181
  }
52105
52182
 
52106
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/commands/ListTasksCommand.js
52183
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/commands/ListTasksCommand.js
52107
52184
  class ListTasksCommand extends command3(_ep03, _mw03, "ListTasks", ListTasks$) {
52108
52185
  }
52109
52186
 
52110
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/commands/RunTaskCommand.js
52187
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/commands/RunTaskCommand.js
52111
52188
  class RunTaskCommand extends command3(_ep03, _mw03, "RunTask", RunTask$) {
52112
52189
  }
52113
52190
 
52114
- // ../../node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/commands/StopTaskCommand.js
52191
+ // ../../../skills-release-055-20260909/node_modules/.bun/@aws-sdk+client-ecs@3.1127.0/node_modules/@aws-sdk/client-ecs/dist-es/commands/StopTaskCommand.js
52115
52192
  class StopTaskCommand extends command3(_ep03, _mw03, "StopTask", StopTask$) {
52116
52193
  }
52117
52194
 
52118
52195
  // src/sdk/execution/dispatchers/ecs.ts
52119
52196
  var CLIENT_TOKEN_BYTES = 16;
52120
- var TERMINAL_TASK_STATUSES = new Set(["STOPPED"]);
52197
+ var LIVE_TASK_STATUSES = new Set(["PROVISIONING", "PENDING", "ACTIVATING", "RUNNING", "DEACTIVATING", "STOPPING", "DEPROVISIONING"]);
52198
+ function observedTask(states, taskArn) {
52199
+ if (states.length !== 1 || states[0]?.taskArn !== taskArn)
52200
+ return;
52201
+ const state = states[0];
52202
+ return state.lastStatus === "STOPPED" || LIVE_TASK_STATUSES.has(state.lastStatus) ? state : undefined;
52203
+ }
52121
52204
  function clientTokenFor(runId2, attemptId) {
52122
52205
  return createHash11("sha256").update(`${runId2}\x00${attemptId}`).digest("hex").slice(0, CLIENT_TOKEN_BYTES * 2);
52123
52206
  }
@@ -52169,28 +52252,47 @@ class EcsDispatcher {
52169
52252
  const run = await this.store.getRun(runId2);
52170
52253
  if (!run)
52171
52254
  return { accepted: false, detail: "no such run" };
52172
- if (run.status === "cancelled")
52173
- return { accepted: true, detail: "already cancelled" };
52174
52255
  if (run.status === "succeeded" || run.status === "failed") {
52175
52256
  return { accepted: false, detail: `run already ${run.status}` };
52176
52257
  }
52177
52258
  const attempts = await this.store.listAttempts(runId2);
52178
52259
  const current = attempts[attempts.length - 1];
52179
52260
  if (!current) {
52180
- const cancelled2 = await this.stateMachine.cancel(runId2);
52181
- return cancelled2.ok ? { accepted: true, detail: "cancelled (no attempt launched)" } : { accepted: false, detail: cancelled2.reason };
52261
+ if (run.status === "cancelled")
52262
+ return { accepted: true, detail: "already cancelled (no attempt launched)" };
52263
+ const cancelled = await this.stateMachine.cancel(runId2);
52264
+ return cancelled.ok ? { accepted: true, detail: "cancelled (no attempt launched)" } : { accepted: false, detail: cancelled.reason };
52182
52265
  }
52183
- const taskArn = await this.resolveTaskArn(run.admission, current);
52184
- if (taskArn) {
52266
+ if (!this.cancellationReceipt(await this.receipts.get(runId2, current.attemptId), run.admission, current)) {
52267
+ return { accepted: false, detail: "matching cancellation receipt is unavailable or contradictory" };
52268
+ }
52269
+ const observation = await this.reconcile(run.admission, current);
52270
+ if (observation.kind !== "already-launched" && observation.kind !== "previous-terminal") {
52271
+ return { accepted: false, detail: "task state unknown; cancellation is not yet confirmed" };
52272
+ }
52273
+ const taskArn = observation.kind === "already-launched" ? observation.taskId : (await this.store.listAttempts(runId2)).find((row) => row.attemptId === current.attemptId)?.taskId ?? null;
52274
+ if (!taskArn)
52275
+ return { accepted: false, detail: "stopped task identity is not confirmed" };
52276
+ if (observation.kind === "already-launched") {
52185
52277
  try {
52186
- await this.client.stopTask(taskArn);
52278
+ await this.client.stopTask(observation.taskId);
52187
52279
  } catch {}
52280
+ const stopped = await this.reconcile(run.admission, { ...current, taskId: observation.taskId });
52281
+ if (stopped.kind !== "previous-terminal") {
52282
+ return { accepted: false, target: observation.taskId, detail: "task stop is not yet confirmed; reconcile before retrying cancellation" };
52283
+ }
52188
52284
  }
52189
- const cancelled = await this.stateMachine.cancel(runId2);
52190
- if (!cancelled.ok)
52191
- return { accepted: false, detail: cancelled.reason };
52192
- await this.writeCancellationReceipt(run.admission, current, taskArn);
52193
- return { accepted: true, target: taskArn ?? undefined, detail: "cancelled and fenced" };
52285
+ if (run.status !== "cancelled") {
52286
+ const cancelled = await this.stateMachine.cancel(runId2);
52287
+ if (!cancelled.ok)
52288
+ return { accepted: false, detail: cancelled.reason };
52289
+ }
52290
+ try {
52291
+ await this.writeCancellationReceipt(run.admission, current, taskArn);
52292
+ } catch {
52293
+ return { accepted: false, target: taskArn, detail: "task stopped; cancellation receipt is not yet confirmed" };
52294
+ }
52295
+ return { accepted: true, target: taskArn, detail: "cancelled after confirmed task stop and receipt" };
52194
52296
  }
52195
52297
  async launchAttempt(runId2) {
52196
52298
  const run = await this.store.getRun(runId2);
@@ -52201,16 +52303,10 @@ class EcsDispatcher {
52201
52303
  }
52202
52304
  const attempts = await this.store.listAttempts(runId2);
52203
52305
  const previous = attempts[attempts.length - 1];
52204
- if (previous && previous.status !== "terminal" && !isProvenAbsentOrTerminal(previous.launchState)) {
52205
- const reconciled = await this.reconcile(run.admission, previous);
52206
- if (reconciled.kind === "already-launched" || reconciled.kind === "previous-terminal") {
52207
- return reconciled;
52208
- }
52209
- if (reconciled.kind === "ambiguous") {
52210
- return reconciled;
52211
- }
52306
+ if (previous) {
52307
+ return this.reconcile(run.admission, previous);
52212
52308
  }
52213
- const attemptNumber = previous ? previous.attemptNumber + 1 : 1;
52309
+ const attemptNumber = 1;
52214
52310
  const attempt = await this.store.createAttempt({ runId: runId2, attemptNumber });
52215
52311
  const claimed = await this.stateMachine.claim({
52216
52312
  runId: runId2,
@@ -52245,68 +52341,43 @@ class EcsDispatcher {
52245
52341
  } catch {
52246
52342
  await this.store.recordLaunchState({ runId: runId2, attemptId: attempt.attemptId, launchState: "ambiguous" });
52247
52343
  const reconciled = await this.reconcile(run.admission, intent.attempt);
52248
- if (reconciled.kind === "already-launched")
52249
- return reconciled;
52250
- return reconciled.kind === "previous-terminal" ? reconciled : { kind: "launch-failed-absent", attemptId: attempt.attemptId };
52344
+ return reconciled;
52251
52345
  }
52252
52346
  await this.store.recordLaunchState({ runId: runId2, attemptId: attempt.attemptId, launchState: "launched", taskId: result.taskArn });
52253
52347
  return { kind: "launched", attemptId: attempt.attemptId, taskId: result.taskArn };
52254
52348
  }
52255
52349
  async reconcile(admission, attempt) {
52256
- if (attempt.taskId) {
52257
- let states2;
52350
+ const ambiguous = () => ({ kind: "ambiguous", attemptId: attempt.attemptId });
52351
+ let taskArn = attempt.taskId;
52352
+ if (!taskArn) {
52353
+ if (!attempt.startedBy)
52354
+ return ambiguous();
52355
+ let taskArns;
52258
52356
  try {
52259
- states2 = await this.client.describeTasks([attempt.taskId]);
52357
+ taskArns = await this.client.listTasksByStartedBy(attempt.startedBy);
52260
52358
  } catch {
52261
- return { kind: "ambiguous", attemptId: attempt.attemptId };
52262
- }
52263
- const live2 = states2.filter((state) => !TERMINAL_TASK_STATUSES.has(state.lastStatus));
52264
- if (live2.length > 0) {
52265
- return { kind: "already-launched", attemptId: attempt.attemptId, taskId: attempt.taskId };
52359
+ return ambiguous();
52266
52360
  }
52267
- await this.store.recordLaunchState({ runId: admission.runId, attemptId: attempt.attemptId, launchState: "terminal" });
52268
- return { kind: "previous-terminal", attemptId: attempt.attemptId };
52269
- }
52270
- const token = attempt.startedBy;
52271
- if (!token) {
52272
- await this.store.recordLaunchState({ runId: admission.runId, attemptId: attempt.attemptId, launchState: "absent" });
52273
- return { kind: "launch-failed-absent", attemptId: attempt.attemptId };
52274
- }
52275
- let taskArns;
52276
- try {
52277
- taskArns = await this.client.listTasksByStartedBy(token);
52278
- } catch {
52279
- return { kind: "ambiguous", attemptId: attempt.attemptId };
52280
- }
52281
- if (taskArns.length === 0) {
52282
- await this.store.recordLaunchState({ runId: admission.runId, attemptId: attempt.attemptId, launchState: "absent" });
52283
- return { kind: "launch-failed-absent", attemptId: attempt.attemptId };
52361
+ if (taskArns.length !== 1 || !taskArns[0])
52362
+ return ambiguous();
52363
+ taskArn = taskArns[0];
52284
52364
  }
52285
52365
  let states;
52286
52366
  try {
52287
- states = await this.client.describeTasks(taskArns);
52367
+ states = await this.client.describeTasks([taskArn]);
52288
52368
  } catch {
52289
- return { kind: "ambiguous", attemptId: attempt.attemptId };
52369
+ return ambiguous();
52290
52370
  }
52291
- const live = states.filter((state) => !TERMINAL_TASK_STATUSES.has(state.lastStatus));
52292
- if (live.length > 0) {
52293
- const taskId = live[0].taskArn;
52294
- await this.store.recordLaunchState({ runId: admission.runId, attemptId: attempt.attemptId, launchState: "launched", taskId });
52295
- return { kind: "already-launched", attemptId: attempt.attemptId, taskId };
52371
+ const state = observedTask(states, taskArn);
52372
+ if (!state)
52373
+ return ambiguous();
52374
+ if (state.lastStatus !== "STOPPED") {
52375
+ await this.store.recordLaunchState({ runId: admission.runId, attemptId: attempt.attemptId, launchState: "launched", taskId: taskArn });
52376
+ return { kind: "already-launched", attemptId: attempt.attemptId, taskId: taskArn };
52296
52377
  }
52297
- await this.store.recordLaunchState({ runId: admission.runId, attemptId: attempt.attemptId, launchState: "terminal", taskId: taskArns[0] });
52378
+ await this.store.recordLaunchState({ runId: admission.runId, attemptId: attempt.attemptId, launchState: "terminal", taskId: taskArn });
52298
52379
  return { kind: "previous-terminal", attemptId: attempt.attemptId };
52299
52380
  }
52300
- async resolveTaskArn(admission, attempt) {
52301
- if (attempt.taskId)
52302
- return attempt.taskId;
52303
- if (attempt.launchState === "launching" || attempt.launchState === "ambiguous") {
52304
- const outcome = await this.reconcile(admission, attempt);
52305
- if (outcome.kind === "already-launched")
52306
- return outcome.taskId;
52307
- }
52308
- return null;
52309
- }
52310
52381
  runTaskInput(admission, attempt, clientToken, startedBy, requestDigest) {
52311
52382
  const limits = admission.limits;
52312
52383
  const cpuUnits = Math.max(256, Math.round(limits.maxCpuUnits / 256) * 256);
@@ -52331,81 +52402,103 @@ class EcsDispatcher {
52331
52402
  ]
52332
52403
  };
52333
52404
  }
52334
- async writeCancellationReceipt(admission, attempt, taskArn) {
52335
- const launch = await this.receipts.get(admission.runId, attempt.attemptId);
52336
- if (!launch) {
52337
- await this.receipts.recordLaunch({
52338
- admission,
52339
- attempt: { ...attempt, clientToken: attempt.clientToken ?? clientTokenFor(admission.runId, attempt.attemptId), requestDigest: attempt.requestDigest ?? "", startedBy: attempt.startedBy ?? "" },
52340
- taskId: taskArn,
52341
- launchedAt: this.now().toISOString()
52342
- });
52405
+ cancellationReceipt(receipt, admission, attempt) {
52406
+ try {
52407
+ return !!receipt && receipt.runId === admission.runId && receipt.attemptId === attempt.attemptId && !!attempt.clientToken && receipt.clientToken === attempt.clientToken && !!attempt.requestDigest && receipt.requestDigest === attempt.requestDigest && !!attempt.startedBy && receipt.startedBy === attempt.startedBy && receipt.bundleDigest === admission.bundleDigest && receipt.runtimeImageDigest === admission.runtimeImageDigest && receipt.dependencyLayerTag === admission.dependencyLayerTag && canonicalJson(receipt.policy) === canonicalJson(admission.policy) && canonicalJson(receipt.limits) === canonicalJson(admission.limits) && (receipt.taskId === null || receipt.taskId === attempt.taskId) && (receipt.status === null && receipt.completedAt === null || receipt.status === "cancelled" && typeof receipt.completedAt === "string" && Number.isFinite(Date.parse(receipt.completedAt)));
52408
+ } catch {
52409
+ return false;
52343
52410
  }
52344
- await this.receipts.finalize({
52345
- runId: admission.runId,
52346
- attemptId: attempt.attemptId,
52347
- status: "cancelled",
52348
- exitCode: null,
52349
- completedAt: this.now().toISOString()
52350
- });
52351
52411
  }
52352
- }
52353
- function isProvenAbsentOrTerminal(launchState) {
52354
- return launchState === "absent" || launchState === "terminal";
52355
- }
52356
- function createAwsEcsClient(region) {
52357
- const client = new ECSClient({ region });
52412
+ async writeCancellationReceipt(admission, attempt, taskArn) {
52413
+ const existing = await this.receipts.get(admission.runId, attempt.attemptId);
52414
+ if (!this.cancellationReceipt(existing, admission, { ...attempt, taskId: taskArn }))
52415
+ throw Error("Cancellation receipt authority unavailable");
52416
+ const completedAt = existing.completedAt ?? this.now().toISOString();
52417
+ const expected = { ...existing, status: "cancelled", completedAt, exitCode: existing.status === "cancelled" ? existing.exitCode : null };
52418
+ const run = await this.store.getRun(admission.runId);
52419
+ if (existing.status !== "cancelled" || run?.status !== "cancelled" || run.terminalReceiptId !== attempt.attemptId) {
52420
+ await this.receipts.finalize({ runId: admission.runId, attemptId: attempt.attemptId, status: "cancelled", exitCode: expected.exitCode, completedAt });
52421
+ }
52422
+ const persisted = await this.receipts.get(admission.runId, attempt.attemptId);
52423
+ const finalized = await this.store.getRun(admission.runId);
52424
+ if (!persisted || canonicalJson(persisted) !== canonicalJson(expected) || finalized?.status !== "cancelled" || finalized.terminalReceiptId !== attempt.attemptId) {
52425
+ throw Error("Cancellation receipt persistence is unconfirmed");
52426
+ }
52427
+ }
52428
+ }
52429
+ function createAwsEcsClient(region, options = {}) {
52430
+ if (options.cluster !== undefined && !validText(options.cluster))
52431
+ throw Error("An explicit nonempty ECS cluster is required");
52432
+ const client = options.transport ?? new ECSClient({ region });
52433
+ let boundCluster = options.cluster;
52434
+ const cluster = (requested) => {
52435
+ const next = requested ?? boundCluster ?? "default";
52436
+ if (!validText(next) || boundCluster !== undefined && next !== boundCluster)
52437
+ throw Error("ECS client cluster binding changed");
52438
+ return boundCluster ??= next;
52439
+ };
52440
+ const response = (value) => {
52441
+ if (!value || typeof value !== "object" || Array.isArray(value))
52442
+ throw Error("Incomplete ECS response");
52443
+ const result = value;
52444
+ if (result.failures !== undefined && (!Array.isArray(result.failures) || result.failures.length > 0))
52445
+ throw Error("ECS response contains failures");
52446
+ return result;
52447
+ };
52358
52448
  return {
52359
52449
  async runTask(input) {
52360
- const response = await client.send(new RunTaskCommand({
52361
- cluster: input.cluster,
52450
+ const result = response(await client.send(new RunTaskCommand({
52451
+ cluster: cluster(input.cluster),
52362
52452
  taskDefinition: input.taskDefinition,
52363
52453
  launchType: input.launchType,
52364
52454
  clientToken: input.clientToken,
52365
52455
  startedBy: input.startedBy,
52366
- networkConfiguration: {
52367
- awsvpcConfiguration: {
52368
- subnets: input.subnets,
52369
- securityGroups: input.securityGroups,
52370
- assignPublicIp: "DISABLED"
52371
- }
52372
- },
52373
- overrides: {
52374
- containerOverrides: [
52375
- {
52376
- name: input.containerName,
52377
- environment: input.environment,
52378
- cpu: Number(input.cpu),
52379
- memory: Number(input.memory)
52380
- }
52381
- ]
52382
- }
52383
- }));
52384
- const taskArn = response.tasks?.[0]?.taskArn ?? null;
52385
- if (!taskArn) {
52386
- const failure = response.failures?.[0];
52387
- throw new Error(`RunTask refused: ${failure?.reason ?? "no task and no failure detail"}`);
52388
- }
52389
- return { taskArn };
52456
+ networkConfiguration: { awsvpcConfiguration: { subnets: input.subnets, securityGroups: input.securityGroups, assignPublicIp: "DISABLED" } },
52457
+ overrides: { containerOverrides: [{ name: input.containerName, environment: input.environment, cpu: Number(input.cpu), memory: Number(input.memory) }] }
52458
+ })));
52459
+ if (!Array.isArray(result.tasks) || result.tasks.length !== 1 || !validText(result.tasks[0]?.taskArn))
52460
+ throw Error("RunTask did not return one exact task");
52461
+ return { taskArn: result.tasks[0].taskArn };
52390
52462
  },
52391
52463
  async listTasksByStartedBy(startedBy) {
52392
- const response = await client.send(new ListTasksCommand({ startedBy }));
52393
- return response.taskArns ?? [];
52464
+ const configuredCluster = cluster(), arns = [], tokens = new Set;
52465
+ let nextToken;
52466
+ for (let page = 0;page < 20; page++) {
52467
+ const result = response(await client.send(new ListTasksCommand({ cluster: configuredCluster, startedBy, ...nextToken ? { nextToken } : {} })));
52468
+ if (!Array.isArray(result.taskArns) || result.taskArns.length > 100 || !result.taskArns.every(validText))
52469
+ throw Error("Incomplete ECS task listing");
52470
+ arns.push(...result.taskArns);
52471
+ if (new Set(arns).size !== arns.length)
52472
+ throw Error("Repeated ECS task identity in listing");
52473
+ if (result.nextToken === undefined)
52474
+ return arns;
52475
+ if (!validText(result.nextToken) || tokens.has(result.nextToken))
52476
+ throw Error("Invalid ECS pagination cursor");
52477
+ tokens.add(result.nextToken);
52478
+ nextToken = result.nextToken;
52479
+ }
52480
+ throw Error("ECS task listing exceeded the bounded page limit");
52394
52481
  },
52395
52482
  async describeTasks(taskArns) {
52396
- const response = await client.send(new DescribeTasksCommand({ tasks: taskArns }));
52397
- return (response.tasks ?? []).map((task) => ({
52398
- taskArn: task.taskArn ?? "",
52399
- lastStatus: task.lastStatus ?? "UNKNOWN",
52400
- stopCode: task.stopCode ?? null,
52401
- exitCode: task.containers?.[0]?.exitCode ?? null
52402
- }));
52483
+ if (!taskArns.length || taskArns.length > 100 || !taskArns.every(validText) || new Set(taskArns).size !== taskArns.length)
52484
+ throw Error("Invalid ECS task identities");
52485
+ const result = response(await client.send(new DescribeTasksCommand({ cluster: cluster(), tasks: taskArns })));
52486
+ if (!Array.isArray(result.tasks) || result.tasks.length !== taskArns.length || new Set(result.tasks.map((task) => task?.taskArn)).size !== taskArns.length || result.tasks.some((task) => !taskArns.includes(task?.taskArn) || !validText(task?.lastStatus)))
52487
+ throw Error("Incomplete ECS task descriptions");
52488
+ return result.tasks.map((task) => ({ taskArn: task.taskArn, lastStatus: task.lastStatus, stopCode: task.stopCode ?? null, exitCode: task.containers?.[0]?.exitCode ?? null }));
52403
52489
  },
52404
52490
  async stopTask(taskArn) {
52405
- await client.send(new StopTaskCommand({ task: taskArn }));
52491
+ if (!validText(taskArn))
52492
+ throw Error("Invalid ECS task identity");
52493
+ const result = response(await client.send(new StopTaskCommand({ cluster: cluster(), task: taskArn })));
52494
+ if (result.task?.taskArn !== taskArn || !validText(result.task?.lastStatus))
52495
+ throw Error("Incomplete ECS stop response");
52406
52496
  }
52407
52497
  };
52408
52498
  }
52499
+ function validText(value) {
52500
+ return typeof value === "string" && value.length > 0 && value.trim() === value && value.length <= 2048;
52501
+ }
52409
52502
  // src/sdk/execution/dispatchers/e2b.ts
52410
52503
  var E2B_LANE_STATUS = "e2b-lane-todo-infinity";
52411
52504
 
@@ -53097,8 +53190,17 @@ function creditCount(value) {
53097
53190
  }
53098
53191
  return value;
53099
53192
  }
53193
+ function runQuoteReceipt(value) {
53194
+ if (value === undefined)
53195
+ return;
53196
+ if (typeof value !== "string" || !value.length || Buffer.byteLength(value, "utf8") > 4096) {
53197
+ throw new Error("Invalid quote receipt");
53198
+ }
53199
+ return value;
53200
+ }
53100
53201
  function parseRemoteRunQuote(value) {
53101
53202
  const quote = object(value);
53203
+ runQuoteReceipt(quote.quoteReceipt);
53102
53204
  const pricing = object(quote.pricing);
53103
53205
  if (typeof quote.skill !== "string" || !/^[a-z0-9][a-z0-9-]*$/.test(quote.skill))
53104
53206
  throw new Error("Invalid quoted skill");
@@ -53164,7 +53266,7 @@ function describeRemoteFiles(files) {
53164
53266
  const names = new Set;
53165
53267
  let total = 0;
53166
53268
  return files.map((file) => {
53167
- if (!/^[A-Za-z0-9][A-Za-z0-9._-]{0,199}$/.test(file.name) || file.name === "." || file.name === ".." || names.has(file.name))
53269
+ if (typeof file.name !== "string" || file.name.length === 0 || file.name.length > 255 || /[/\\\x00-\x1f\x7f]/.test(file.name) || /[\ud800-\udfff]/u.test(file.name) || file.name === "." || file.name === ".." || names.has(file.name))
53168
53270
  throw new Error("Input file names must be unique safe basenames");
53169
53271
  names.add(file.name);
53170
53272
  total += file.bytes.byteLength;
@@ -53383,7 +53485,7 @@ class RemoteSkillsClient {
53383
53485
  this.apiUrl = normalizeSkillsApiOrigin(apiUrl);
53384
53486
  }
53385
53487
  async request(path, options) {
53386
- return fetch(`${this.apiUrl}${path}`, {
53488
+ return fetch(skillsApiRequestUrl(this.apiUrl, path), {
53387
53489
  ...options,
53388
53490
  redirect: "error",
53389
53491
  credentials: "omit",
@@ -53443,6 +53545,7 @@ class RemoteSkillsClient {
53443
53545
  return { status: res.status, body };
53444
53546
  }
53445
53547
  async submitRun(slug, input, args, approval = {}) {
53548
+ const quoteReceipt = runQuoteReceipt(approval.quoteReceipt);
53446
53549
  if (approval.idempotencyKey !== undefined && !/^[A-Za-z0-9._:-]{1,128}$/.test(approval.idempotencyKey))
53447
53550
  throw new Error("Idempotency key must be 1-128 URL-safe characters");
53448
53551
  if (approval.maxCostCents !== undefined)
@@ -53459,15 +53562,20 @@ class RemoteSkillsClient {
53459
53562
  ...approval.maxCredits !== undefined ? { maxCredits: approval.maxCredits } : {},
53460
53563
  ...approval.maxCostCents !== undefined ? { maxCostCents: approval.maxCostCents } : {},
53461
53564
  ...approval.idempotencyKey !== undefined ? { idempotencyKey: approval.idempotencyKey } : {},
53462
- ...approval.inputFiles !== undefined ? { files: approval.inputFiles } : {}
53565
+ ...approval.inputFiles !== undefined ? { files: approval.inputFiles } : {},
53566
+ ...quoteReceipt !== undefined ? { quoteReceipt } : {}
53463
53567
  })
53464
53568
  });
53569
+ if (!res.ok) {
53570
+ res.body?.cancel().catch(() => {});
53571
+ throw new RemoteRequestError(`/api/v1/runs/${encodeURIComponent(slug)}`, res.status);
53572
+ }
53465
53573
  return normalizeRemoteSkillRunContract(await res.json(), slug);
53466
53574
  }
53467
- async quoteRun(slug, input = {}, args = []) {
53575
+ async quoteRun(slug, input = {}, args = [], files) {
53468
53576
  const response = await this.requestNewRoute(`/api/v1/skills/${encodeURIComponent(slug)}/quote`, {
53469
53577
  method: "POST",
53470
- body: JSON.stringify({ input, args })
53578
+ body: JSON.stringify({ input, args, ...files === undefined ? {} : { files } })
53471
53579
  }, { quoteRefusal: true });
53472
53580
  return parseRemoteRunQuote(await response.json());
53473
53581
  }
@@ -53483,17 +53591,24 @@ class RemoteSkillsClient {
53483
53591
  return this.capabilities;
53484
53592
  }
53485
53593
  async submitQuotedRun(slug, input = {}, args = [], approval = {}) {
53594
+ runQuoteReceipt(approval.quoteReceipt);
53595
+ ({ input, args, approval } = JSON.parse(JSON.stringify({ input, args, approval })));
53486
53596
  const maximum = creditCount(approval.maxCredits ?? approval.maxCostCents ?? 0);
53487
53597
  if (approval.maxCostCents !== undefined && approval.maxCostCents !== maximum)
53488
53598
  throw new Error("Credit approval fields disagree");
53489
- const quote = await this.quoteRun(slug, input, args);
53490
- if (quote.pricing.costCents > maximum)
53599
+ const quote = approval.quoteReceipt === undefined ? await this.quoteRun(slug, input, args, approval.inputFiles?.length ? approval.inputFiles : undefined) : undefined;
53600
+ if (quote && quote.pricing.costCents > maximum)
53491
53601
  throw new RemoteCreditApprovalError(quote.pricing.costCents, maximum);
53492
53602
  const capabilities = await this.getCapabilities();
53493
53603
  if (!capabilities.capabilities.includes("runs.submit") || capabilities.billing?.boundedRunApproval !== true || capabilities.billing.unit !== "credits") {
53494
53604
  throw new Error("The configured server does not support bounded credit approval; refusing remote submission");
53495
53605
  }
53496
- return this.submitRun(quote.skill, input, args, { ...approval, maxCredits: maximum, maxCostCents: maximum });
53606
+ return this.submitRun(quote?.skill ?? slug, input, args, {
53607
+ ...approval,
53608
+ maxCredits: maximum,
53609
+ maxCostCents: maximum,
53610
+ ...(quote?.quoteReceipt ?? approval.quoteReceipt) === undefined ? {} : { quoteReceipt: quote?.quoteReceipt ?? approval.quoteReceipt }
53611
+ });
53497
53612
  }
53498
53613
  async getIdentity() {
53499
53614
  return (await this.requestNewRoute("/api/auth/whoami")).json();
@@ -53781,6 +53896,10 @@ class RemoteSkillsClient {
53781
53896
  return { id: artifactId2, fileName: String(artifact.fileName ?? artifactId2), bytes, byteSize: bytes.byteLength, sha256: artifact.sha256 };
53782
53897
  }
53783
53898
  async submitQuotedRunWithFiles(slug, input, args, files, approval = {}) {
53899
+ runQuoteReceipt(approval.quoteReceipt);
53900
+ ({ input, args, approval } = JSON.parse(JSON.stringify({ input, args, approval })));
53901
+ describeRemoteFiles(files);
53902
+ files = files.map((file) => ({ name: file.name, contentType: file.contentType, bytes: new Uint8Array(file.bytes) }));
53784
53903
  const inputFiles = describeRemoteFiles(files);
53785
53904
  if (files.length && !(await this.getCapabilities()).capabilities.includes("runs.uploads"))
53786
53905
  throw new Error("The configured server does not support input uploads");
@@ -53844,7 +53963,7 @@ class RemoteSkillsClient {
53844
53963
  const headers = { Authorization: `Bearer ${this.apiKey}` };
53845
53964
  if (ifMatch)
53846
53965
  headers["If-Match"] = ifMatch;
53847
- return fetch(`${this.apiUrl}/api/v1/skills`, {
53966
+ return fetch(skillsApiRequestUrl(this.apiUrl, "/api/v1/skills"), {
53848
53967
  method: "POST",
53849
53968
  headers,
53850
53969
  body: form,
@@ -54129,7 +54248,7 @@ async function requestInvitationEmail(origin, action, input) {
54129
54248
  }
54130
54249
  const body = JSON.stringify({ invitationId: value.invitationId, token: value.token, challengeId: value.challengeId, ...action === "accept" ? { code: value.code } : {} });
54131
54250
  try {
54132
- const response = await fetch(`${target}/api/v1/account/invitations/email-${action}`, {
54251
+ const response = await fetch(skillsApiRequestUrl(target, `/api/v1/account/invitations/email-${action}`), {
54133
54252
  method: "POST",
54134
54253
  headers: { "Content-Type": "application/json" },
54135
54254
  body,
@@ -54160,6 +54279,312 @@ async function requestInvitationEmail(origin, action, input) {
54160
54279
  throw new RemoteInvitationEmailUnconfirmedError(action);
54161
54280
  }
54162
54281
 
54282
+ // src/lib/remote-private-publications.ts
54283
+ import { createHash as createHash14 } from "crypto";
54284
+ var PRIVATE_PUBLICATION_MAX_BYTES = 16 * 1024 * 1024;
54285
+ var failures = {
54286
+ INVALID_REQUEST: [400, "The publication request is invalid."],
54287
+ SESSION_EXPIRED: [401, "Sign in again to manage this publication."],
54288
+ ACCOUNT_UNAVAILABLE: [403, "The account is unavailable."],
54289
+ INTERACTIVE_SESSION_REQUIRED: [403, "An interactive account session is required."],
54290
+ PUBLICATION_FORBIDDEN: [403, "This session cannot manage the publication."],
54291
+ PUBLICATION_ENTITLEMENT_REQUIRED: [403, "The workspace is not entitled to publish private skills."],
54292
+ PUBLICATION_UNAVAILABLE: [404, "The publication is unavailable to this session."],
54293
+ MANIFEST_NAME_MISMATCH: [409, "The manifest name does not match the selected skill."],
54294
+ IDEMPOTENCY_CONFLICT: [409, "This request key already identifies different publication bytes. Use the saved recovery directory."],
54295
+ CURRENT_VERSION_CHANGED: [409, "The current version changed. Inspect it before explicitly starting another publication."],
54296
+ VERSION_EXISTS: [409, "This version already exists."],
54297
+ VERSION_RESERVED: [409, "This version is reserved by another publication."],
54298
+ PUBLICATION_COMMITTED: [409, "The publication is already committed."],
54299
+ PUBLICATION_UPLOAD_UNAVAILABLE: [409, "This publication cannot receive another upload."],
54300
+ PUBLICATION_LIMIT: [429, "The workspace publication limit has been reached."],
54301
+ PUBLICATION_BUSY: [503, "The publication is busy. Reconcile the saved intent before retrying."],
54302
+ PUBLICATION_UNCERTAIN: [503, "The publication outcome is uncertain. Reconcile the saved intent."],
54303
+ PUBLICATION_CAPABILITY_UNAVAILABLE: [503, "Private publishing is not enabled on this server."],
54304
+ PUBLICATION_SIGNING_UNAVAILABLE: [503, "Upload authorization is temporarily unavailable. Keep the same intent."]
54305
+ };
54306
+
54307
+ class PrivatePublicationError extends Error {
54308
+ code;
54309
+ uncertain;
54310
+ status;
54311
+ constructor(code, message, uncertain = false, status) {
54312
+ super(message);
54313
+ this.code = code;
54314
+ this.uncertain = uncertain;
54315
+ this.status = status;
54316
+ this.name = "PrivatePublicationError";
54317
+ }
54318
+ }
54319
+ var bad = () => {
54320
+ throw new PrivatePublicationError("INVALID_PUBLICATION_INPUT", "Invalid publication input or recovery data.");
54321
+ };
54322
+ var invalid3 = () => {
54323
+ throw new PrivatePublicationError("INVALID_PUBLICATION_RESPONSE", "The server returned an invalid publication result.");
54324
+ };
54325
+ var publicationUuid = (v2) => typeof v2 === "string" && /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/.test(v2);
54326
+ var hash = (v2) => typeof v2 === "string" && /^[a-f0-9]{64}$/.test(v2);
54327
+ var record5 = (v2) => !!v2 && typeof v2 === "object" && !Array.isArray(v2);
54328
+ var exact = (v2, keys) => record5(v2) && Object.keys(v2).sort().join(",") === keys.sort().join(",");
54329
+ var date = (v2) => typeof v2 === "string" && /^\d{4}-\d\d-\d\dT[0-9:.]+(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/.test(v2) && Number.isFinite(Date.parse(v2));
54330
+ var publicationSha256 = (bytes) => createHash14("sha256").update(bytes).digest("hex");
54331
+ function checkedPublicationDeclaration(value) {
54332
+ if (!exact(value, ["idempotencyKey", "version", "expectedCurrentVersionId", "manifestText", "archiveSha256", "archiveByteSize"]) || !publicationUuid(value.idempotencyKey) || !(value.expectedCurrentVersionId === null || publicationUuid(value.expectedCurrentVersionId)) || typeof value.version !== "string" || !value.version || value.version.length > 128 || /[\p{Cc}\p{Cs}]/u.test(value.version) || typeof value.manifestText !== "string" || Buffer.byteLength(value.manifestText) > 16384 || !hash(value.archiveSha256) || !Number.isSafeInteger(value.archiveByteSize) || Number(value.archiveByteSize) < 1 || Number(value.archiveByteSize) > PRIVATE_PUBLICATION_MAX_BYTES)
54333
+ return bad();
54334
+ try {
54335
+ const manifest = JSON.parse(value.manifestText);
54336
+ if (!record5(manifest) || manifest.version !== value.version || validatePortableManifestContract(manifest, { strict: true }).length || !hash(manifest.provenance?.content_hash))
54337
+ return bad();
54338
+ } catch {
54339
+ return bad();
54340
+ }
54341
+ return Object.freeze({ ...value });
54342
+ }
54343
+ function checkedPublicationView(value, skillId, intentId, declaration) {
54344
+ if (!exact(value, ["id", "skillId", "version", "expectedCurrentVersionId", "archiveSha256", "archiveByteSize", "state", "expiresAt", "createdAt", "versionId"]) || !publicationUuid(value.id) || value.skillId !== skillId || intentId !== undefined && value.id !== intentId || typeof value.version !== "string" || !value.version || value.version.length > 128 || /[\p{Cc}\p{Cs}]/u.test(value.version) || !(value.expectedCurrentVersionId === null || publicationUuid(value.expectedCurrentVersionId)) || !hash(value.archiveSha256) || !Number.isSafeInteger(value.archiveByteSize) || Number(value.archiveByteSize) < 1 || Number(value.archiveByteSize) > PRIVATE_PUBLICATION_MAX_BYTES || typeof value.state !== "string" || !["awaiting_upload", "queued", "verifying", "needs_attention", "committed", "rejected", "cancelled", "expired"].includes(value.state) || !date(value.expiresAt) || !date(value.createdAt) || !(value.versionId === null || publicationUuid(value.versionId)) || value.state === "committed" && value.versionId === null)
54345
+ return invalid3();
54346
+ if (declaration && ["version", "expectedCurrentVersionId", "archiveSha256", "archiveByteSize"].some((k4) => value[k4] !== declaration[k4]))
54347
+ return invalid3();
54348
+ return Object.freeze({ ...value });
54349
+ }
54350
+ async function boundedJson(url, init, token, mutation, budget = 15000, signal) {
54351
+ const controller = new AbortController;
54352
+ let reader;
54353
+ let response;
54354
+ const timeout = new PrivatePublicationError("PUBLICATION_UNCONFIRMED", "No confirmed publication result. Inspect the saved intent before retrying.", mutation);
54355
+ let timer;
54356
+ let abort;
54357
+ try {
54358
+ return await Promise.race([(async () => {
54359
+ if (signal?.aborted)
54360
+ throw timeout;
54361
+ response = await fetch(url, {
54362
+ ...init,
54363
+ redirect: "error",
54364
+ credentials: "omit",
54365
+ signal: controller.signal,
54366
+ headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}` }
54367
+ });
54368
+ const length = response.headers.get("content-length");
54369
+ if (length !== null && (!/^\d+$/.test(length) || Number(length) > 65536))
54370
+ return invalid3();
54371
+ reader = response.body?.getReader();
54372
+ const chunks = [];
54373
+ let size = 0;
54374
+ if (reader)
54375
+ while (true) {
54376
+ const part = await reader.read();
54377
+ if (part.done)
54378
+ break;
54379
+ size += part.value.byteLength;
54380
+ if (size > 65536)
54381
+ return invalid3();
54382
+ chunks.push(part.value);
54383
+ }
54384
+ if (controller.signal.aborted)
54385
+ throw timeout;
54386
+ const bytes = Buffer.concat(chunks);
54387
+ let body;
54388
+ try {
54389
+ body = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
54390
+ } catch {
54391
+ return invalid3();
54392
+ }
54393
+ if (!response.ok) {
54394
+ const code = record5(body) && typeof body.code === "string" && Object.hasOwn(failures, body.code) ? body.code : null;
54395
+ if (code && failures[code][0] === response.status)
54396
+ throw new PrivatePublicationError(code, failures[code][1], mutation && code === "PUBLICATION_UNCERTAIN", response.status);
54397
+ throw new PrivatePublicationError("PUBLICATION_REQUEST_FAILED", "The publication request was refused. Inspect its status before retrying.", mutation && response.status >= 500, response.status);
54398
+ }
54399
+ return body;
54400
+ })(), new Promise((_, reject) => {
54401
+ abort = () => {
54402
+ controller.abort();
54403
+ reject(timeout);
54404
+ };
54405
+ timer = setTimeout(abort, Math.max(1, Math.min(15000, budget)));
54406
+ signal?.addEventListener("abort", abort, { once: true });
54407
+ })]);
54408
+ } catch (error) {
54409
+ if (error instanceof PrivatePublicationError) {
54410
+ if (mutation && error.code === "INVALID_PUBLICATION_RESPONSE")
54411
+ throw timeout;
54412
+ throw error;
54413
+ }
54414
+ throw timeout;
54415
+ } finally {
54416
+ if (timer)
54417
+ clearTimeout(timer);
54418
+ if (abort)
54419
+ signal?.removeEventListener("abort", abort);
54420
+ controller.abort();
54421
+ if (reader)
54422
+ reader.cancel().catch(() => {});
54423
+ else
54424
+ response?.body?.cancel().catch(() => {});
54425
+ }
54426
+ }
54427
+
54428
+ class RemotePrivatePublicationsClient {
54429
+ apiOrigin;
54430
+ organizationId;
54431
+ userId;
54432
+ membershipId;
54433
+ #token;
54434
+ constructor(apiUrl, session) {
54435
+ const checked = parseWorkspaceSession(session, { userId: session?.user?.id, membershipId: session?.user?.membershipId });
54436
+ if (checked.user.role === "viewer")
54437
+ throw new PrivatePublicationError("PUBLICATION_FORBIDDEN", failures.PUBLICATION_FORBIDDEN[1]);
54438
+ this.apiOrigin = normalizeSkillsApiOrigin(apiUrl);
54439
+ this.#token = checked.token;
54440
+ this.organizationId = checked.organization.id;
54441
+ this.userId = checked.user.id;
54442
+ this.membershipId = checked.user.membershipId;
54443
+ Object.freeze(this);
54444
+ }
54445
+ async getCapability(options = {}) {
54446
+ if (options.timeoutMs !== undefined && (!Number.isSafeInteger(options.timeoutMs) || options.timeoutMs < 1 || options.timeoutMs > 15000))
54447
+ return bad();
54448
+ const response = await boundedJson(skillsApiRequestUrl(this.apiOrigin, "/api/v1/capabilities"), {}, this.#token, false, options.timeoutMs, options.signal);
54449
+ const p2 = record5(response) && response.privatePublishing;
54450
+ if (!record5(response) || response.contractVersion !== 1 || response.apiVersion !== 1 || !exact(p2, ["contractVersion", "enabled", "authentication", "maxArchiveBytes", "uploadMaxTtlSeconds", "executionEnabled"]) || p2.contractVersion !== 1 || typeof p2.enabled !== "boolean" || p2.authentication !== "interactive-session" || p2.maxArchiveBytes !== PRIVATE_PUBLICATION_MAX_BYTES || p2.uploadMaxTtlSeconds !== 300 || p2.executionEnabled !== false)
54451
+ throw new PrivatePublicationError("PUBLICATION_CONTRACT_UNAVAILABLE", "This server does not support the hosted private publication contract.");
54452
+ return Object.freeze({ ...p2 });
54453
+ }
54454
+ async#gate(enabled, options = {}) {
54455
+ if (!(await this.getCapability(options)).enabled && enabled)
54456
+ throw new PrivatePublicationError("PUBLICATION_CAPABILITY_UNAVAILABLE", failures.PUBLICATION_CAPABILITY_UNAVAILABLE[1]);
54457
+ }
54458
+ #path(skillId, intentId) {
54459
+ if (!publicationUuid(skillId) || intentId !== undefined && !publicationUuid(intentId))
54460
+ return bad();
54461
+ return skillsApiRequestUrl(this.apiOrigin, `/api/v1/skills/${skillId}/publication-uploads${intentId ? `/${intentId}` : ""}`);
54462
+ }
54463
+ async#view(path, method, skillId, intentId, declaration, options = {}) {
54464
+ const value = await boundedJson(path, { method, ...method === "GET" ? {} : { body: JSON.stringify(declaration ?? {}) } }, this.#token, method !== "GET", options.timeoutMs, options.signal);
54465
+ try {
54466
+ if (!record5(value) || !Object.keys(value).every((k4) => k4 === "upload" || k4 === "changed") || value.changed !== undefined && typeof value.changed !== "boolean")
54467
+ return invalid3();
54468
+ return checkedPublicationView(value.upload, skillId, intentId, declaration);
54469
+ } catch (error) {
54470
+ if (method !== "GET")
54471
+ throw new PrivatePublicationError("PUBLICATION_UNCONFIRMED", "The publication result could not be confirmed. Reconcile the saved intent before another action.", true);
54472
+ throw error;
54473
+ }
54474
+ }
54475
+ async begin(skillId, input) {
54476
+ const path = this.#path(skillId), declaration = checkedPublicationDeclaration(input);
54477
+ await this.#gate(true);
54478
+ return this.#view(path, "POST", skillId, undefined, declaration);
54479
+ }
54480
+ async get(skillId, intentId, options = {}) {
54481
+ const path = this.#path(skillId, intentId), until = Date.now() + (options.timeoutMs ?? 15000);
54482
+ await this.#gate(false, options);
54483
+ return this.#view(path, "GET", skillId, intentId, undefined, { ...options, timeoutMs: Math.max(1, until - Date.now()) });
54484
+ }
54485
+ async finalize(skillId, intentId) {
54486
+ const path = this.#path(skillId, intentId);
54487
+ await this.#gate(true);
54488
+ return this.#view(`${path}/finalize`, "POST", skillId, intentId);
54489
+ }
54490
+ async cancel(skillId, intentId) {
54491
+ const path = this.#path(skillId, intentId);
54492
+ await this.#gate(false);
54493
+ return this.#view(path, "DELETE", skillId, intentId);
54494
+ }
54495
+ async upload(skillId, intent, bytes) {
54496
+ const captured = checkedPublicationView(intent, skillId), path = this.#path(skillId, captured.id);
54497
+ if (!(bytes instanceof Uint8Array) || bytes.byteLength !== captured.archiveByteSize)
54498
+ return bad();
54499
+ const owned = Buffer.from(bytes);
54500
+ if (captured.state !== "awaiting_upload" || owned.byteLength !== captured.archiveByteSize || publicationSha256(owned) !== captured.archiveSha256)
54501
+ return bad();
54502
+ await this.#gate(true);
54503
+ const value = await boundedJson(`${path}/upload-url`, { method: "POST", body: "{}" }, this.#token, false);
54504
+ const upload = this.#upload(value, captured);
54505
+ const controller = new AbortController;
54506
+ let timer;
54507
+ const uncertain = () => new PrivatePublicationError("PUBLICATION_UPLOAD_UNCONFIRMED", "Upload acceptance is uncertain. Resume this saved intent to finalize and inspect it; do not upload again.", true);
54508
+ try {
54509
+ await Promise.race([(async () => {
54510
+ const response = await fetch(upload.uploadUrl, { method: "PUT", headers: upload.headers, body: owned, redirect: "error", credentials: "omit", signal: controller.signal });
54511
+ response.body?.cancel().catch(() => {});
54512
+ if (response.status !== 200 || controller.signal.aborted)
54513
+ throw uncertain();
54514
+ })(), new Promise((_, reject) => {
54515
+ timer = setTimeout(() => {
54516
+ controller.abort();
54517
+ reject(uncertain());
54518
+ }, 30000);
54519
+ })]);
54520
+ } catch {
54521
+ throw uncertain();
54522
+ } finally {
54523
+ if (timer)
54524
+ clearTimeout(timer);
54525
+ controller.abort();
54526
+ }
54527
+ }
54528
+ #upload(value, intent) {
54529
+ if (!exact(value, ["upload"]) || !exact(value.upload, ["method", "uploadUrl", "headers", "expiresAt"]))
54530
+ return invalid3();
54531
+ const p2 = value.upload;
54532
+ if (p2.method !== "PUT" || typeof p2.uploadUrl !== "string" || p2.uploadUrl.length > 8192 || /[\x00-\x20\x7f]/.test(p2.uploadUrl) || !date(p2.expiresAt) || Date.parse(p2.expiresAt) - Date.now() < 1000 || Date.parse(p2.expiresAt) - Date.now() > 300000 || Date.parse(p2.expiresAt) > Date.parse(intent.expiresAt) || !exact(p2.headers, ["content-type", "content-length", "x-amz-checksum-sha256", "x-amz-expected-bucket-owner"]) || p2.headers["content-type"] !== "application/gzip" || p2.headers["content-length"] !== String(intent.archiveByteSize) || p2.headers["x-amz-checksum-sha256"] !== Buffer.from(intent.archiveSha256, "hex").toString("base64") || typeof p2.headers["x-amz-expected-bucket-owner"] !== "string" || !/^\d{12}$/.test(p2.headers["x-amz-expected-bucket-owner"]))
54533
+ return invalid3();
54534
+ let url;
54535
+ try {
54536
+ url = new URL(p2.uploadUrl);
54537
+ } catch {
54538
+ return invalid3();
54539
+ }
54540
+ if (url.protocol !== "https:" || url.port || url.username || url.password || url.hash || !/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]\.s3\.[a-z]{2}(?:-[a-z]+)+-[1-9]\.amazonaws\.com$/.test(url.hostname) || url.pathname !== `/private-publication-staging/${this.organizationId}/${intent.id}/bundle.tgz` || !url.search || url.searchParams.get("X-Amz-Algorithm") !== "AWS4-HMAC-SHA256" || url.searchParams.get("X-Amz-SignedHeaders") !== "content-length;content-type;host;x-amz-checksum-sha256;x-amz-expected-bucket-owner" || !/^[a-f0-9]{64}$/.test(url.searchParams.get("X-Amz-Signature") ?? ""))
54541
+ return invalid3();
54542
+ const queryKeys = ["X-Amz-Algorithm", "X-Amz-Credential", "X-Amz-Date", "X-Amz-Expires", "X-Amz-Security-Token", "X-Amz-Signature", "X-Amz-SignedHeaders"];
54543
+ if ([...url.searchParams.keys()].sort().join(",") !== queryKeys.sort().join(","))
54544
+ return invalid3();
54545
+ const issued = url.searchParams.get("X-Amz-Date"), ttl = url.searchParams.get("X-Amz-Expires"), credential = url.searchParams.get("X-Amz-Credential");
54546
+ const timestamp3 = /^(\d{4})(\d\d)(\d\d)T(\d\d)(\d\d)(\d\d)Z$/.exec(issued);
54547
+ const region = url.hostname.split(".s3.")[1].split(".amazonaws.com")[0];
54548
+ if (!timestamp3 || !/^[1-9]\d{0,2}$/.test(ttl) || Number(ttl) > 300 || !/^[A-Z0-9]{16,128}\//.test(credential) || credential.split("/").slice(1).join("/") !== `${issued.slice(0, 8)}/${region}/s3/aws4_request` || !/^[\x21-\x7e]{1,4096}$/.test(url.searchParams.get("X-Amz-Security-Token")))
54549
+ return invalid3();
54550
+ const issuedAt = Date.parse(`${timestamp3[1]}-${timestamp3[2]}-${timestamp3[3]}T${timestamp3[4]}:${timestamp3[5]}:${timestamp3[6]}Z`);
54551
+ if (!Number.isFinite(issuedAt) || issuedAt > Date.now() + 1000 || issuedAt + Number(ttl) * 1000 !== Date.parse(p2.expiresAt))
54552
+ return invalid3();
54553
+ return { method: "PUT", uploadUrl: url.href, expiresAt: p2.expiresAt, headers: Object.freeze({ ...p2.headers }) };
54554
+ }
54555
+ async wait(skillId, intentId, options = {}) {
54556
+ const timeout = options.timeoutMs ?? 60000;
54557
+ if (!Number.isSafeInteger(timeout) || timeout < 0 || timeout > 300000)
54558
+ return bad();
54559
+ const until = Date.now() + timeout;
54560
+ let previous;
54561
+ while (true) {
54562
+ if (options.signal?.aborted)
54563
+ throw new PrivatePublicationError("PUBLICATION_WAIT_ABORTED", "Stopped waiting. The server publication continues; inspect the saved intent.");
54564
+ let view;
54565
+ try {
54566
+ view = await this.get(skillId, intentId, { timeoutMs: timeout === 0 ? 15000 : Math.max(1, Math.min(15000, until - Date.now())), signal: options.signal });
54567
+ } catch (error) {
54568
+ if (previous && Date.now() >= until && !options.signal?.aborted)
54569
+ return previous;
54570
+ throw error;
54571
+ }
54572
+ previous = view;
54573
+ if (!["queued", "verifying"].includes(view.state) || Date.now() >= until)
54574
+ return view;
54575
+ await new Promise((resolve4) => {
54576
+ const timer = setTimeout(done, Math.min(1000, until - Date.now()));
54577
+ function done() {
54578
+ clearTimeout(timer);
54579
+ options.signal?.removeEventListener("abort", done);
54580
+ resolve4();
54581
+ }
54582
+ options.signal?.addEventListener("abort", done, { once: true });
54583
+ });
54584
+ }
54585
+ }
54586
+ }
54587
+
54163
54588
  // src/lib/remote-auth.ts
54164
54589
  var MAX_ERROR_DETAIL_LENGTH = 200;
54165
54590
 
@@ -54182,10 +54607,11 @@ class HostedApiError extends Error {
54182
54607
  async function requestAuthApi(instance, path, options) {
54183
54608
  const url = normalizeSkillsApiOrigin(instance);
54184
54609
  const safeUrl = url;
54185
- const endpoint = `${(options?.method || "GET").toUpperCase()} ${safeUrl}${path}`;
54610
+ const requestUrl = skillsApiRequestUrl(url, path);
54611
+ const endpoint = `${(options?.method || "GET").toUpperCase()} ${requestUrl}`;
54186
54612
  let res;
54187
54613
  try {
54188
- res = await fetch(`${url}${path}`, {
54614
+ res = await fetch(requestUrl, {
54189
54615
  ...options,
54190
54616
  redirect: "error",
54191
54617
  signal: options?.signal ?? AbortSignal.timeout(15000),
@@ -54200,10 +54626,10 @@ async function requestAuthApi(instance, path, options) {
54200
54626
  const text2 = await res.text();
54201
54627
  const body = text2 ? parseJsonBody(text2) : {};
54202
54628
  if (!res.ok) {
54203
- const record5 = isRecord6(body) ? body : {};
54204
- const detail = typeof record5.detail === "string" ? record5.detail : undefined;
54205
- const error = typeof record5.error === "string" ? record5.error : undefined;
54206
- const code = typeof record5.code === "string" ? record5.code : undefined;
54629
+ const record6 = isRecord6(body) ? body : {};
54630
+ const detail = typeof record6.detail === "string" ? record6.detail : undefined;
54631
+ const error = typeof record6.error === "string" ? record6.error : undefined;
54632
+ const code = typeof record6.code === "string" ? record6.code : undefined;
54207
54633
  throw new HostedApiError(detail || error || `${res.status} ${res.statusText}`, {
54208
54634
  status: res.status,
54209
54635
  code,
@@ -54237,6 +54663,10 @@ class RemoteSkillsAuthClient {
54237
54663
  constructor(apiUrl) {
54238
54664
  this.apiOrigin = normalizeSkillsApiOrigin(apiUrl);
54239
54665
  }
54666
+ async openPrivatePublications(email2, code, context) {
54667
+ const origin = this.apiOrigin, captured = workspaceContext(context);
54668
+ return new RemotePrivatePublicationsClient(origin, await this.switchWorkspace(email2, code, captured));
54669
+ }
54240
54670
  requestInvitationEmailChallenge(input) {
54241
54671
  return requestInvitationEmail(this.apiOrigin, "challenge", input);
54242
54672
  }
@@ -54284,9 +54714,10 @@ class RemoteSkillsAuthClient {
54284
54714
  const apiOrigin = this.apiOrigin;
54285
54715
  if (typeof email2 !== "string" || !email2.includes("@") || typeof code !== "string" || !/^\d{6}$/.test(code))
54286
54716
  throw new Error("Fresh email and six-digit verification code are required to manage this account");
54717
+ const requestUrl = skillsApiRequestUrl(apiOrigin, "/api/auth/verify");
54287
54718
  let response;
54288
54719
  try {
54289
- response = await fetch(`${apiOrigin}/api/auth/verify`, {
54720
+ response = await fetch(requestUrl, {
54290
54721
  method: "POST",
54291
54722
  redirect: "error",
54292
54723
  credentials: "omit",
@@ -54377,144 +54808,387 @@ class RemoteSkillsAuthClient {
54377
54808
  return requestAuthApi(this.apiOrigin, path, options);
54378
54809
  }
54379
54810
  }
54811
+ // src/lib/private-publication-recovery.ts
54812
+ import { constants as constants2, closeSync as closeSync3, fsyncSync, fstatSync as fstatSync3, lstatSync as lstatSync5, mkdirSync as mkdirSync8, openSync as openSync3, readSync as readSync2, realpathSync as realpathSync2, renameSync as renameSync3, unlinkSync, writeFileSync as writeFileSync6 } from "fs";
54813
+ import { dirname as dirname10, isAbsolute as isAbsolute5, join as join21, resolve as resolve4 } from "path";
54814
+ import { randomUUID as randomUUID6 } from "crypto";
54815
+ var fail = () => {
54816
+ throw new PrivatePublicationError("PUBLICATION_RECOVERY_INVALID", "The recovery directory is invalid or changed. Preserve it and inspect the existing intent; do not start a replacement automatically.");
54817
+ };
54818
+ function safeDirectory(directory) {
54819
+ if (!isAbsolute5(directory) || directory !== resolve4(directory) || realpathSync2(directory) !== directory)
54820
+ return fail();
54821
+ for (let path = directory;; path = dirname10(path)) {
54822
+ const stat = lstatSync5(path);
54823
+ if (!stat.isDirectory() || stat.isSymbolicLink())
54824
+ return fail();
54825
+ if (path === dirname10(path))
54826
+ break;
54827
+ }
54828
+ const own = lstatSync5(directory);
54829
+ if ((own.mode & 63) !== 0 || process.getuid && own.uid !== process.getuid())
54830
+ return fail();
54831
+ return { dev: own.dev, ino: own.ino };
54832
+ }
54833
+ function unchangedDirectory(directory, identity) {
54834
+ const now2 = safeDirectory(directory);
54835
+ if (now2.dev !== identity.dev || now2.ino !== identity.ino)
54836
+ return fail();
54837
+ }
54838
+ function readOwned(directory, name, max) {
54839
+ const identity = safeDirectory(directory), file = join21(directory, name);
54840
+ const fd = openSync3(file, constants2.O_RDONLY | constants2.O_NOFOLLOW);
54841
+ try {
54842
+ const stat = fstatSync3(fd);
54843
+ if (!stat.isFile() || stat.nlink !== 1 || stat.size > max || stat.size < 1 || (stat.mode & 63) !== 0 || process.getuid && stat.uid !== process.getuid())
54844
+ return fail();
54845
+ const buffer = Buffer.alloc(Math.min(max, stat.size) + 1);
54846
+ let length = 0;
54847
+ while (length < buffer.length) {
54848
+ const count = readSync2(fd, buffer, length, buffer.length - length, length);
54849
+ if (count === 0)
54850
+ break;
54851
+ length += count;
54852
+ }
54853
+ const bytes = buffer.subarray(0, length), after = fstatSync3(fd);
54854
+ unchangedDirectory(directory, identity);
54855
+ if (bytes.length !== stat.size || stat.size !== after.size || stat.mtimeMs !== after.mtimeMs || stat.ctimeMs !== after.ctimeMs)
54856
+ return fail();
54857
+ return bytes;
54858
+ } finally {
54859
+ closeSync3(fd);
54860
+ }
54861
+ }
54862
+ function writeOwned(directory, name, bytes) {
54863
+ const fd = openSync3(join21(directory, name), constants2.O_WRONLY | constants2.O_CREAT | constants2.O_EXCL | constants2.O_NOFOLLOW, 384);
54864
+ try {
54865
+ writeFileSync6(fd, bytes);
54866
+ fsyncSync(fd);
54867
+ } finally {
54868
+ closeSync3(fd);
54869
+ }
54870
+ }
54871
+ function save(directory, value) {
54872
+ const identity = safeDirectory(directory), temporary = `.receipt-${randomUUID6()}.json`;
54873
+ writeOwned(directory, temporary, JSON.stringify(value) + `
54874
+ `);
54875
+ unchangedDirectory(directory, identity);
54876
+ renameSync3(join21(directory, temporary), join21(directory, "receipt.json"));
54877
+ const fd = openSync3(directory, constants2.O_RDONLY | constants2.O_NOFOLLOW);
54878
+ try {
54879
+ fsyncSync(fd);
54880
+ } finally {
54881
+ closeSync3(fd);
54882
+ }
54883
+ }
54884
+ function bind(client, receipt) {
54885
+ if (["apiOrigin", "organizationId", "userId", "membershipId"].some((k4) => client[k4] !== receipt[k4]))
54886
+ throw new PrivatePublicationError("PUBLICATION_IDENTITY_CHANGED", "The fresh session does not match the recovery directory's server, account and membership.");
54887
+ }
54888
+ async function locked(directory, action) {
54889
+ const identity = safeDirectory(directory), file = join21(directory, "operation.lock");
54890
+ let fd;
54891
+ try {
54892
+ fd = openSync3(file, constants2.O_WRONLY | constants2.O_CREAT | constants2.O_EXCL | constants2.O_NOFOLLOW, 384);
54893
+ } catch {
54894
+ throw new PrivatePublicationError("PUBLICATION_RECOVERY_BUSY", "Another operation holds this recovery directory. If it crashed, confirm that process has stopped before explicitly removing operation.lock and resuming.");
54895
+ }
54896
+ const lock = fstatSync3(fd);
54897
+ try {
54898
+ writeFileSync6(fd, JSON.stringify({ pid: process.pid }) + `
54899
+ `);
54900
+ fsyncSync(fd);
54901
+ return await action();
54902
+ } finally {
54903
+ closeSync3(fd);
54904
+ unchangedDirectory(directory, identity);
54905
+ const now2 = lstatSync5(file);
54906
+ if (now2.dev !== lock.dev || now2.ino !== lock.ino || !now2.isFile() || now2.isSymbolicLink())
54907
+ fail();
54908
+ unlinkSync(file);
54909
+ }
54910
+ }
54911
+ function readPrivatePublicationRecovery(directory) {
54912
+ try {
54913
+ const value = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(readOwned(directory, "receipt.json", 65536)));
54914
+ if (!value || typeof value !== "object" || Array.isArray(value) || Object.keys(value).sort().join(",") !== ["contractVersion", "apiOrigin", "organizationId", "userId", "membershipId", "skillId", "declaration", "phase", "intent"].sort().join(",") || value.contractVersion !== 1 || ![value.organizationId, value.userId, value.membershipId, value.skillId].every(publicationUuid) || typeof value.apiOrigin !== "string" || normalizeSkillsApiOrigin(value.apiOrigin) !== value.apiOrigin || !["prepared", "begin_uncertain", "awaiting_upload", "upload_uncertain", "uploaded", "finalize_uncertain", "observed"].includes(value.phase))
54915
+ return fail();
54916
+ value.declaration = checkedPublicationDeclaration(value.declaration);
54917
+ if (value.intent !== null)
54918
+ value.intent = checkedPublicationView(value.intent, value.skillId, undefined, value.declaration);
54919
+ if (value.intent === null && !["prepared", "begin_uncertain"].includes(value.phase))
54920
+ return fail();
54921
+ const bytes = readOwned(directory, "bundle.tgz", PRIVATE_PUBLICATION_MAX_BYTES);
54922
+ if (bytes.length !== value.declaration.archiveByteSize || publicationSha256(bytes) !== value.declaration.archiveSha256)
54923
+ return fail();
54924
+ return { receipt: value, bytes };
54925
+ } catch {
54926
+ return fail();
54927
+ }
54928
+ }
54929
+ async function preparePrivatePublication(client, sourceDirectory, recoveryDirectory, input) {
54930
+ if (!publicationUuid(input.skillId) || !(input.expectedCurrentVersionId === null || publicationUuid(input.expectedCurrentVersionId)) || input.idempotencyKey !== undefined && !publicationUuid(input.idempotencyKey))
54931
+ return fail();
54932
+ const packed = packSkillBundle(sourceDirectory, { maxUnpackedBytes: 32 * 1024 * 1024 });
54933
+ const inspected = await inspectSkillBundle(packed.bytes, { limits: { compressedBytes: PRIVATE_PUBLICATION_MAX_BYTES } });
54934
+ const manifest = inspected.entries.find((entry) => entry.path === "skill.json");
54935
+ if (!manifest || manifest.bytes.length > 16384 || !(await verifyContentHashFromEntries(inspected.entries)).valid)
54936
+ throw new PrivatePublicationError("PUBLICATION_BUNDLE_INVALID", "The skill must have a valid skill.json with its current content hash. Validate the skill before publishing.");
54937
+ const manifestText = new TextDecoder("utf-8", { fatal: true }).decode(manifest.bytes);
54938
+ const declaration = checkedPublicationDeclaration({
54939
+ idempotencyKey: input.idempotencyKey ?? randomUUID6(),
54940
+ version: JSON.parse(manifestText).version,
54941
+ expectedCurrentVersionId: input.expectedCurrentVersionId,
54942
+ manifestText,
54943
+ archiveSha256: inspected.sha256,
54944
+ archiveByteSize: packed.bytes.length
54945
+ });
54946
+ const receipt = {
54947
+ contractVersion: 1,
54948
+ apiOrigin: client.apiOrigin,
54949
+ organizationId: client.organizationId,
54950
+ userId: client.userId,
54951
+ membershipId: client.membershipId,
54952
+ skillId: input.skillId,
54953
+ declaration,
54954
+ phase: "prepared",
54955
+ intent: null
54956
+ };
54957
+ if (!isAbsolute5(recoveryDirectory) || resolve4(recoveryDirectory) !== recoveryDirectory || realpathSync2(dirname10(recoveryDirectory)) !== dirname10(recoveryDirectory))
54958
+ return fail();
54959
+ mkdirSync8(recoveryDirectory, { mode: 448 });
54960
+ safeDirectory(recoveryDirectory);
54961
+ const parent = openSync3(dirname10(recoveryDirectory), constants2.O_RDONLY | constants2.O_NOFOLLOW);
54962
+ try {
54963
+ fsyncSync(parent);
54964
+ } finally {
54965
+ closeSync3(parent);
54966
+ }
54967
+ writeOwned(recoveryDirectory, "bundle.tgz", packed.bytes);
54968
+ save(recoveryDirectory, receipt);
54969
+ return receipt;
54970
+ }
54971
+ function privatePublicationResult(directory, receipt) {
54972
+ const state = receipt.intent?.state ?? receipt.phase, committed = state === "committed";
54973
+ const nextAction = committed ? "The version is published. Private execution remains unavailable." : ["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.";
54974
+ return {
54975
+ recoveryDirectory: directory,
54976
+ skillId: receipt.skillId,
54977
+ intentId: receipt.intent?.id ?? null,
54978
+ state,
54979
+ versionId: receipt.intent?.versionId ?? null,
54980
+ committed,
54981
+ executionEnabled: false,
54982
+ nextAction
54983
+ };
54984
+ }
54985
+ async function continuePrivatePublication(client, directory, options) {
54986
+ if (options.confirm !== true)
54987
+ throw new PrivatePublicationError("PUBLICATION_CONFIRM_REQUIRED", "Explicit upload confirmation is required.");
54988
+ if (options.waitMs !== undefined && (!Number.isSafeInteger(options.waitMs) || options.waitMs < 0 || options.waitMs > 300000))
54989
+ return fail();
54990
+ return locked(directory, () => continueLocked(client, directory, options));
54991
+ }
54992
+ async function continueLocked(client, directory, options) {
54993
+ const { receipt, bytes } = readPrivatePublicationRecovery(directory);
54994
+ bind(client, receipt);
54995
+ if (!receipt.intent) {
54996
+ receipt.phase = "begin_uncertain";
54997
+ save(directory, receipt);
54998
+ receipt.intent = await client.begin(receipt.skillId, receipt.declaration);
54999
+ receipt.phase = "awaiting_upload";
55000
+ save(directory, receipt);
55001
+ } else {
55002
+ receipt.intent = checkedPublicationView(await client.get(receipt.skillId, receipt.intent.id), receipt.skillId, receipt.intent.id, receipt.declaration);
55003
+ save(directory, receipt);
55004
+ }
55005
+ if (receipt.intent.state === "awaiting_upload") {
55006
+ if (receipt.phase === "awaiting_upload") {
55007
+ receipt.phase = "upload_uncertain";
55008
+ save(directory, receipt);
55009
+ try {
55010
+ await client.upload(receipt.skillId, receipt.intent, bytes);
55011
+ } catch (error) {
55012
+ if (error instanceof PrivatePublicationError && !error.uncertain) {
55013
+ receipt.phase = "awaiting_upload";
55014
+ save(directory, receipt);
55015
+ }
55016
+ throw error;
55017
+ }
55018
+ receipt.phase = "uploaded";
55019
+ save(directory, receipt);
55020
+ }
55021
+ receipt.phase = "finalize_uncertain";
55022
+ save(directory, receipt);
55023
+ receipt.intent = checkedPublicationView(await client.finalize(receipt.skillId, receipt.intent.id), receipt.skillId, receipt.intent.id, receipt.declaration);
55024
+ receipt.phase = "observed";
55025
+ save(directory, receipt);
55026
+ }
55027
+ if (options.waitMs !== undefined && options.waitMs > 0 && ["queued", "verifying"].includes(receipt.intent.state)) {
55028
+ receipt.intent = checkedPublicationView(await client.wait(receipt.skillId, receipt.intent.id, { timeoutMs: options.waitMs }), receipt.skillId, receipt.intent.id, receipt.declaration);
55029
+ receipt.phase = "observed";
55030
+ save(directory, receipt);
55031
+ }
55032
+ return privatePublicationResult(directory, receipt);
55033
+ }
55034
+ async function inspectPrivatePublication(client, directory, cancel = false) {
55035
+ return locked(directory, () => inspectLocked(client, directory, cancel));
55036
+ }
55037
+ async function inspectLocked(client, directory, cancel) {
55038
+ const { receipt } = readPrivatePublicationRecovery(directory);
55039
+ bind(client, receipt);
55040
+ if (receipt.intent) {
55041
+ receipt.intent = checkedPublicationView(await (cancel ? client.cancel(receipt.skillId, receipt.intent.id) : client.get(receipt.skillId, receipt.intent.id)), receipt.skillId, receipt.intent.id, receipt.declaration);
55042
+ save(directory, receipt);
55043
+ } else if (cancel)
55044
+ throw new PrivatePublicationError("PUBLICATION_INTENT_UNKNOWN", "Reconcile the saved begin request with publication resume before cancelling its intent.");
55045
+ return privatePublicationResult(directory, receipt);
55046
+ }
54380
55047
  export {
54381
- ArtifactStorage,
54382
- CLIENT_TOKEN_BYTES,
54383
- CONTENT_HASH_LIMITS,
54384
- ContentHashInputError,
54385
- DEFAULT_IMAGE_PROFILES,
54386
- DEFAULT_OUTPUT_GOVERNANCE,
54387
- DEFAULT_RUN_LIMITS,
54388
- DEFAULT_RUN_POLICY,
54389
- DEFAULT_RUN_QUOTA,
54390
- DEFAULT_SPEND_CEILINGS,
54391
- DispatcherNotImplementedError,
54392
- E2B_LANE_STATUS,
54393
- E2bDispatcher,
54394
- EXECUTION_PROTOCOL_VERSION,
54395
- EcsDispatcher,
54396
- GOVERNANCE_ERROR_CODES,
54397
- GovernanceError,
54398
- HostedApiError,
54399
- ImageProfileResolutionError,
54400
- InvitationEmailInputError,
54401
- LEGAL_TRANSITIONS,
54402
- MemoryGovernanceStore,
54403
- MemoryRunExecutionStore,
54404
- MemorySkillsStore,
54405
- MissingSkillsFleetError,
54406
- PostgresGovernanceStore,
54407
- PostgresSkillsStore,
54408
- REMOTE_SKILL_RUN_CONTRACT_VERSION,
54409
- RUN_LIFECYCLE_EVENT_FIELDS,
54410
- RUN_LIFECYCLE_EVENT_TYPES,
54411
- RUN_PROTOCOL_STATES,
54412
- RUN_PROTOCOL_VERSION,
54413
- RemoteCapabilityUnavailableError,
54414
- RemoteCreditApprovalError,
54415
- RemoteInvitationEmailError,
54416
- RemoteInvitationEmailUnconfirmedError,
54417
- RemoteQuoteUnavailableError,
54418
- RemoteRequestError,
54419
- RemoteRouteUnsupportedError,
54420
- RemoteSkillsAuthClient,
54421
- RemoteSkillsClient,
54422
- RemoteWorkspaceInvitationError,
54423
- RemoteWorkspaceInvitationReadError,
54424
- RemoteWorkspaceInvitationUnconfirmedError,
54425
- RemoteWorkspaceLeaveError,
54426
- RemoteWorkspaceLeaveUnconfirmedError,
54427
- RemoteWorkspaceMemberError,
54428
- RemoteWorkspaceSelectionError,
54429
- SKILLS_API_KEY_ENV,
54430
- SKILLS_API_URL_ENV,
54431
- SKILLS_APP,
54432
- SKILLS_LOCAL_OPT_IN_ENV_KEYS,
54433
- SKILL_BUNDLE_INSPECTION_LIMITS,
54434
- SkillBundleInspectionError,
54435
- SkillsFleetCredentialError,
54436
- SqliteGovernanceStore,
54437
- SqliteRunExecutionStore,
54438
- SqliteSkillsStore,
54439
- WorkspaceContextInputError,
54440
- WorkspaceIdentityMismatchError,
54441
- WorkspaceInvitationInputError,
54442
- WorkspaceLeaveInputError,
54443
- artifactStorageSeam,
54444
- assertDurableStore,
54445
- assertDurableTarget,
54446
- attemptIdOf,
54447
- buildRunLifecycleEvent,
54448
- bundledRegistry,
54449
- canonicalJson,
54450
- canonicalSystemDepsKey,
54451
- clientTokenFor,
54452
- computeContentHashFromEntries,
54453
- configuredSkillsApiUrl,
54454
- createAwsEcsClient,
54455
- createCancelService,
54456
- createGovernanceStore,
54457
- createGovernedArtifactWriter,
54458
- createImageProfileRegistry,
54459
- createOfflineGate,
54460
- createReceiptService,
54461
- createRemoteSkillsClient,
54462
- createRunEventEmitter,
54463
- createRunService,
54464
- createRunStateMachine,
54465
- createServer,
54466
- createSkillsFetchHandler,
54467
- createSpendService,
54468
- createStore,
54469
- createSubmitRunService,
54470
- currentVersionService,
54471
- dependencyLayerRule,
54472
- digestInput,
54473
- executeRun,
54474
- expireArtifacts,
54475
- expiresAtFor,
54476
- getServerSkill,
54477
- getServerSkillMd,
54478
- inspectSkillBundle,
54479
- isActiveStatus,
54480
- isSkillsLocalOptIn,
54481
- isTerminalStatus,
54482
- isValidSkillSlug,
54483
- leaseGenerationOf,
54484
- listServerSkills,
54485
- localRunExecutor,
54486
- newRunId,
54487
- normalizeRemoteSkillRunContract,
54488
- normalizeSkillsApiOrigin,
54489
- noticeLocalSkillsMode,
54490
- packSkillBundle,
54491
- protocolStateOf,
54492
- receiptId,
54493
- redactRunOutput,
54494
- registerRoutes,
54495
- requestDigestFor,
54496
- requireSkillsApiOrigin,
54497
- requireSkillsFleet,
54498
- reservationId,
54499
- resolveDatabaseTarget,
54500
- resolveImageProfile,
54501
- resolveServerConfig,
54502
- resolveSkillsApiOrigin,
54503
- resolveSkillsFleet,
54504
- revisionIdOf,
54505
- runAdmissionSchema,
54506
- runLeaseSchema,
54507
- runPointersOf,
54508
- runProtocolSchema,
54509
- runTerminalSchema,
54510
- selectsSkillsLocalMode,
54511
- settleRun,
54512
- skillsCredentialFilePath,
54513
- skillsCredentialFiles,
54514
- skillsCredentialOrReason,
54515
- skillsServeLimits,
54516
- startSkillsServer,
54517
- startedByFor,
55048
+ verifyContentHashFromEntries,
54518
55049
  validateRunLifecycleEvent,
54519
- verifyContentHashFromEntries
55050
+ startedByFor,
55051
+ startSkillsServer,
55052
+ skillsServeLimits,
55053
+ skillsCredentialOrReason,
55054
+ skillsCredentialFiles,
55055
+ skillsCredentialFilePath,
55056
+ settleRun,
55057
+ selectsSkillsLocalMode,
55058
+ runTerminalSchema,
55059
+ runProtocolSchema,
55060
+ runPointersOf,
55061
+ runLeaseSchema,
55062
+ runAdmissionSchema,
55063
+ revisionIdOf,
55064
+ resolveSkillsFleet,
55065
+ resolveSkillsApiOrigin,
55066
+ resolveServerConfig,
55067
+ resolveImageProfile,
55068
+ resolveDatabaseTarget,
55069
+ reservationId,
55070
+ requireSkillsFleet,
55071
+ requireSkillsApiOrigin,
55072
+ requestDigestFor,
55073
+ registerRoutes,
55074
+ redactRunOutput,
55075
+ receiptId,
55076
+ readPrivatePublicationRecovery,
55077
+ protocolStateOf,
55078
+ preparePrivatePublication,
55079
+ packSkillBundle,
55080
+ noticeLocalSkillsMode,
55081
+ normalizeSkillsApiOrigin,
55082
+ normalizeRemoteSkillRunContract,
55083
+ newRunId,
55084
+ localRunExecutor,
55085
+ listServerSkills,
55086
+ leaseGenerationOf,
55087
+ isValidSkillSlug,
55088
+ isTerminalStatus,
55089
+ isSkillsLocalOptIn,
55090
+ isActiveStatus,
55091
+ inspectSkillBundle,
55092
+ inspectPrivatePublication,
55093
+ getServerSkillMd,
55094
+ getServerSkill,
55095
+ expiresAtFor,
55096
+ expireArtifacts,
55097
+ executeRun,
55098
+ digestInput,
55099
+ dependencyLayerRule,
55100
+ currentVersionService,
55101
+ createSubmitRunService,
55102
+ createStore,
55103
+ createSpendService,
55104
+ createSkillsFetchHandler,
55105
+ createServer,
55106
+ createRunStateMachine,
55107
+ createRunService,
55108
+ createRunEventEmitter,
55109
+ createRemoteSkillsClient,
55110
+ createReceiptService,
55111
+ createOfflineGate,
55112
+ createImageProfileRegistry,
55113
+ createGovernedArtifactWriter,
55114
+ createGovernanceStore,
55115
+ createCancelService,
55116
+ createAwsEcsClient,
55117
+ continuePrivatePublication,
55118
+ configuredSkillsApiUrl,
55119
+ computeContentHashFromEntries,
55120
+ clientTokenFor,
55121
+ canonicalSystemDepsKey,
55122
+ canonicalJson,
55123
+ bundledRegistry,
55124
+ buildRunLifecycleEvent,
55125
+ attemptIdOf,
55126
+ assertDurableTarget,
55127
+ assertDurableStore,
55128
+ artifactStorageSeam,
55129
+ WorkspaceLeaveInputError,
55130
+ WorkspaceInvitationInputError,
55131
+ WorkspaceIdentityMismatchError,
55132
+ WorkspaceContextInputError,
55133
+ SqliteSkillsStore,
55134
+ SqliteRunExecutionStore,
55135
+ SqliteGovernanceStore,
55136
+ SkillsFleetCredentialError,
55137
+ SkillBundleInspectionError,
55138
+ SKILL_BUNDLE_INSPECTION_LIMITS,
55139
+ SKILLS_LOCAL_OPT_IN_ENV_KEYS,
55140
+ SKILLS_APP,
55141
+ SKILLS_API_URL_ENV,
55142
+ SKILLS_API_KEY_ENV,
55143
+ RemoteWorkspaceSelectionError,
55144
+ RemoteWorkspaceMemberError,
55145
+ RemoteWorkspaceLeaveUnconfirmedError,
55146
+ RemoteWorkspaceLeaveError,
55147
+ RemoteWorkspaceInvitationUnconfirmedError,
55148
+ RemoteWorkspaceInvitationReadError,
55149
+ RemoteWorkspaceInvitationError,
55150
+ RemoteSkillsClient,
55151
+ RemoteSkillsAuthClient,
55152
+ RemoteRouteUnsupportedError,
55153
+ RemoteRequestError,
55154
+ RemoteQuoteUnavailableError,
55155
+ RemotePrivatePublicationsClient,
55156
+ RemoteInvitationEmailUnconfirmedError,
55157
+ RemoteInvitationEmailError,
55158
+ RemoteCreditApprovalError,
55159
+ RemoteCapabilityUnavailableError,
55160
+ RUN_PROTOCOL_VERSION,
55161
+ RUN_PROTOCOL_STATES,
55162
+ RUN_LIFECYCLE_EVENT_TYPES,
55163
+ RUN_LIFECYCLE_EVENT_FIELDS,
55164
+ REMOTE_SKILL_RUN_CONTRACT_VERSION,
55165
+ PrivatePublicationError,
55166
+ PostgresSkillsStore,
55167
+ PostgresGovernanceStore,
55168
+ PRIVATE_PUBLICATION_MAX_BYTES,
55169
+ MissingSkillsFleetError,
55170
+ MemorySkillsStore,
55171
+ MemoryRunExecutionStore,
55172
+ MemoryGovernanceStore,
55173
+ LEGAL_TRANSITIONS,
55174
+ InvitationEmailInputError,
55175
+ ImageProfileResolutionError,
55176
+ HostedApiError,
55177
+ GovernanceError,
55178
+ GOVERNANCE_ERROR_CODES,
55179
+ EcsDispatcher,
55180
+ EXECUTION_PROTOCOL_VERSION,
55181
+ E2bDispatcher,
55182
+ E2B_LANE_STATUS,
55183
+ DispatcherNotImplementedError,
55184
+ DEFAULT_SPEND_CEILINGS,
55185
+ DEFAULT_RUN_QUOTA,
55186
+ DEFAULT_RUN_POLICY,
55187
+ DEFAULT_RUN_LIMITS,
55188
+ DEFAULT_OUTPUT_GOVERNANCE,
55189
+ DEFAULT_IMAGE_PROFILES,
55190
+ ContentHashInputError,
55191
+ CONTENT_HASH_LIMITS,
55192
+ CLIENT_TOKEN_BYTES,
55193
+ ArtifactStorage
54520
55194
  };