@integrity-labs/agt-cli 0.28.1164 → 0.28.1166
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/bin/agt.js +6 -6
- package/dist/{chunk-WPNCOXIB.js → chunk-6KJFIVYJ.js} +2 -2
- package/dist/{chunk-DR7PAO2Y.js → chunk-I5NQ762W.js} +187 -1
- package/dist/chunk-I5NQ762W.js.map +1 -0
- package/dist/{chunk-CHTG2VLG.js → chunk-NOCTCO7G.js} +3 -3
- package/dist/{chunk-6SIOI32E.js → chunk-UX3TDTVM.js} +5 -5
- package/dist/{chunk-J3LCXQGY.js → chunk-ZSCZDOHR.js} +2 -2
- package/dist/{claude-code-updater-L7C3DZJ3.js → claude-code-updater-VRZ7MMKO.js} +3 -3
- package/dist/{claude-pair-runtime-EQVMQMTF.js → claude-pair-runtime-HOIYDAGM.js} +3 -3
- package/dist/lib/manager-worker.js +19 -19
- package/dist/mcp/direct-chat-channel.js +188 -2
- package/dist/mcp/index.js +190 -4
- package/dist/mcp/origami.js +188 -2
- package/dist/mcp/slack-channel.js +188 -2
- package/dist/mcp/telegram-channel.js +188 -2
- package/dist/{persistent-session-BP3EXMFT.js → persistent-session-YQLP5NPI.js} +4 -4
- package/dist/{responsiveness-probe-ASP2NY2K.js → responsiveness-probe-6K6SVHRK.js} +4 -4
- package/dist/{session-auth-dead-KR2CABKC.js → session-auth-dead-M4KYOBXK.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-DR7PAO2Y.js.map +0 -1
- /package/dist/{chunk-WPNCOXIB.js.map → chunk-6KJFIVYJ.js.map} +0 -0
- /package/dist/{chunk-CHTG2VLG.js.map → chunk-NOCTCO7G.js.map} +0 -0
- /package/dist/{chunk-6SIOI32E.js.map → chunk-UX3TDTVM.js.map} +0 -0
- /package/dist/{chunk-J3LCXQGY.js.map → chunk-ZSCZDOHR.js.map} +0 -0
- /package/dist/{claude-code-updater-L7C3DZJ3.js.map → claude-code-updater-VRZ7MMKO.js.map} +0 -0
- /package/dist/{claude-pair-runtime-EQVMQMTF.js.map → claude-pair-runtime-HOIYDAGM.js.map} +0 -0
- /package/dist/{persistent-session-BP3EXMFT.js.map → persistent-session-YQLP5NPI.js.map} +0 -0
- /package/dist/{responsiveness-probe-ASP2NY2K.js.map → responsiveness-probe-6K6SVHRK.js.map} +0 -0
- /package/dist/{session-auth-dead-KR2CABKC.js.map → session-auth-dead-M4KYOBXK.js.map} +0 -0
package/dist/bin/agt.js
CHANGED
|
@@ -40,17 +40,17 @@ import {
|
|
|
40
40
|
success,
|
|
41
41
|
table,
|
|
42
42
|
warn
|
|
43
|
-
} from "../chunk-
|
|
43
|
+
} from "../chunk-UX3TDTVM.js";
|
|
44
44
|
import {
|
|
45
45
|
getProjectDir,
|
|
46
46
|
isSessionResumeDisabled,
|
|
47
47
|
readDirectChatSessionState
|
|
48
|
-
} from "../chunk-
|
|
48
|
+
} from "../chunk-NOCTCO7G.js";
|
|
49
49
|
import {
|
|
50
50
|
markDailySessionSpawn,
|
|
51
51
|
sessionFileExists,
|
|
52
52
|
sessionTranscriptDir
|
|
53
|
-
} from "../chunk-
|
|
53
|
+
} from "../chunk-ZSCZDOHR.js";
|
|
54
54
|
import "../chunk-B6UYVEMD.js";
|
|
55
55
|
import "../chunk-OAWK4OBN.js";
|
|
56
56
|
import "../chunk-XWVM4KPK.js";
|
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
requiredMcpWildcard,
|
|
85
85
|
resolveChannels,
|
|
86
86
|
serializeManifestForSlackCli
|
|
87
|
-
} from "../chunk-
|
|
87
|
+
} from "../chunk-I5NQ762W.js";
|
|
88
88
|
import "../chunk-EL5MWGGH.js";
|
|
89
89
|
import "../chunk-DGUM43GV.js";
|
|
90
90
|
|
|
@@ -5513,7 +5513,7 @@ import { execFileSync, execSync } from "child_process";
|
|
|
5513
5513
|
import { existsSync as existsSync11, realpathSync as realpathSync2 } from "fs";
|
|
5514
5514
|
import chalk18 from "chalk";
|
|
5515
5515
|
import ora16 from "ora";
|
|
5516
|
-
var cliVersion = true ? "0.28.
|
|
5516
|
+
var cliVersion = true ? "0.28.1166" : "dev";
|
|
5517
5517
|
async function fetchLatestVersion() {
|
|
5518
5518
|
const host2 = getHost();
|
|
5519
5519
|
if (!host2) return null;
|
|
@@ -6773,7 +6773,7 @@ function handleError(err) {
|
|
|
6773
6773
|
}
|
|
6774
6774
|
|
|
6775
6775
|
// src/bin/agt.ts
|
|
6776
|
-
var cliVersion2 = true ? "0.28.
|
|
6776
|
+
var cliVersion2 = true ? "0.28.1166" : "dev";
|
|
6777
6777
|
var program = new Command();
|
|
6778
6778
|
program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
|
|
6779
6779
|
program.hook("preAction", async (thisCommand, actionCommand) => {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-XWVM4KPK.js";
|
|
5
5
|
import {
|
|
6
6
|
FORCED_UPDATE_HARD_DEADLINE_MS
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-I5NQ762W.js";
|
|
8
8
|
import {
|
|
9
9
|
effectiveClaudeJsonPath
|
|
10
10
|
} from "./chunk-EL5MWGGH.js";
|
|
@@ -714,4 +714,4 @@ export {
|
|
|
714
714
|
probeClaudeInstalls,
|
|
715
715
|
maybeUpdateClaudeCode
|
|
716
716
|
};
|
|
717
|
-
//# sourceMappingURL=chunk-
|
|
717
|
+
//# sourceMappingURL=chunk-6KJFIVYJ.js.map
|
|
@@ -2477,6 +2477,15 @@ var INTEGRATION_REGISTRY = [
|
|
|
2477
2477
|
// successor at the same cost to us); Sunburst is seeded at 4x.
|
|
2478
2478
|
{ event_type: "gpt_image_2_5_flare", unit: "image" },
|
|
2479
2479
|
{ event_type: "gpt_image_2_5_sunburst", unit: "image" },
|
|
2480
|
+
// CS-2360: quality medium/high price on their own rows (more image-output
|
|
2481
|
+
// tokens at the same per-token rate). `low` stays on the two meters above.
|
|
2482
|
+
// The handler refuses a medium/high render until its meter has a rate
|
|
2483
|
+
// card row in BOTH USD and AUD. Size does not change the meter: the rate
|
|
2484
|
+
// is set on the worst case (landscape/portrait).
|
|
2485
|
+
{ event_type: "gpt_image_2_5_flare_medium", unit: "image", label: "Flare, medium quality" },
|
|
2486
|
+
{ event_type: "gpt_image_2_5_flare_high", unit: "image", label: "Flare, high quality" },
|
|
2487
|
+
{ event_type: "gpt_image_2_5_sunburst_medium", unit: "image", label: "Sunburst, medium quality" },
|
|
2488
|
+
{ event_type: "gpt_image_2_5_sunburst_high", unit: "image", label: "Sunburst, high quality" },
|
|
2480
2489
|
// CS-1940: an edit also records one of these with units = the number of
|
|
2481
2490
|
// reference images. Declared here (obi-wan 3a515eaf41b0) because the admin
|
|
2482
2491
|
// pricing route only accepts a price for a declared meter, and the org
|
|
@@ -16735,6 +16744,183 @@ var videoRenderTriggerAdapter = {
|
|
|
16735
16744
|
};
|
|
16736
16745
|
registerTriggerSource(videoRenderTriggerAdapter);
|
|
16737
16746
|
|
|
16747
|
+
// ../../packages/core/dist/triggers/adapters/webhook.js
|
|
16748
|
+
var WEBHOOK_TRIGGER_PROVIDER = "webhook";
|
|
16749
|
+
var WEBHOOK_MAX_BODY_BYTES = 1280 * 1024;
|
|
16750
|
+
var WEBHOOK_PROMPT_MAX_CHARS = 8e3;
|
|
16751
|
+
var WEBHOOK_RAW_MAX_CHARS = 64 * 1024;
|
|
16752
|
+
var WEBHOOK_INSTRUCTION_MAX_CHARS = 2e3;
|
|
16753
|
+
var WEBHOOK_NAME_MAX_CHARS = 80;
|
|
16754
|
+
var WEBHOOK_DEFAULT_RATE_CAP = 60;
|
|
16755
|
+
var WEBHOOK_MAX_RATE_CAP = 1e3;
|
|
16756
|
+
var WEBHOOK_PRESETS = {
|
|
16757
|
+
// https://docs.aws.amazon.com/eventbridge/latest/ref/overiew-event-structure.html
|
|
16758
|
+
eventbridge: {
|
|
16759
|
+
dedupPath: "id",
|
|
16760
|
+
eventTypePaths: ["source", "detail-type"],
|
|
16761
|
+
payloadPath: "detail",
|
|
16762
|
+
timePath: "time"
|
|
16763
|
+
},
|
|
16764
|
+
// Raw-body hash dedup, whole body as payload. Set dedup_path when the
|
|
16765
|
+
// sender has a stable id, or two identical bodies collapse into one.
|
|
16766
|
+
generic: {}
|
|
16767
|
+
};
|
|
16768
|
+
var PATH_RE = /^[A-Za-z0-9_$-]+(\.[A-Za-z0-9_$-]+){0,9}$/;
|
|
16769
|
+
function readPath(value, path) {
|
|
16770
|
+
let cur = value;
|
|
16771
|
+
for (const key of path.split(".")) {
|
|
16772
|
+
if (cur === null || typeof cur !== "object" || Array.isArray(cur))
|
|
16773
|
+
return void 0;
|
|
16774
|
+
if (!Object.prototype.hasOwnProperty.call(cur, key))
|
|
16775
|
+
return void 0;
|
|
16776
|
+
cur = cur[key];
|
|
16777
|
+
}
|
|
16778
|
+
return cur;
|
|
16779
|
+
}
|
|
16780
|
+
function scalarString(v) {
|
|
16781
|
+
if (typeof v === "string")
|
|
16782
|
+
return v.length > 0 ? v : null;
|
|
16783
|
+
if (typeof v === "number" && Number.isFinite(v))
|
|
16784
|
+
return String(v);
|
|
16785
|
+
return null;
|
|
16786
|
+
}
|
|
16787
|
+
function truncate(text, max) {
|
|
16788
|
+
if (text.length <= max)
|
|
16789
|
+
return text;
|
|
16790
|
+
return `${text.slice(0, max)}
|
|
16791
|
+
... [truncated ${text.length - max} more characters]`;
|
|
16792
|
+
}
|
|
16793
|
+
function resolvePreset(config) {
|
|
16794
|
+
const name = config["preset"];
|
|
16795
|
+
const base = typeof name === "string" && Object.prototype.hasOwnProperty.call(WEBHOOK_PRESETS, name) ? WEBHOOK_PRESETS[name] : WEBHOOK_PRESETS.generic;
|
|
16796
|
+
const dedup = config["dedup_path"];
|
|
16797
|
+
const type = config["event_type_path"];
|
|
16798
|
+
const payload = config["payload_path"];
|
|
16799
|
+
return {
|
|
16800
|
+
...base,
|
|
16801
|
+
...typeof dedup === "string" && dedup ? { dedupPath: dedup } : {},
|
|
16802
|
+
...typeof type === "string" && type ? { eventTypePaths: [type] } : {},
|
|
16803
|
+
...typeof payload === "string" && payload ? { payloadPath: payload } : {}
|
|
16804
|
+
};
|
|
16805
|
+
}
|
|
16806
|
+
function validateWebhookConfig(input) {
|
|
16807
|
+
const out = {};
|
|
16808
|
+
const name = input["name"];
|
|
16809
|
+
if (name !== void 0) {
|
|
16810
|
+
if (typeof name !== "string")
|
|
16811
|
+
return { ok: false, error: "name must be a string" };
|
|
16812
|
+
const trimmed = name.trim();
|
|
16813
|
+
if (trimmed.length > WEBHOOK_NAME_MAX_CHARS) {
|
|
16814
|
+
return { ok: false, error: `name must be at most ${WEBHOOK_NAME_MAX_CHARS} characters` };
|
|
16815
|
+
}
|
|
16816
|
+
if (trimmed)
|
|
16817
|
+
out["name"] = trimmed;
|
|
16818
|
+
}
|
|
16819
|
+
const instruction = input["instruction"];
|
|
16820
|
+
if (typeof instruction !== "string" || !instruction.trim()) {
|
|
16821
|
+
return {
|
|
16822
|
+
ok: false,
|
|
16823
|
+
error: "instruction is required: tell the agent what to do when an event arrives"
|
|
16824
|
+
};
|
|
16825
|
+
}
|
|
16826
|
+
if (instruction.trim().length > WEBHOOK_INSTRUCTION_MAX_CHARS) {
|
|
16827
|
+
return {
|
|
16828
|
+
ok: false,
|
|
16829
|
+
error: `instruction must be at most ${WEBHOOK_INSTRUCTION_MAX_CHARS} characters`
|
|
16830
|
+
};
|
|
16831
|
+
}
|
|
16832
|
+
out["instruction"] = instruction.trim();
|
|
16833
|
+
const preset = input["preset"] ?? "generic";
|
|
16834
|
+
if (typeof preset !== "string" || !Object.prototype.hasOwnProperty.call(WEBHOOK_PRESETS, preset)) {
|
|
16835
|
+
return {
|
|
16836
|
+
ok: false,
|
|
16837
|
+
error: `preset must be one of: ${Object.keys(WEBHOOK_PRESETS).join(", ")}`
|
|
16838
|
+
};
|
|
16839
|
+
}
|
|
16840
|
+
out["preset"] = preset;
|
|
16841
|
+
for (const key of ["dedup_path", "event_type_path", "payload_path"]) {
|
|
16842
|
+
const v = input[key];
|
|
16843
|
+
if (v === void 0 || v === null || v === "")
|
|
16844
|
+
continue;
|
|
16845
|
+
if (typeof v !== "string" || !PATH_RE.test(v)) {
|
|
16846
|
+
return { ok: false, error: `${key} must be a dot path like "detail.id"` };
|
|
16847
|
+
}
|
|
16848
|
+
out[key] = v;
|
|
16849
|
+
}
|
|
16850
|
+
const cap = input["max_events_per_hour"];
|
|
16851
|
+
if (cap !== void 0 && cap !== null) {
|
|
16852
|
+
if (typeof cap !== "number" || !Number.isInteger(cap) || cap < 1 || cap > WEBHOOK_MAX_RATE_CAP) {
|
|
16853
|
+
return {
|
|
16854
|
+
ok: false,
|
|
16855
|
+
error: `max_events_per_hour must be an integer from 1 to ${WEBHOOK_MAX_RATE_CAP}`
|
|
16856
|
+
};
|
|
16857
|
+
}
|
|
16858
|
+
out["max_events_per_hour"] = cap;
|
|
16859
|
+
} else {
|
|
16860
|
+
out["max_events_per_hour"] = WEBHOOK_DEFAULT_RATE_CAP;
|
|
16861
|
+
}
|
|
16862
|
+
return { ok: true, config: out };
|
|
16863
|
+
}
|
|
16864
|
+
function webhookRateCap(trigger) {
|
|
16865
|
+
const cap = trigger.config["max_events_per_hour"];
|
|
16866
|
+
if (typeof cap === "number" && Number.isInteger(cap) && cap >= 1) {
|
|
16867
|
+
return Math.min(cap, WEBHOOK_MAX_RATE_CAP);
|
|
16868
|
+
}
|
|
16869
|
+
return WEBHOOK_DEFAULT_RATE_CAP;
|
|
16870
|
+
}
|
|
16871
|
+
function buildWebhookEvent(req, config, now = /* @__PURE__ */ new Date()) {
|
|
16872
|
+
const preset = resolvePreset(config);
|
|
16873
|
+
const body = req.body;
|
|
16874
|
+
const raw = req.rawBody ?? JSON.stringify(body ?? null);
|
|
16875
|
+
const idValue = preset.dedupPath ? scalarString(readPath(body, preset.dedupPath)) : null;
|
|
16876
|
+
const dedupKey = idValue ? `wh:id:${stableHash(idValue)}` : `wh:raw:${stableHash(raw)}`;
|
|
16877
|
+
const typeParts = (preset.eventTypePaths ?? []).map((p2) => scalarString(readPath(body, p2))).filter((v) => v !== null).map((v) => v.slice(0, 200));
|
|
16878
|
+
const eventType = typeParts.length > 0 ? typeParts.join(" / ") : "webhook event";
|
|
16879
|
+
const timeValue = preset.timePath ? scalarString(readPath(body, preset.timePath)) : null;
|
|
16880
|
+
const timeMs = timeValue ? Date.parse(timeValue) : NaN;
|
|
16881
|
+
const occurredAt = Number.isFinite(timeMs) ? new Date(timeMs).toISOString() : now.toISOString();
|
|
16882
|
+
let payload = body;
|
|
16883
|
+
if (preset.payloadPath) {
|
|
16884
|
+
const sub = readPath(body, preset.payloadPath);
|
|
16885
|
+
if (sub !== void 0)
|
|
16886
|
+
payload = sub;
|
|
16887
|
+
}
|
|
16888
|
+
const rendered = typeof payload === "string" ? payload : JSON.stringify(payload, null, 2) ?? "null";
|
|
16889
|
+
const lines = [`Event: ${eventType}`];
|
|
16890
|
+
if (idValue)
|
|
16891
|
+
lines.push(`Event id: ${idValue.slice(0, 200)}`);
|
|
16892
|
+
lines.push("", truncate(rendered, WEBHOOK_PROMPT_MAX_CHARS));
|
|
16893
|
+
return {
|
|
16894
|
+
provider: WEBHOOK_TRIGGER_PROVIDER,
|
|
16895
|
+
occurredAt,
|
|
16896
|
+
dedupKey,
|
|
16897
|
+
sourceTrust: "untrusted",
|
|
16898
|
+
title: eventType,
|
|
16899
|
+
body: lines.join("\n"),
|
|
16900
|
+
// Keep the ledger row bounded: the full body when small, else a marker
|
|
16901
|
+
// with the head of it. Never headers (the bearer token rides there).
|
|
16902
|
+
raw: raw.length <= WEBHOOK_RAW_MAX_CHARS ? body : { truncated: true, bytes: raw.length, head: raw.slice(0, WEBHOOK_RAW_MAX_CHARS) },
|
|
16903
|
+
meaningful: true
|
|
16904
|
+
};
|
|
16905
|
+
}
|
|
16906
|
+
var webhookTriggerAdapter = {
|
|
16907
|
+
provider: WEBHOOK_TRIGGER_PROVIDER,
|
|
16908
|
+
kind: "webhook",
|
|
16909
|
+
webhookAuth: "bearer",
|
|
16910
|
+
webhookEvents: [],
|
|
16911
|
+
multiInstance: true,
|
|
16912
|
+
maxBodyBytes: WEBHOOK_MAX_BODY_BYTES,
|
|
16913
|
+
validateConfig: validateWebhookConfig,
|
|
16914
|
+
rateCapPerHour: (trigger) => webhookRateCap(trigger),
|
|
16915
|
+
// Webhook-kind triggers are minted only on POST /agents/:id/triggers
|
|
16916
|
+
// (agent.edit); /host/triggers refuses non-poll providers.
|
|
16917
|
+
operatorInstruction: true,
|
|
16918
|
+
ingest(req, trigger) {
|
|
16919
|
+
return [buildWebhookEvent(req, trigger.config)];
|
|
16920
|
+
}
|
|
16921
|
+
};
|
|
16922
|
+
registerTriggerSource(webhookTriggerAdapter);
|
|
16923
|
+
|
|
16738
16924
|
// ../../packages/core/dist/restart/breaker-thresholds.js
|
|
16739
16925
|
var RESTART_BREAKER_PROVISIONING_MAX = 5;
|
|
16740
16926
|
var RESTART_BREAKER_PROVISIONING_WINDOW_MS = 18e5;
|
|
@@ -16942,4 +17128,4 @@ export {
|
|
|
16942
17128
|
forcedUpdatePendingForMs,
|
|
16943
17129
|
isForcedUpdatePastDeadline
|
|
16944
17130
|
};
|
|
16945
|
-
//# sourceMappingURL=chunk-
|
|
17131
|
+
//# sourceMappingURL=chunk-I5NQ762W.js.map
|