@whittlelabs/trivet 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin.js +44 -4
- package/bin.js.map +4 -4
- package/package.json +1 -1
package/bin.js
CHANGED
|
@@ -59769,7 +59769,10 @@ var require_exchange = __commonJS({
|
|
|
59769
59769
|
transport: async (url, init2) => {
|
|
59770
59770
|
let response;
|
|
59771
59771
|
try {
|
|
59772
|
-
|
|
59772
|
+
const headers = new Headers(init2?.headers);
|
|
59773
|
+
if (request.apiVersion)
|
|
59774
|
+
headers.set("Whittle-Version", request.apiVersion);
|
|
59775
|
+
response = await fetch(url, { ...init2, headers });
|
|
59773
59776
|
} catch (err2) {
|
|
59774
59777
|
return raise(new KeepUnavailableError(`[${manager}] could not reach Keep at ${host}: ${describeTransportError(err2)}`, {
|
|
59775
59778
|
host,
|
|
@@ -60114,12 +60117,14 @@ var require_agent_token = __commonJS({
|
|
|
60114
60117
|
clientId;
|
|
60115
60118
|
clientSecret;
|
|
60116
60119
|
enabled;
|
|
60120
|
+
apiVersion;
|
|
60117
60121
|
onResponse;
|
|
60118
60122
|
constructor(config) {
|
|
60119
60123
|
this.keepApiUrl = config.keepApiUrl.replace(/\/$/, "");
|
|
60120
60124
|
this.clientId = config.clientId;
|
|
60121
60125
|
this.clientSecret = config.clientSecret;
|
|
60122
60126
|
this.enabled = !!(config.clientId && config.clientSecret && config.keepApiUrl);
|
|
60127
|
+
this.apiVersion = config.apiVersion;
|
|
60123
60128
|
this.onResponse = config.onResponse;
|
|
60124
60129
|
}
|
|
60125
60130
|
async getToken(forceRefresh = false) {
|
|
@@ -60145,6 +60150,7 @@ var require_agent_token = __commonJS({
|
|
|
60145
60150
|
keepApiUrl: this.keepApiUrl,
|
|
60146
60151
|
send: (api) => api.post("/api/agent-tokens", { body: { clientId: this.clientId, clientSecret: this.clientSecret } }),
|
|
60147
60152
|
rateLimit: this.rateLimit,
|
|
60153
|
+
apiVersion: this.apiVersion,
|
|
60148
60154
|
onResponse: this.onResponse,
|
|
60149
60155
|
exchangeName: "Agent token exchange",
|
|
60150
60156
|
refused: () => new AgentCredentialRevokedError2(`[AgentTokenManager] Keep refused this agent's credentials (401): the pairing was revoked or the secret rotated. Re-pair to continue.`)
|
|
@@ -69141,12 +69147,14 @@ var require_client3 = __commonJS({
|
|
|
69141
69147
|
apiKey;
|
|
69142
69148
|
accessToken;
|
|
69143
69149
|
getAccessToken;
|
|
69150
|
+
apiVersion;
|
|
69144
69151
|
onResponse;
|
|
69145
69152
|
constructor(config) {
|
|
69146
69153
|
this.baseUrl = config.baseUrl.replace(/\/$/, "");
|
|
69147
69154
|
this.apiKey = config.apiKey;
|
|
69148
69155
|
this.accessToken = config.accessToken;
|
|
69149
69156
|
this.getAccessToken = config.getAccessToken;
|
|
69157
|
+
this.apiVersion = config.apiVersion;
|
|
69150
69158
|
this.onResponse = config.onResponse;
|
|
69151
69159
|
}
|
|
69152
69160
|
/**
|
|
@@ -69157,6 +69165,8 @@ var require_client3 = __commonJS({
|
|
|
69157
69165
|
*/
|
|
69158
69166
|
async buildHeaders(forceRefresh = false) {
|
|
69159
69167
|
const headers = { "Content-Type": "application/json" };
|
|
69168
|
+
if (this.apiVersion)
|
|
69169
|
+
headers["Whittle-Version"] = this.apiVersion;
|
|
69160
69170
|
if (this.apiKey) {
|
|
69161
69171
|
headers["X-API-Key"] = this.apiKey;
|
|
69162
69172
|
} else if (this.getAccessToken) {
|
|
@@ -70613,6 +70623,7 @@ var require_probes = __commonJS({
|
|
|
70613
70623
|
keepApiUrl: pairing.keepApiUrl,
|
|
70614
70624
|
clientId: pairing.credentials.clientId,
|
|
70615
70625
|
clientSecret: pairing.credentials.clientSecret,
|
|
70626
|
+
apiVersion: options.brand.apiVersion,
|
|
70616
70627
|
onResponse: enforceFloor
|
|
70617
70628
|
});
|
|
70618
70629
|
managers.set(key, tokens);
|
|
@@ -70772,6 +70783,7 @@ var require_probes = __commonJS({
|
|
|
70772
70783
|
baseUrl: config.auth.jobsApiUrl,
|
|
70773
70784
|
...config.auth.apiKey ? { apiKey: config.auth.apiKey } : {},
|
|
70774
70785
|
getAccessToken: (opts) => tokens.getToken(opts?.forceRefresh),
|
|
70786
|
+
apiVersion: options.brand.apiVersion,
|
|
70775
70787
|
onResponse: enforceFloor
|
|
70776
70788
|
});
|
|
70777
70789
|
const poolIds = config.pools.map((pool) => pool.id).filter((id) => typeof id === "string");
|
|
@@ -71087,6 +71099,24 @@ var require_doctor = __commonJS({
|
|
|
71087
71099
|
}
|
|
71088
71100
|
});
|
|
71089
71101
|
|
|
71102
|
+
// ../../packages/shuttle/dist/api-version.js
|
|
71103
|
+
var require_api_version = __commonJS({
|
|
71104
|
+
"../../packages/shuttle/dist/api-version.js"(exports2) {
|
|
71105
|
+
"use strict";
|
|
71106
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
71107
|
+
exports2.VERSION_HEADER = void 0;
|
|
71108
|
+
exports2.withApiVersion = withApiVersion;
|
|
71109
|
+
exports2.VERSION_HEADER = "Whittle-Version";
|
|
71110
|
+
function withApiVersion(fetcher, version) {
|
|
71111
|
+
return (input, init2) => {
|
|
71112
|
+
const headers = new Headers(init2?.headers);
|
|
71113
|
+
headers.set(exports2.VERSION_HEADER, version);
|
|
71114
|
+
return fetcher(input, { ...init2, headers });
|
|
71115
|
+
};
|
|
71116
|
+
}
|
|
71117
|
+
}
|
|
71118
|
+
});
|
|
71119
|
+
|
|
71090
71120
|
// ../../node_modules/.pnpm/qrcode-generator@2.0.4/node_modules/qrcode-generator/dist/qrcode.js
|
|
71091
71121
|
var require_qrcode = __commonJS({
|
|
71092
71122
|
"../../node_modules/.pnpm/qrcode-generator@2.0.4/node_modules/qrcode-generator/dist/qrcode.js"(exports2, module2) {
|
|
@@ -72850,12 +72880,13 @@ var require_device_code = __commonJS({
|
|
|
72850
72880
|
var os_1 = require("os");
|
|
72851
72881
|
var jobs_1 = require_jobs();
|
|
72852
72882
|
var keep_1 = require_keep();
|
|
72883
|
+
var api_version_1 = require_api_version();
|
|
72853
72884
|
var apply_1 = require_apply();
|
|
72854
72885
|
var version_check_1 = require_version_check();
|
|
72855
72886
|
var typed_exit_1 = require_typed_exit();
|
|
72856
72887
|
var terminal_1 = require_terminal();
|
|
72857
72888
|
async function pair(opts) {
|
|
72858
|
-
const fetcher = opts.fetcher ?? globalThis.fetch;
|
|
72889
|
+
const fetcher = (0, api_version_1.withApiVersion)(opts.fetcher ?? globalThis.fetch, opts.brand.apiVersion);
|
|
72859
72890
|
const log = opts.log ?? ((line) => console.log(line));
|
|
72860
72891
|
const reg = opts.brand.keepRegistration;
|
|
72861
72892
|
const displayName = (0, apply_1.renderTemplate)(reg.serviceIdentityDisplayName, {
|
|
@@ -75011,6 +75042,8 @@ var require_defaults2 = __commonJS({
|
|
|
75011
75042
|
},
|
|
75012
75043
|
// Dev distribution allows every executor.
|
|
75013
75044
|
executorAllowlist: ["*"],
|
|
75045
|
+
// The baseline (ADR 0161): the dev distribution speaks the wire it was cut from.
|
|
75046
|
+
apiVersion: "2026-11-03",
|
|
75014
75047
|
keepRegistration: {
|
|
75015
75048
|
keepApiUrl: "http://localhost:3007",
|
|
75016
75049
|
jobsApiUrl: "http://localhost:3005",
|
|
@@ -75406,6 +75439,7 @@ var require_shuttle = __commonJS({
|
|
|
75406
75439
|
baseUrl: this.config.auth.jobsApiUrl,
|
|
75407
75440
|
apiKey: auth.kind === "apiKey" ? auth.apiKey : void 0,
|
|
75408
75441
|
getAccessToken: auth.kind === "tokenProvider" ? auth.getToken : void 0,
|
|
75442
|
+
apiVersion: this.brand.apiVersion,
|
|
75409
75443
|
onResponse: onBackendResponse
|
|
75410
75444
|
});
|
|
75411
75445
|
const registry = new registry_1.ExecutorRegistry(this.brand.executorAllowlist);
|
|
@@ -75769,6 +75803,7 @@ var require_shuttle = __commonJS({
|
|
|
75769
75803
|
keepApiUrl: pairing.keepApiUrl,
|
|
75770
75804
|
clientId: pairing.credentials.clientId,
|
|
75771
75805
|
clientSecret: pairing.credentials.clientSecret,
|
|
75806
|
+
apiVersion: brand.apiVersion,
|
|
75772
75807
|
onResponse
|
|
75773
75808
|
});
|
|
75774
75809
|
const token = await mintWaitingOutKeep(() => tokens.getToken(), brand, options);
|
|
@@ -76112,6 +76147,7 @@ var require_pairings = __commonJS({
|
|
|
76112
76147
|
exports2.revokePairing = revokePairing;
|
|
76113
76148
|
var keep_1 = require_keep();
|
|
76114
76149
|
var keep_2 = require_dist4();
|
|
76150
|
+
var api_version_1 = require_api_version();
|
|
76115
76151
|
var version_check_1 = require_version_check();
|
|
76116
76152
|
var PAGE_LIMIT = 100;
|
|
76117
76153
|
async function listPairings(opts) {
|
|
@@ -76133,7 +76169,7 @@ var require_pairings = __commonJS({
|
|
|
76133
76169
|
}));
|
|
76134
76170
|
}
|
|
76135
76171
|
async function ask(opts, send) {
|
|
76136
|
-
const fetcher = opts.fetcher ?? globalThis.fetch;
|
|
76172
|
+
const fetcher = (0, api_version_1.withApiVersion)(opts.fetcher ?? globalThis.fetch, opts.brand.apiVersion);
|
|
76137
76173
|
let belowFloor;
|
|
76138
76174
|
const transport = async (url, init2) => {
|
|
76139
76175
|
const response = await fetcher(url, init2);
|
|
@@ -76797,7 +76833,7 @@ var import_shuttle2 = __toESM(require_dist8());
|
|
|
76797
76833
|
|
|
76798
76834
|
// src/brand.ts
|
|
76799
76835
|
var import_shuttle = __toESM(require_dist8());
|
|
76800
|
-
var buildVersion = true ? "0.2.
|
|
76836
|
+
var buildVersion = true ? "0.2.1" : pkg.version;
|
|
76801
76837
|
var EXECUTORS = ["claude-code"];
|
|
76802
76838
|
var trivetBrand = {
|
|
76803
76839
|
product: {
|
|
@@ -76816,6 +76852,10 @@ var trivetBrand = {
|
|
|
76816
76852
|
configSearchPaths: ["~/.trivet/trivet.yaml"]
|
|
76817
76853
|
},
|
|
76818
76854
|
executorAllowlist: EXECUTORS,
|
|
76855
|
+
// The Whittle API version this code speaks (ADR 0156): a literal, never the
|
|
76856
|
+
// calendar's newest, so it moves only in the PR that adapts the runner to a
|
|
76857
|
+
// newer shape. The baseline (ADR 0161).
|
|
76858
|
+
apiVersion: "2026-11-03",
|
|
76819
76859
|
defaultExecutor: "claude-code",
|
|
76820
76860
|
executorBlock: (executor, options) => ({
|
|
76821
76861
|
type: executor,
|