@integrity-labs/agt-cli 0.28.1002 → 0.28.1004

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 CHANGED
@@ -40,12 +40,12 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-5PJH4MHG.js";
43
+ } from "../chunk-N4PG4TAD.js";
44
44
  import {
45
45
  getProjectDir,
46
46
  isSessionResumeDisabled,
47
47
  readDirectChatSessionState
48
- } from "../chunk-S6GIPDPI.js";
48
+ } from "../chunk-HHBAQ6ZV.js";
49
49
  import {
50
50
  AnchorSessionClient,
51
51
  CHANNEL_REGISTRY,
@@ -79,7 +79,7 @@ import {
79
79
  serializeManifestForSlackCli,
80
80
  sessionFileExists,
81
81
  sessionTranscriptDir
82
- } from "../chunk-DGVA3EGS.js";
82
+ } from "../chunk-532V7ZSC.js";
83
83
  import "../chunk-DHWNVVX4.js";
84
84
  import "../chunk-XWVM4KPK.js";
85
85
  import "../chunk-DGUM43GV.js";
@@ -5473,7 +5473,7 @@ import { execFileSync, execSync } from "child_process";
5473
5473
  import { existsSync as existsSync11, realpathSync as realpathSync2 } from "fs";
5474
5474
  import chalk18 from "chalk";
5475
5475
  import ora16 from "ora";
5476
- var cliVersion = true ? "0.28.1002" : "dev";
5476
+ var cliVersion = true ? "0.28.1004" : "dev";
5477
5477
  async function fetchLatestVersion() {
5478
5478
  const host2 = getHost();
5479
5479
  if (!host2) return null;
@@ -6733,7 +6733,7 @@ function handleError(err) {
6733
6733
  }
6734
6734
 
6735
6735
  // src/bin/agt.ts
6736
- var cliVersion2 = true ? "0.28.1002" : "dev";
6736
+ var cliVersion2 = true ? "0.28.1004" : "dev";
6737
6737
  var program = new Command();
6738
6738
  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");
6739
6739
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -3153,6 +3153,52 @@ var INTEGRATION_REGISTRY = [
3153
3153
  }]
3154
3154
  }
3155
3155
  },
