@oxygen-agent/cli 1.1010.650 → 1.1010.905
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/auto-update.d.ts +129 -0
- package/dist/auto-update.js +392 -0
- package/dist/command-manifest.js +15 -1
- package/dist/credentials.d.ts +2 -0
- package/dist/credentials.js +6 -3
- package/dist/functions-commands.js +1 -1
- package/dist/http-client.js +28 -4
- package/dist/inbox-needs-reply-notice.d.ts +12 -0
- package/dist/inbox-needs-reply-notice.js +51 -0
- package/dist/index.js +756 -177
- package/dist/run-wait.d.ts +3 -1
- package/dist/run-wait.js +19 -5
- package/dist/skills.js +48 -22
- package/dist/streamed-file-import.d.ts +58 -0
- package/dist/streamed-file-import.js +115 -0
- package/dist/update.d.ts +29 -0
- package/dist/update.js +62 -16
- package/dist/workflow-plan-limit-notices.d.ts +8 -0
- package/dist/workflow-plan-limit-notices.js +28 -0
- package/node_modules/@oxygen/cli-ugc/dist/commands.js +3 -3
- package/node_modules/@oxygen/shared/dist/billing-anchors.d.ts +50 -2
- package/node_modules/@oxygen/shared/dist/billing-anchors.js +94 -2
- package/node_modules/@oxygen/shared/dist/billing.d.ts +247 -37
- package/node_modules/@oxygen/shared/dist/billing.js +418 -45
- package/node_modules/@oxygen/shared/dist/capability-discovery.js +66 -6
- package/node_modules/@oxygen/shared/dist/copilot-skills.generated.d.ts +6 -6
- package/node_modules/@oxygen/shared/dist/copilot-skills.generated.js +6 -6
- package/node_modules/@oxygen/shared/dist/cost-estimate-view.d.ts +50 -0
- package/node_modules/@oxygen/shared/dist/cost-estimate-view.js +90 -0
- package/node_modules/@oxygen/shared/dist/cost-estimate.d.ts +167 -0
- package/node_modules/@oxygen/shared/dist/cost-estimate.js +361 -0
- package/node_modules/@oxygen/shared/dist/credit-gate.d.ts +26 -0
- package/node_modules/@oxygen/shared/dist/credit-gate.js +65 -0
- package/node_modules/@oxygen/shared/dist/email-deliverability-policy.d.ts +51 -0
- package/node_modules/@oxygen/shared/dist/email-deliverability-policy.js +101 -0
- package/node_modules/@oxygen/shared/dist/email-hard-bounce.d.ts +27 -0
- package/node_modules/@oxygen/shared/dist/email-hard-bounce.js +27 -0
- package/node_modules/@oxygen/shared/dist/error-redaction.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/error-redaction.js +1 -1
- package/node_modules/@oxygen/shared/dist/feature-gates.d.ts +10 -1
- package/node_modules/@oxygen/shared/dist/feature-gates.js +12 -1
- package/node_modules/@oxygen/shared/dist/file-import.d.ts +13 -1
- package/node_modules/@oxygen/shared/dist/file-import.js +33 -6
- package/node_modules/@oxygen/shared/dist/hosted-ai.d.ts +73 -3
- package/node_modules/@oxygen/shared/dist/hosted-ai.js +246 -24
- package/node_modules/@oxygen/shared/dist/import-limits.d.ts +25 -1
- package/node_modules/@oxygen/shared/dist/import-limits.js +35 -2
- package/node_modules/@oxygen/shared/dist/index.d.ts +4 -23
- package/node_modules/@oxygen/shared/dist/index.js +4 -43
- package/node_modules/@oxygen/shared/dist/linkedin-sequences.d.ts +114 -0
- package/node_modules/@oxygen/shared/dist/linkedin-sequences.js +150 -0
- package/node_modules/@oxygen/shared/dist/object-storage.d.ts +9 -0
- package/node_modules/@oxygen/shared/dist/object-storage.js +17 -0
- package/node_modules/@oxygen/shared/dist/operational-telemetry.d.ts +41 -0
- package/node_modules/@oxygen/shared/dist/operational-telemetry.js +55 -0
- package/node_modules/@oxygen/shared/dist/otlp-log-sink.js +19 -2
- package/node_modules/@oxygen/shared/dist/plan-band.d.ts +234 -0
- package/node_modules/@oxygen/shared/dist/plan-band.js +312 -0
- package/node_modules/@oxygen/shared/dist/plan-capabilities.d.ts +77 -7
- package/node_modules/@oxygen/shared/dist/plan-capabilities.js +87 -7
- package/node_modules/@oxygen/shared/dist/plan-limits-view.d.ts +219 -0
- package/node_modules/@oxygen/shared/dist/plan-limits-view.js +330 -0
- package/node_modules/@oxygen/shared/dist/plan-limits.d.ts +335 -126
- package/node_modules/@oxygen/shared/dist/plan-limits.js +277 -86
- package/node_modules/@oxygen/shared/dist/pricing-sheet.d.ts +158 -49
- package/node_modules/@oxygen/shared/dist/pricing-sheet.js +139 -41
- package/node_modules/@oxygen/shared/dist/pricing-snapshot.generated.d.ts +42 -23
- package/node_modules/@oxygen/shared/dist/pricing-snapshot.generated.js +56 -37
- package/node_modules/@oxygen/shared/dist/process-resource.d.ts +4 -0
- package/node_modules/@oxygen/shared/dist/process-resource.js +25 -0
- package/node_modules/@oxygen/shared/dist/provider-http-error.d.ts +10 -0
- package/node_modules/@oxygen/shared/dist/provider-http-error.js +27 -0
- package/node_modules/@oxygen/shared/dist/repricing.d.ts +257 -0
- package/node_modules/@oxygen/shared/dist/repricing.js +721 -0
- package/node_modules/@oxygen/shared/dist/semver.d.ts +21 -0
- package/node_modules/@oxygen/shared/dist/semver.js +41 -0
- package/node_modules/@oxygen/shared/dist/sending-limits.d.ts +30 -0
- package/node_modules/@oxygen/shared/dist/sending-limits.js +43 -0
- package/node_modules/@oxygen/shared/dist/sending-seats.d.ts +18 -15
- package/node_modules/@oxygen/shared/dist/sending-seats.js +22 -17
- package/node_modules/@oxygen/shared/dist/sequence-failures.js +4 -1
- package/node_modules/@oxygen/shared/dist/spend-safety.d.ts +57 -8
- package/node_modules/@oxygen/shared/dist/spend-safety.js +64 -11
- package/node_modules/@oxygen/shared/dist/stripe-price-catalog.d.ts +33 -1
- package/node_modules/@oxygen/shared/dist/stripe-price-catalog.js +71 -1
- package/node_modules/@oxygen/shared/dist/table-capacity.d.ts +68 -10
- package/node_modules/@oxygen/shared/dist/table-capacity.js +85 -4
- package/node_modules/@oxygen/shared/dist/telemetry-export-observer.d.ts +6 -0
- package/node_modules/@oxygen/shared/dist/telemetry-export-observer.js +13 -5
- package/node_modules/@oxygen/shared/dist/telemetry-resource.d.ts +40 -0
- package/node_modules/@oxygen/shared/dist/telemetry-resource.js +35 -0
- package/node_modules/@oxygen/shared/dist/telemetry.d.ts +9 -0
- package/node_modules/@oxygen/shared/dist/telemetry.js +41 -2
- package/node_modules/@oxygen/shared/dist/trace-context.d.ts +29 -0
- package/node_modules/@oxygen/shared/dist/trace-context.js +88 -0
- package/node_modules/@oxygen/shared/dist/ugc.d.ts +15 -0
- package/node_modules/@oxygen/shared/dist/ugc.js +29 -0
- package/node_modules/@oxygen/shared/dist/version.d.ts +1 -3
- package/node_modules/@oxygen/shared/dist/version.generated.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/version.generated.js +1 -1
- package/node_modules/@oxygen/shared/dist/version.js +14 -27
- package/node_modules/@oxygen/shared/dist/workspace-file-storage.d.ts +5 -0
- package/node_modules/@oxygen/shared/dist/workspace-file-storage.js +5 -0
- package/node_modules/@oxygen/workflows/dist/graph/manifest-schema.d.ts +3 -3
- package/node_modules/@oxygen/workflows/dist/graph/types.d.ts +15 -1
- package/node_modules/@oxygen/workflows/dist/graph/types.js +15 -1
- package/node_modules/@oxygen/workflows/dist/index.d.ts +45 -0
- package/node_modules/@oxygen/workflows/dist/index.js +152 -2
- package/node_modules/@oxygen/workflows/dist/usage-estimate.d.ts +10 -1
- package/node_modules/@oxygen/workflows/dist/usage-estimate.js +33 -29
- package/package.json +1 -1
- package/node_modules/@oxygen/shared/dist/email-warmup-readiness.d.ts +0 -64
- package/node_modules/@oxygen/shared/dist/email-warmup-readiness.js +0 -90
package/dist/http-client.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { OXYGEN_VERSION, OxygenError, isCliResult, isVersionGreater, parseSemver, readEnvelopeCompatibility, vercelProtectionBypassHeaders, withRetryAfterDetails, } from "@oxygen/shared";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
|
+
import { recordMutatingRequestAnswered, recoverFromCliFloorRejection } from "./auto-update.js";
|
|
3
4
|
import { defaultApiUrl, loadCredentialsWithEndpoint } from "./credentials.js";
|
|
4
5
|
import { assertResolvedApiUrl, cliEndpointDetails, describeCliEndpoint, isProdApiUrl, resolveCliUpdateGuidance, } from "./runtime.js";
|
|
5
6
|
const DEFAULT_REQUEST_TIMEOUT_MS = 120_000;
|
|
@@ -31,7 +32,14 @@ path, options = {}) {
|
|
|
31
32
|
...init, signal: init?.signal ? AbortSignal.any([options.signal, init.signal]) : options.signal,
|
|
32
33
|
}) : baseFetch;
|
|
33
34
|
if (path !== "/api/health" && shouldCheckCliCompatibility(options)) {
|
|
34
|
-
|
|
35
|
+
try {
|
|
36
|
+
await ensureFreshCliForApiUrl(apiUrl, { fetch: fetchImpl, endpoint });
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
// The preflight dialed only /api/health: nothing has run yet, so an
|
|
40
|
+
// automatic update may re-run this command in the new binary.
|
|
41
|
+
throw error instanceof OxygenError ? await recoverFromCliFloorRejection(error, endpoint) : error;
|
|
42
|
+
}
|
|
35
43
|
}
|
|
36
44
|
options.signal?.throwIfAborted();
|
|
37
45
|
const traceId = options.traceId ?? randomUUID();
|
|
@@ -117,17 +125,33 @@ path, options = {}) {
|
|
|
117
125
|
}
|
|
118
126
|
const envelope = await readEnvelope(response);
|
|
119
127
|
const compatibility = readEnvelopeCompatibility(envelope);
|
|
120
|
-
|
|
128
|
+
const failed = !response.ok || !envelope.ok;
|
|
129
|
+
try {
|
|
130
|
+
assertCliMeetsMinimumApiVersion(compatibility, options, endpoint);
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
// Only a refused request is safe to re-run: a successful one already did its work.
|
|
134
|
+
throw failed && error instanceof OxygenError ? await recoverFromCliFloorRejection(error, endpoint) : error;
|
|
135
|
+
}
|
|
121
136
|
warnIfCliIsOlderThanApi(compatibility.version, endpoint);
|
|
122
|
-
if (
|
|
137
|
+
if (failed) {
|
|
123
138
|
const failure = envelope;
|
|
124
139
|
const responseTraceId = response.headers.get("x-oxygen-trace-id") ?? traceId;
|
|
125
140
|
const details = withRetryAfterDetails(failure.error.details, response);
|
|
126
|
-
|
|
141
|
+
const error = new OxygenError(failure.error.code, describeFailureAgainstEndpoint(failure.error.code, failure.error.message, endpoint), {
|
|
127
142
|
details: withTraceDetails(details, responseTraceId, compatibility, endpoint),
|
|
128
143
|
exitCode: 1,
|
|
129
144
|
});
|
|
145
|
+
// The floor gate refuses before the route does any work (assertCliClientVersionFloor).
|
|
146
|
+
if (error.code === "cli_update_required")
|
|
147
|
+
throw await recoverFromCliFloorRejection(error, endpoint);
|
|
148
|
+
// Any other answer to a write may have written something; never re-run the command after it.
|
|
149
|
+
if (method !== "GET")
|
|
150
|
+
recordMutatingRequestAnswered();
|
|
151
|
+
throw error;
|
|
130
152
|
}
|
|
153
|
+
if (method !== "GET")
|
|
154
|
+
recordMutatingRequestAnswered();
|
|
131
155
|
return envelope.data;
|
|
132
156
|
}
|
|
133
157
|
async function readBoundedBinaryResponse(response, maxBytes) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A needs-reply inbox list's composition as one terminal line (ADR 0027,
|
|
3
|
+
* dev-only triage). `inbox list --needs-reply` keeps every thread AI triage has
|
|
4
|
+
* no verdict on. In the blind acceptance (2026-09-25) the rows' `triage: null`
|
|
5
|
+
* read as "analysed, no signal", so the agent called the filter leaky and
|
|
6
|
+
* re-triaged about 140 threads by hand. This line says how many rows carry a
|
|
7
|
+
* verdict, how many do not, and how to get one.
|
|
8
|
+
*
|
|
9
|
+
* Returns null unless the envelope carries `needs_reply_counts`, which the API
|
|
10
|
+
* sends only on a needs-reply list, so every other command prints nothing.
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatInboxNeedsReplyNotice(data: unknown): string | null;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { isRecord } from "./util.js";
|
|
2
|
+
/**
|
|
3
|
+
* A needs-reply inbox list's composition as one terminal line (ADR 0027,
|
|
4
|
+
* dev-only triage). `inbox list --needs-reply` keeps every thread AI triage has
|
|
5
|
+
* no verdict on. In the blind acceptance (2026-09-25) the rows' `triage: null`
|
|
6
|
+
* read as "analysed, no signal", so the agent called the filter leaky and
|
|
7
|
+
* re-triaged about 140 threads by hand. This line says how many rows carry a
|
|
8
|
+
* verdict, how many do not, and how to get one.
|
|
9
|
+
*
|
|
10
|
+
* Returns null unless the envelope carries `needs_reply_counts`, which the API
|
|
11
|
+
* sends only on a needs-reply list, so every other command prints nothing.
|
|
12
|
+
*/
|
|
13
|
+
export function formatInboxNeedsReplyNotice(data) {
|
|
14
|
+
if (!isRecord(data) || !isRecord(data.needs_reply_counts))
|
|
15
|
+
return null;
|
|
16
|
+
const counts = data.needs_reply_counts;
|
|
17
|
+
const count = (value) => (typeof value === "number" && Number.isFinite(value) ? value : 0);
|
|
18
|
+
const total = count(counts.total);
|
|
19
|
+
const judged = count(counts.needs_reply_analysed);
|
|
20
|
+
const notAnalysed = count(counts.not_analysed_included);
|
|
21
|
+
const undecided = count(counts.undecided_included);
|
|
22
|
+
// "kept", not "judged": triages written before needs_reply_decided existed
|
|
23
|
+
// count as analysed even when the model abstained (conversation-triage.ts).
|
|
24
|
+
const line = `Needs reply: ${total} threads. Triage kept ${judged} as needing a reply`
|
|
25
|
+
+ `; ${notAnalysed} not analysed yet and ${undecided} undecided stay in because nothing shows they need no reply.`;
|
|
26
|
+
if (notAnalysed + undecided === 0)
|
|
27
|
+
return line;
|
|
28
|
+
const page = pageStatusCounts(data.conversations);
|
|
29
|
+
const onPage = page ? ` This page: ${page.not_analysed} rows triage_status not_analysed, ${page.undecided} undecided.` : "";
|
|
30
|
+
// Undecided threads were analysed and the model abstained: a second paid run
|
|
31
|
+
// on the same message is unlikely to decide, so only not_analysed get the command.
|
|
32
|
+
const abstained = undecided > 0 ? " Undecided threads were analysed and the model abstained; re-analysing is unlikely to change that." : "";
|
|
33
|
+
const analyse = notAnalysed > 0
|
|
34
|
+
? " Analyse a not_analysed thread now: oxygen inbox analyze <id> --force (add --channel linkedin or whatsapp for a DM; a small paid AI call, managed credits)."
|
|
35
|
+
: "";
|
|
36
|
+
return `${line}${onPage}${abstained}${analyse}`;
|
|
37
|
+
}
|
|
38
|
+
function pageStatusCounts(rows) {
|
|
39
|
+
if (!Array.isArray(rows))
|
|
40
|
+
return null;
|
|
41
|
+
const tally = { not_analysed: 0, undecided: 0 };
|
|
42
|
+
for (const row of rows) {
|
|
43
|
+
if (!isRecord(row))
|
|
44
|
+
continue;
|
|
45
|
+
if (row.triage_status === "not_analysed")
|
|
46
|
+
tally.not_analysed += 1;
|
|
47
|
+
else if (row.triage_status === "undecided")
|
|
48
|
+
tally.undecided += 1;
|
|
49
|
+
}
|
|
50
|
+
return tally;
|
|
51
|
+
}
|