3156
+ {
3157
+ // ENG-10854 / ADR-0110. The POLICY half of the catalog definition: this
3158
+ // registry is what `isPremiumDefinition` reads, so the premium descriptor
3159
+ // here is what makes the per-org opt-in required at all. The CUSTOMER-FACING
3160
+ // half - the seeded `integration_definitions` row that the Add Integration
3161
+ // picker lists - is deliberately NOT in this change. `/integrations/installs`
3162
+ // reads the DB catalog with a status filter; this registry is not a listing.
3163
+ //
3164
+ // The order matters and is not bookkeeping: `isOrgEntitledToPremium` returns
3165
+ // TRUE for a definition it does not know as premium, because a free
3166
+ // integration has no opt-in concept. So a broker shipped ahead of this entry
3167
+ // would serve an org that had never opted in. The broker additionally fails
3168
+ // closed on `isPremiumDefinition` being false, so the two halves cannot come
3169
+ // apart in that direction either.
3170
+ id: "typed-evaluation",
3171
+ name: "Typed Evaluation",
3172
+ category: "knowledge",
3173
+ description: "Ask closed questions about a piece of text and get calibrated answers back \u2014 yes/no, pick-one, or a position on your own scale \u2014 with a probability for each. It never writes text and cannot answer outside the set of options you give it, which is what makes it safe to point at content you do not trust. Typical uses: is this message a repeat request, which category does this belong to, how urgent does this sound. Answers arrive in about half a second, so an agent can branch on one without spending a model turn.",
3174
+ // No customer credential exists: the call runs on Ninjafy's own gateway key.
3175
+ supported_auth_types: ["none"],
3176
+ capabilities: [
3177
+ {
3178
+ id: "typed-evaluation:evaluate",
3179
+ name: "Evaluate Text",
3180
+ description: "Ask closed questions about text the agent already holds and receive typed answers with probabilities (evaluate_text).",
3181
+ access: "read"
3182
+ }
3183
+ ],
3184
+ beta: true,
3185
+ // ENG-8842's `included`, and the reason is the consent dialog rather than
3186
+ // the price. `pricing` drives the org admin's acknowledgement modal, where
3187
+ // `usage` renders as "manages and bills by usage" and `monthly` as a
3188
+ // subscription. Both would be false statements here: a call costs about
3189
+ // $0.000076 and nothing is metered or billed, so the opt-in exists to record
3190
+ // a decision about a SUB-PROCESSOR, not about money.
3191
+ //
3192
+ // ADR-0110 Decision 11 keeps the door open deliberately: if a genuinely
3193
+ // high-volume capability arrives later - bulk classification of a customer's
3194
+ // own corpus - it is priced at THAT capability's grain and this definition
3195
+ // stays `included`. Ninja Notes is the precedent (ENG-9278): it acquired a
3196
+ // metered capability and did not flip.
3197
+ premium: {
3198
+ pricing: "included",
3199
+ note: "Typed evaluation is included in your plan \u2014 nothing is metered per question. Turning it on is a decision about data, not cost: the text an agent asks about is sent to Typesafe, through our own gateway, to be scored. It is never used to train a model and we store only the answers, never the text."
3200
+ }
3201
+ },
3156
3202
  {
3157
3203
  // Ninja Notes (ADR-0063, ENG-8842). Meeting capture on the user's own Mac,
3158
3204
  // delivered to an agent as a tag-granted note the agent reads and summarises.
@@ -6273,6 +6319,33 @@ var FLAG_REGISTRY = [
6273
6319
  // "these hosts are unreadable". Both outlive this particular version.
6274
6320
  since: "0.28.667"
6275
6321
  },
6322
+ {
6323
+ // ADR-0110 Decision 5 (ENG-10854). Gates PLATFORM-INTERNAL consumers of the
6324
+ // typed evaluation capability - inbound triage, kanban classification,
6325
+ // memory-extraction sensitivity gating, and later the conversation
6326
+ // evaluator. Nobody "installs" those; they are ours, so they are gated
6327
+ // centrally.
6328
+ //
6329
+ // IT DOES NOT GATE THE AGENT TOOL, and that separation is the point. The
6330
+ // agent tool's gate is the customer's own premium opt-in plus a per-agent
6331
+ // install (Decision 4). Pointing this flag at the tool as well would give
6332
+ // it two masters and let a staff flag silently override a decision the
6333
+ // customer made about their own data reaching a sub-processor.
6334
+ //
6335
+ // Ships with no readers: the consumers land in later slices, and the flag
6336
+ // exists now so the first of them has a gate to be born behind rather than
6337
+ // acquiring one afterwards.
6338
+ key: "typed-evaluation",
6339
+ description: "ADR-0110: platform-internal consumers of the typed evaluation model (Jev, via our AI Gateway). OFF (default) = no internal consumer calls it; ON = consumers that have shipped may call, each still subject to the per-org quota, per-agent rate limit and audit row enforced in the broker. Does NOT gate the agent-facing tool, which is governed by the premium opt-in and a per-agent install instead. Customer orgs stay off until the Decision 9 vendor gates close (sub-processor listing with DPA coverage, the legal read on emotion inference, and a recorded disclosure).",
6340
+ flagType: "boolean",
6341
+ // Ships dark. Every consumer degrades to its current behaviour when off,
6342
+ // so the safe value and the no-op value are the same one.
6343
+ defaultValue: false,
6344
+ // Turning it on starts sending customer text to an external sub-processor
6345
+ // on paths the customer did not individually opt into, which is exactly the
6346
+ // class ADR-0022 section 4 reserves the confirmation for.
6347
+ sensitive: true
6348
+ },
6276
6349
  {
6277
6350
  key: "conversation-eval-backend",
6278
6351
  description: "Backend for host-side conversation-success scoring AND memory extraction (ENG-6581), which share one scorer: anthropic-api = Haiku via a direct Anthropic Messages API fetch (no subprocess); claude-p = Haiku via the `claude -p` subprocess (reuses the agent auth, effectively free under Max but a heavy spawn); local = an OpenAI-compatible loopback endpoint (transcript never leaves the host). Auth for the anthropic-api path comes from AGT_CONV_EVAL_ANTHROPIC_API_KEY (falls back to ANTHROPIC_API_KEY); with no key that path fails closed (eval disabled) rather than reverting to claude-p. Enum.",
@@ -13459,6 +13532,100 @@ var SCHEDULED_TURN_MARKER_FILENAME = ".current-scheduled-turn.json";
13459
13532
  // ../../packages/core/dist/liveness/agent-liveness.js
13460
13533
  var FRESH_HEARTBEAT_THRESHOLD_MS = 2 * 60 * 1e3;
13461
13534
 
13535
+ // ../../packages/core/dist/claude-code-usage/host-usage-reading.js
13536
+ var HOST_USAGE_SOURCE = "cli_print_usage";
13537
+ function unknown(reason, readAt, cliVersion) {
13538
+ return {
13539
+ state: "unknown",
13540
+ weekPct: null,
13541
+ weekResetsAt: null,
13542
+ sessionPct: null,
13543
+ sessionResetsAt: null,
13544
+ readAt,
13545
+ cliVersion,
13546
+ source: HOST_USAGE_SOURCE,
13547
+ unknownReason: reason
13548
+ };
13549
+ }
13550
+ function buildHostUsageReading(input) {
13551
+ const { report, readAt, cliVersion, authMode, pollFailed } = input;
13552
+ if (authMode != null && authMode !== "subscription") {
13553
+ return {
13554
+ state: "not_applicable",
13555
+ weekPct: null,
13556
+ weekResetsAt: null,
13557
+ sessionPct: null,
13558
+ sessionResetsAt: null,
13559
+ readAt,
13560
+ cliVersion,
13561
+ source: HOST_USAGE_SOURCE,
13562
+ unknownReason: null
13563
+ };
13564
+ }
13565
+ if (pollFailed)
13566
+ return unknown("poll_failed", readAt, cliVersion);
13567
+ if (!report)
13568
+ return unknown("unparseable_output", readAt, cliVersion);
13569
+ if (!report.subscription) {
13570
+ return {
13571
+ state: "not_applicable",
13572
+ weekPct: null,
13573
+ weekResetsAt: null,
13574
+ sessionPct: null,
13575
+ sessionResetsAt: null,
13576
+ readAt,
13577
+ cliVersion,
13578
+ source: HOST_USAGE_SOURCE,
13579
+ unknownReason: null
13580
+ };
13581
+ }
13582
+ if (!report.week && !report.session) {
13583
+ return unknown("unparseable_output", readAt, cliVersion);
13584
+ }
13585
+ return {
13586
+ state: "ok",
13587
+ weekPct: report.week?.pct ?? null,
13588
+ // ONLY a DATED reset is stored (CodeRabbit on #4988).
13589
+ //
13590
+ // Print mode has always rendered a date, so `hour_only` here means the CLI
13591
+ // changed its render and `parseResetDateTime` reconstructed the day from an
13592
+ // hour. That reconstruction can never be more than 24h out, and storing it
13593
+ // in a column consumers treat as a measurement is precisely ENG-8472: every
13594
+ // host whose render named the same hour landed on the same millisecond, and
13595
+ // eleven days went into reading that as evidence of a shared subscription.
13596
+ //
13597
+ // The PERCENTAGE survives - it is a real reading either way, and dropping it
13598
+ // would blind the fleet over a formatting change. Only the boundary is
13599
+ // withheld, which degrades an alert to "cannot auto-close at reset" rather
13600
+ // than to "asserts a reset instant nobody measured".
13601
+ weekResetsAt: datedResetOnly(report.week),
13602
+ sessionPct: report.session?.pct ?? null,
13603
+ sessionResetsAt: datedResetOnly(report.session),
13604
+ readAt,
13605
+ cliVersion,
13606
+ source: HOST_USAGE_SOURCE,
13607
+ unknownReason: null
13608
+ };
13609
+ }
13610
+ function datedResetOnly(window) {
13611
+ if (!window || !window.resetsAt)
13612
+ return null;
13613
+ return window.resetPrecision === "dated" ? window.resetsAt : null;
13614
+ }
13615
+ var HOST_USAGE_POLL_INTERVAL_MS = 15 * 60 * 1e3;
13616
+ var READING_EXPIRY_INTERVALS = 2;
13617
+ var RESET_JITTER_TOLERANCE_MS = 5 * 60 * 1e3;
13618
+ function stabiliseResetInstant(previous, next, toleranceMs = RESET_JITTER_TOLERANCE_MS) {
13619
+ if (!next)
13620
+ return null;
13621
+ if (!previous)
13622
+ return next;
13623
+ return Math.abs(next.getTime() - previous.getTime()) <= toleranceMs ? previous : next;
13624
+ }
13625
+
13626
+ // ../../packages/core/dist/liveness/claude-usage-reading.js
13627
+ var STALE_READING_MS = HOST_USAGE_POLL_INTERVAL_MS * READING_EXPIRY_INTERVALS;
13628
+
13462
13629
  // ../../packages/core/dist/claude-code-usage/reset-time.js
13463
13630
  var MONTHS = [
13464
13631
  "jan",
@@ -14057,96 +14224,6 @@ function parseUsageReport(text, now = /* @__PURE__ */ new Date()) {
14057
14224
  };
14058
14225
  }
14059
14226
 
14060
- // ../../packages/core/dist/claude-code-usage/host-usage-reading.js
14061
- var HOST_USAGE_SOURCE = "cli_print_usage";
14062
- function unknown(reason, readAt, cliVersion) {
14063
- return {
14064
- state: "unknown",
14065
- weekPct: null,
14066
- weekResetsAt: null,
14067
- sessionPct: null,
14068
- sessionResetsAt: null,
14069
- readAt,
14070
- cliVersion,
14071
- source: HOST_USAGE_SOURCE,
14072
- unknownReason: reason
14073
- };
14074
- }
14075
- function buildHostUsageReading(input) {
14076
- const { report, readAt, cliVersion, authMode, pollFailed } = input;
14077
- if (authMode != null && authMode !== "subscription") {
14078
- return {
14079
- state: "not_applicable",
14080
- weekPct: null,
14081
- weekResetsAt: null,
14082
- sessionPct: null,
14083
- sessionResetsAt: null,
14084
- readAt,
14085
- cliVersion,
14086
- source: HOST_USAGE_SOURCE,
14087
- unknownReason: null
14088
- };
14089
- }
14090
- if (pollFailed)
14091
- return unknown("poll_failed", readAt, cliVersion);
14092
- if (!report)
14093
- return unknown("unparseable_output", readAt, cliVersion);
14094
- if (!report.subscription) {
14095
- return {
14096
- state: "not_applicable",
14097
- weekPct: null,
14098
- weekResetsAt: null,
14099
- sessionPct: null,
14100
- sessionResetsAt: null,
14101
- readAt,
14102
- cliVersion,
14103
- source: HOST_USAGE_SOURCE,
14104
- unknownReason: null
14105
- };
14106
- }
14107
- if (!report.week && !report.session) {
14108
- return unknown("unparseable_output", readAt, cliVersion);
14109
- }
14110
- return {
14111
- state: "ok",
14112
- weekPct: report.week?.pct ?? null,
14113
- // ONLY a DATED reset is stored (CodeRabbit on #4988).
14114
- //
14115
- // Print mode has always rendered a date, so `hour_only` here means the CLI
14116
- // changed its render and `parseResetDateTime` reconstructed the day from an
14117
- // hour. That reconstruction can never be more than 24h out, and storing it
14118
- // in a column consumers treat as a measurement is precisely ENG-8472: every
14119
- // host whose render named the same hour landed on the same millisecond, and
14120
- // eleven days went into reading that as evidence of a shared subscription.
14121
- //
14122
- // The PERCENTAGE survives - it is a real reading either way, and dropping it
14123
- // would blind the fleet over a formatting change. Only the boundary is
14124
- // withheld, which degrades an alert to "cannot auto-close at reset" rather
14125
- // than to "asserts a reset instant nobody measured".
14126
- weekResetsAt: datedResetOnly(report.week),
14127
- sessionPct: report.session?.pct ?? null,
14128
- sessionResetsAt: datedResetOnly(report.session),
14129
- readAt,
14130
- cliVersion,
14131
- source: HOST_USAGE_SOURCE,
14132
- unknownReason: null
14133
- };
14134
- }
14135
- function datedResetOnly(window) {
14136
- if (!window || !window.resetsAt)
14137
- return null;
14138
- return window.resetPrecision === "dated" ? window.resetsAt : null;
14139
- }
14140
- var HOST_USAGE_POLL_INTERVAL_MS = 15 * 60 * 1e3;
14141
- var RESET_JITTER_TOLERANCE_MS = 5 * 60 * 1e3;
14142
- function stabiliseResetInstant(previous, next, toleranceMs = RESET_JITTER_TOLERANCE_MS) {
14143
- if (!next)
14144
- return null;
14145
- if (!previous)
14146
- return next;
14147
- return Math.abs(next.getTime() - previous.getTime()) <= toleranceMs ? previous : next;
14148
- }
14149
-
14150
14227
  // ../../packages/core/dist/claude-code-usage/rate-limit-classifier.js
14151
14228
  var UNKNOWN_RATE_LIMIT = Object.freeze({
14152
14229
  verdict: "unknown",
@@ -15222,6 +15299,9 @@ export {
15222
15299
  isResolveError,
15223
15300
  deriveConsoleUrl,
15224
15301
  SCHEDULED_TURN_MARKER_FILENAME,
15302
+ buildHostUsageReading,
15303
+ HOST_USAGE_POLL_INTERVAL_MS,
15304
+ stabiliseResetInstant,
15225
15305
  parseUsageBanner,
15226
15306
  bannerRemedyFor,
15227
15307
  formatRunMarker,
@@ -15231,9 +15311,6 @@ export {
15231
15311
  isEmptyTotals,
15232
15312
  attributeTranscriptUsageByRun,
15233
15313
  parseUsageReport,
15234
- buildHostUsageReading,
15235
- HOST_USAGE_POLL_INTERVAL_MS,
15236
- stabiliseResetInstant,
15237
15314
  UNKNOWN_RATE_LIMIT,
15238
15315
  pickNewerClassification,
15239
15316
  classifyTranscriptRateLimit,
@@ -15289,4 +15366,4 @@ export {
15289
15366
  peekCurrentSession,
15290
15367
  readDailySessionPin
15291
15368
  };
15292
- //# sourceMappingURL=chunk-DGVA3EGS.js.map
15369
+ //# sourceMappingURL=chunk-532V7ZSC.js.map