@oxygen-agent/cli 1.1014.1895 → 1.1014.1997
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 +1 -1
- package/dist/auto-update.js +3 -3
- package/dist/cli-install.d.ts +65 -0
- package/dist/cli-install.js +165 -0
- package/dist/commands/billing.js +1 -1
- package/dist/commands/managed-inboxes.js +6 -2
- package/dist/commands/sequences.js +1 -1
- package/dist/commands/subscriptions.js +7 -5
- package/dist/update.d.ts +4 -57
- package/dist/update.js +17 -163
- package/node_modules/@oxygen/shared/dist/billing.d.ts +5 -1
- package/node_modules/@oxygen/shared/dist/billing.js +5 -1
- package/node_modules/@oxygen/shared/dist/capability-discovery-skill-audiences.generated.d.ts +30 -0
- package/node_modules/@oxygen/shared/dist/capability-discovery-skill-audiences.generated.js +33 -0
- package/node_modules/@oxygen/shared/dist/capability-discovery-skills.d.ts +39 -0
- package/node_modules/@oxygen/shared/dist/capability-discovery-skills.js +86 -0
- package/node_modules/@oxygen/shared/dist/capability-discovery-types.d.ts +93 -0
- package/node_modules/@oxygen/shared/dist/capability-discovery-types.js +1 -0
- package/node_modules/@oxygen/shared/dist/capability-discovery.d.ts +12 -270
- package/node_modules/@oxygen/shared/dist/capability-discovery.js +123 -3712
- package/node_modules/@oxygen/shared/dist/capability-intents/agency-directory.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/agency-directory.rules.js +5 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/agents.d.ts +10 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/agents.js +53 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/agents.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/agents.rules.js +25 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/billing-and-budgets.d.ts +31 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/billing-and-budgets.js +70 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/billing-and-budgets.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/billing-and-budgets.rules.js +85 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/collaboration.d.ts +9 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/collaboration.js +54 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/collaboration.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/collaboration.rules.js +28 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/connected-integrations.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/connected-integrations.rules.js +23 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/connected-linkedin.d.ts +43 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/connected-linkedin.js +90 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/connected-linkedin.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/connected-linkedin.rules.js +58 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/connected-whatsapp.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/connected-whatsapp.rules.js +14 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/geo.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/geo.rules.js +9 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/index.generated.d.ts +365 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/index.generated.js +90 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/knowledge-graph.d.ts +20 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/knowledge-graph.js +37 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/knowledge-graph.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/knowledge-graph.rules.js +43 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/linkedin-public-research.d.ts +4 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/linkedin-public-research.js +26 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/linkedin-public-research.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/linkedin-public-research.rules.js +42 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/messages.d.ts +6 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/messages.js +16 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/messages.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/messages.rules.js +68 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/normalize.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/normalize.js +4 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/platform-operations.d.ts +6 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/platform-operations.js +23 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/platform-operations.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/platform-operations.rules.js +25 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/posts.d.ts +1 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/posts.js +12 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/posts.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/posts.rules.js +20 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/publishing.d.ts +86 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/publishing.js +135 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/publishing.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/publishing.rules.js +89 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/read-inspection.d.ts +7 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/read-inspection.js +85 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/read-inspection.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/read-inspection.rules.js +28 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/recipes.d.ts +7 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/recipes.js +73 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/recipes.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/recipes.rules.js +36 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/records.d.ts +86 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/records.js +240 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/records.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/records.rules.js +71 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sending-infrastructure.d.ts +27 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sending-infrastructure.js +67 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sending-infrastructure.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sending-infrastructure.rules.js +115 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sequences.d.ts +71 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sequences.js +150 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sequences.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sequences.rules.js +149 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/signals.d.ts +42 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/signals.js +42 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/signals.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/signals.rules.js +47 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sourcing-and-provider-tools.d.ts +60 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sourcing-and-provider-tools.js +94 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sourcing-and-provider-tools.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/sourcing-and-provider-tools.rules.js +94 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/tables.d.ts +196 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/tables.js +394 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/tables.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/tables.rules.js +384 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/tags.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/tags.rules.js +5 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/visual-rendering.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/visual-rendering.rules.js +8 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/workflows.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/workflows.js +20 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/workflows.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/workflows.rules.js +90 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/workspace-access.d.ts +59 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/workspace-access.js +121 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/workspace-access.rules.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-intents/workspace-access.rules.js +58 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/ads.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/ads.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/agency-directory.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/agency-directory.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/agents.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/agents.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/billing-and-budgets.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/billing-and-budgets.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/collaboration.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/collaboration.js +39 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/connected-integrations.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/connected-integrations.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/connected-linkedin.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/connected-linkedin.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/connected-whatsapp.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/connected-whatsapp.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/dashboards.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/dashboards.js +28 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/discovery-and-skills.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/discovery-and-skills.js +22 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/geo.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/geo.js +13 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/index.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/index.js +64 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/knowledge-graph.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/knowledge-graph.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/linkedin-public-research.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/linkedin-public-research.js +18 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/messages.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/messages.js +21 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/observability.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/observability.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/onboarding-and-copilot.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/onboarding-and-copilot.js +23 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/platform-operations.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/platform-operations.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/posts.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/posts.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/publishing.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/publishing.js +20 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/recipes.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/recipes.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/records.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/records.js +20 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/sending-infrastructure.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/sending-infrastructure.js +42 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/sequences.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/sequences.js +32 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/signals.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/signals.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/sourcing-and-provider-tools.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/sourcing-and-provider-tools.js +21 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/support-and-feedback.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/support-and-feedback.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/tables.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/tables.js +34 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/tags.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/tags.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/visual-rendering.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/visual-rendering.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/workflows.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/workflows.js +17 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/workspace-access.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/capability-routes/workspace-access.js +26 -0
- package/node_modules/@oxygen/shared/dist/contracts/connectors.js +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/customer-operations.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/contracts/operations/agent-sessions.d.ts +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/agent-sessions.js +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/browser.d.ts +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/browser.js +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/clay-migration.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/clay-migration.js +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/connectors.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/connectors.js +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/geo.d.ts +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/geo.js +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/guided-activation.d.ts +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/guided-activation.js +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/index.generated.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/index.generated.js +26 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/reply-oxygent.d.ts +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/reply-oxygent.js +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/sender-limits.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/sender-limits.js +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/table-feed-update.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/table-feed-update.js +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/teammates.d.ts +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/teammates.js +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/workspace-pages.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/workspace-pages.js +2 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/workspace-skills.d.ts +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations/workspace-skills.js +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations.d.ts +6 -0
- package/node_modules/@oxygen/shared/dist/contracts/operations.js +7 -15
- package/node_modules/@oxygen/shared/dist/contracts/sender-limits.js +1 -0
- package/node_modules/@oxygen/shared/dist/diagnostic-storage-lock.js +33 -22
- package/node_modules/@oxygen/shared/dist/diagnostics.js +11 -8
- package/node_modules/@oxygen/shared/dist/first-month-offer-window.d.ts +3 -0
- package/node_modules/@oxygen/shared/dist/first-month-offer.d.ts +15 -7
- package/node_modules/@oxygen/shared/dist/first-month-offer.js +23 -9
- package/node_modules/@oxygen/shared/dist/guided-activation.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/listed-website-platforms.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/listed-website-platforms.js +23 -1
- package/node_modules/@oxygen/shared/dist/onboarding-leads.d.ts +67 -0
- package/node_modules/@oxygen/shared/dist/onboarding-leads.js +78 -0
- package/node_modules/@oxygen/shared/dist/otlp-log-sink.js +20 -0
- package/node_modules/@oxygen/shared/dist/plan-capabilities.js +1 -1
- package/node_modules/@oxygen/shared/dist/plan-limits.d.ts +2 -2
- package/node_modules/@oxygen/shared/dist/plan-limits.js +6 -7
- package/node_modules/@oxygen/shared/dist/sending-domain-faults.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/sending-domain-faults.js +1 -1
- package/node_modules/@oxygen/shared/dist/tenant-migration-names.d.ts +5 -0
- package/node_modules/@oxygen/shared/dist/tenant-migration-names.js +8 -0
- 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/workflows/dist/graph/lint.d.ts +1 -1
- package/node_modules/@oxygen/workflows/dist/graph/lint.js +4 -3
- package/node_modules/@oxygen/workflows/dist/index.d.ts +2 -59
- package/node_modules/@oxygen/workflows/dist/index.js +4 -904
- package/node_modules/@oxygen/workflows/dist/manifest-validation.d.ts +75 -0
- package/node_modules/@oxygen/workflows/dist/manifest-validation.js +903 -0
- package/package.json +1 -1
package/dist/update.js
CHANGED
|
@@ -1,167 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { readFileSync } from "node:fs";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { OxygenError } from "@oxygen/shared/cli-result";
|
|
6
|
-
import { OXYGEN_VERSION } from "@oxygen/shared/version";
|
|
1
|
+
import { installCliPackage, } from "./cli-install.js";
|
|
7
2
|
import { runAutomaticSkillsInstall, skippedAutomaticSkillsInstall, } from "./skills.js";
|
|
8
|
-
|
|
9
|
-
import { readOption } from "./util.js";
|
|
10
|
-
import { quoteWindowsCmdArg } from "./windows-shim.js";
|
|
11
|
-
const DEFAULT_CLI_PACKAGE_SPEC = "@oxygen-agent/cli@latest";
|
|
12
|
-
// skipcq: JS-R1005 — handles platform/install-mode/dry-run combinations end-to-end
|
|
3
|
+
export { detectCliInstall, detectCliInstallPrefixFromPath, readInstalledCliVersion, resolveNpmExecutables, } from "./cli-install.js";
|
|
13
4
|
export async function updateCli(options, runtime = {}) {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const packageSpec = readOption(options.package) ?? DEFAULT_CLI_PACKAGE_SPEC;
|
|
18
|
-
const modulePath = runtime.modulePath ?? fileURLToPath(import.meta.url);
|
|
19
|
-
const install = detectCliInstall(modulePath);
|
|
20
|
-
const prefix = install.kind === "global" ? install.prefix : null;
|
|
21
|
-
const args = prefix
|
|
22
|
-
? ["install", "-g", "--prefix", prefix, packageSpec]
|
|
23
|
-
: ["install", "-g", packageSpec];
|
|
24
|
-
// The command string is for human display (printed in dry-run / success
|
|
25
|
-
// output). Quote args that contain shell-significant characters so a
|
|
26
|
-
// copy-paste of the line works on install prefixes with spaces.
|
|
27
|
-
const command = ["npm", ...args].map(quoteForDisplay).join(" ");
|
|
28
|
-
if (!options.dryRun)
|
|
29
|
-
assertUpdatableInstall(install, env, runtime.argv ?? process.argv);
|
|
30
|
-
if (options.dryRun) {
|
|
31
|
-
return {
|
|
32
|
-
current_version: OXYGEN_VERSION,
|
|
33
|
-
package: packageSpec,
|
|
34
|
-
command,
|
|
35
|
-
dry_run: true,
|
|
36
|
-
updated: false,
|
|
37
|
-
skills_install: skippedAutomaticSkillsInstall("dry_run"),
|
|
38
|
-
};
|
|
5
|
+
const installed = await installCliPackage(options, runtime);
|
|
6
|
+
if (installed.dry_run) {
|
|
7
|
+
return { ...installed, skills_install: skippedAutomaticSkillsInstall("dry_run") };
|
|
39
8
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
...(platform === "win32" ? { windowsVerbatimArguments: true } : {}),
|
|
53
|
-
});
|
|
54
|
-
lastResult = result;
|
|
55
|
-
if (result.error && isMissingExecutableError(result.error))
|
|
56
|
-
continue;
|
|
57
|
-
if (!result.error && result.status === 0) {
|
|
58
|
-
return {
|
|
59
|
-
current_version: OXYGEN_VERSION,
|
|
60
|
-
installed_version: install.kind === "global" ? readInstalledCliVersion(install.packageDir) : null,
|
|
61
|
-
package: packageSpec,
|
|
62
|
-
command,
|
|
63
|
-
dry_run: false,
|
|
64
|
-
updated: true,
|
|
65
|
-
skills_install: options.skipSkillsInstall
|
|
66
|
-
? skippedAutomaticSkillsInstall("deferred_to_updated_cli")
|
|
67
|
-
: await runAutomaticSkillsInstall({
|
|
68
|
-
env,
|
|
69
|
-
platform,
|
|
70
|
-
...(runtime.credentials !== undefined ? { credentials: runtime.credentials } : {}),
|
|
71
|
-
...(runtime.fetch ? { fetch: runtime.fetch } : {}),
|
|
72
|
-
...(runtime.execFileSync ? { execFileSync: runtime.execFileSync } : {}),
|
|
73
|
-
}),
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
const result = lastResult;
|
|
79
|
-
throw new OxygenError("cli_update_failed", "Unable to update the Oxygen CLI.", {
|
|
80
|
-
details: {
|
|
81
|
-
command,
|
|
82
|
-
package: packageSpec,
|
|
83
|
-
exit_code: result?.status ?? null,
|
|
84
|
-
reason: result?.error instanceof Error ? result.error.message : null,
|
|
85
|
-
stderr: typeof result?.stderr === "string" && result.stderr.trim() ? result.stderr.trim().slice(0, 4000) : null,
|
|
86
|
-
attempted_executables: attemptedExecutables,
|
|
87
|
-
},
|
|
88
|
-
exitCode: 1,
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
export function detectCliInstall(modulePath) {
|
|
92
|
-
const normalizedPath = modulePath.replace(/\\/g, "/");
|
|
93
|
-
const markers = [
|
|
94
|
-
"/node_modules/@oxygen-agent/cli/dist/",
|
|
95
|
-
"/node_modules/@oxygen/cli/dist/",
|
|
96
|
-
];
|
|
97
|
-
for (const marker of markers) {
|
|
98
|
-
const markerIndex = normalizedPath.lastIndexOf(marker);
|
|
99
|
-
if (markerIndex === -1)
|
|
100
|
-
continue;
|
|
101
|
-
const packageParent = normalizedPath.slice(0, markerIndex);
|
|
102
|
-
const packageDir = normalizedPath.slice(0, markerIndex + marker.length - "/dist/".length);
|
|
103
|
-
if (packageParent.endsWith("/lib")) {
|
|
104
|
-
return { kind: "global", prefix: packageParent.slice(0, -"/lib".length), packageDir };
|
|
105
|
-
}
|
|
106
|
-
// npm's Windows global layout has no lib/: <prefix>\node_modules.
|
|
107
|
-
if (/^[A-Za-z]:\//.test(normalizedPath))
|
|
108
|
-
return { kind: "global", prefix: packageParent, packageDir };
|
|
109
|
-
// Anywhere else, `npm install -g --prefix <dir>` writes <dir>/lib/node_modules — a
|
|
110
|
-
// different tree from the one running — and reports success while nothing changed.
|
|
111
|
-
return { kind: "local", projectDir: packageParent, packageDir };
|
|
112
|
-
}
|
|
113
|
-
return { kind: "source" };
|
|
114
|
-
}
|
|
115
|
-
export function detectCliInstallPrefixFromPath(modulePath) {
|
|
116
|
-
const install = detectCliInstall(modulePath);
|
|
117
|
-
return install.kind === "global" ? install.prefix : null;
|
|
118
|
-
}
|
|
119
|
-
/** The version npm actually left on disk for the running package. */
|
|
120
|
-
export function readInstalledCliVersion(packageDir) {
|
|
121
|
-
try {
|
|
122
|
-
const parsed = JSON.parse(readFileSync(join(packageDir, "package.json"), "utf8"));
|
|
123
|
-
return typeof parsed.version === "string" ? parsed.version : null;
|
|
124
|
-
}
|
|
125
|
-
catch {
|
|
126
|
-
return null;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
function assertUpdatableInstall(install, env, argv) {
|
|
130
|
-
if (resolveCliBinaryName(env, argv) === "oxygen-dev") {
|
|
131
|
-
throw new OxygenError("cli_update_unsupported_install", "oxygen-dev is built from the dev branch, not installed from npm. "
|
|
132
|
-
+ "Rebuild it with `npm run install-dev-cli` from the latest dev checkout.", { details: { install: "dev_build", update_command: "npm run install-dev-cli" }, exitCode: 1 });
|
|
133
|
-
}
|
|
134
|
-
if (install.kind === "local") {
|
|
135
|
-
throw new OxygenError("cli_update_unsupported_install", `This Oxygen CLI runs from a project-local install in ${install.projectDir}, which \`oxygen update\` cannot replace. `
|
|
136
|
-
+ "Run `npm install @oxygen-agent/cli@latest` in that directory, or install globally with "
|
|
137
|
-
+ "`npm install -g @oxygen-agent/cli`.", {
|
|
138
|
-
details: {
|
|
139
|
-
install: "local",
|
|
140
|
-
install_dir: install.projectDir,
|
|
141
|
-
update_command: "npm install @oxygen-agent/cli@latest",
|
|
142
|
-
},
|
|
143
|
-
exitCode: 1,
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
export function resolveNpmExecutables(platform = process.platform) {
|
|
148
|
-
return platform === "win32" ? ["cmd.exe"] : ["npm"];
|
|
149
|
-
}
|
|
150
|
-
function isMissingExecutableError(error) {
|
|
151
|
-
return error.code === "ENOENT";
|
|
152
|
-
}
|
|
153
|
-
function resolveNpmInvocations(args, platform, env) {
|
|
154
|
-
if (platform !== "win32")
|
|
155
|
-
return [{ executable: "npm", args, label: "npm" }];
|
|
156
|
-
const shell = env.ComSpec?.trim() || "cmd.exe";
|
|
157
|
-
return [{
|
|
158
|
-
executable: shell,
|
|
159
|
-
args: ["/d", "/s", "/c", ["npm", ...args].map(quoteWindowsCmdArg).join(" ")],
|
|
160
|
-
label: shell,
|
|
161
|
-
}];
|
|
162
|
-
}
|
|
163
|
-
function quoteForDisplay(value) {
|
|
164
|
-
if (/^[A-Za-z0-9_@+=:,./-]+$/.test(value))
|
|
165
|
-
return value;
|
|
166
|
-
return `'${value.replace(/'/g, "'\\''")}'`;
|
|
9
|
+
return {
|
|
10
|
+
...installed,
|
|
11
|
+
skills_install: options.skipSkillsInstall
|
|
12
|
+
? skippedAutomaticSkillsInstall("deferred_to_updated_cli")
|
|
13
|
+
: await runAutomaticSkillsInstall({
|
|
14
|
+
env: runtime.env ?? process.env,
|
|
15
|
+
platform: runtime.platform ?? process.platform,
|
|
16
|
+
...(runtime.credentials !== undefined ? { credentials: runtime.credentials } : {}),
|
|
17
|
+
...(runtime.fetch ? { fetch: runtime.fetch } : {}),
|
|
18
|
+
...(runtime.execFileSync ? { execFileSync: runtime.execFileSync } : {}),
|
|
19
|
+
}),
|
|
20
|
+
};
|
|
167
21
|
}
|
|
@@ -288,8 +288,12 @@ export declare const TRIAL_CREDIT_GRANT = 2000;
|
|
|
288
288
|
* Neither churn nor downgrade nor re-subscribe nor billing-owner re-link ever
|
|
289
289
|
* mints it a second time. Top-ups stay purchasable on free, which is what keeps
|
|
290
290
|
* the metered surface open-ended rather than capped at the grant.
|
|
291
|
+
*
|
|
292
|
+
* 250 since 2026-10-23 (was 1,000): "let's keep it free and let's just reduce
|
|
293
|
+
* the credits", with onboarding's research and its lead list OXYGEN-funded, so
|
|
294
|
+
* running a play is where a plan starts. A grant already issued is unchanged.
|
|
291
295
|
*/
|
|
292
|
-
export declare const FREE_SIGNUP_GRANT_CREDITS =
|
|
296
|
+
export declare const FREE_SIGNUP_GRANT_CREDITS = 250;
|
|
293
297
|
export declare const FREE_TIER_GRANTS_ENABLED_ENV_VAR = "OXYGEN_FREE_TIER_GRANTS_ENABLED";
|
|
294
298
|
/**
|
|
295
299
|
* Fail-closed rollout switch for the free-tier grants, matching the staged
|
|
@@ -403,8 +403,12 @@ export const TRIAL_CREDIT_GRANT = 2_000;
|
|
|
403
403
|
* Neither churn nor downgrade nor re-subscribe nor billing-owner re-link ever
|
|
404
404
|
* mints it a second time. Top-ups stay purchasable on free, which is what keeps
|
|
405
405
|
* the metered surface open-ended rather than capped at the grant.
|
|
406
|
+
*
|
|
407
|
+
* 250 since 2026-10-23 (was 1,000): "let's keep it free and let's just reduce
|
|
408
|
+
* the credits", with onboarding's research and its lead list OXYGEN-funded, so
|
|
409
|
+
* running a play is where a plan starts. A grant already issued is unchanged.
|
|
406
410
|
*/
|
|
407
|
-
export const FREE_SIGNUP_GRANT_CREDITS =
|
|
411
|
+
export const FREE_SIGNUP_GRANT_CREDITS = 250;
|
|
408
412
|
export const FREE_TIER_GRANTS_ENABLED_ENV_VAR = "OXYGEN_FREE_TIER_GRANTS_ENABLED";
|
|
409
413
|
/**
|
|
410
414
|
* Fail-closed rollout switch for the free-tier grants, matching the staged
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const SERVED_PRODUCT_SKILL_AUDIENCES: {
|
|
2
|
+
readonly "oxygen-agency-directory": "agency_partner";
|
|
3
|
+
readonly "oxygen-clay-migration": "workspace";
|
|
4
|
+
readonly "oxygen-collaboration": "workspace";
|
|
5
|
+
readonly "oxygen-crm": "workspace";
|
|
6
|
+
readonly "oxygen-custom-http": "workspace";
|
|
7
|
+
readonly "oxygen-deliverability": "workspace";
|
|
8
|
+
readonly "oxygen-diagnostics": "workspace";
|
|
9
|
+
readonly "oxygen-email-infra": "workspace";
|
|
10
|
+
readonly "oxygen-enrichment": "workspace";
|
|
11
|
+
readonly "oxygen-feedback": "workspace";
|
|
12
|
+
readonly "oxygen-geo": "internal_dev";
|
|
13
|
+
readonly "oxygen-gtm": "workspace";
|
|
14
|
+
readonly "oxygen-gtm-consultant": "workspace";
|
|
15
|
+
readonly "oxygen-knowledge": "workspace";
|
|
16
|
+
readonly "oxygen-linkedin-content": "workspace";
|
|
17
|
+
readonly "oxygen-onboarding": "workspace";
|
|
18
|
+
readonly "oxygen-publishing": "workspace";
|
|
19
|
+
readonly "oxygen-quickstart": "workspace";
|
|
20
|
+
readonly "oxygen-recipes": "workspace";
|
|
21
|
+
readonly "oxygen-reply-oxygent": "internal_dev";
|
|
22
|
+
readonly "oxygen-sequencer": "workspace";
|
|
23
|
+
readonly "oxygen-signals": "workspace";
|
|
24
|
+
readonly "oxygen-sourcing": "workspace";
|
|
25
|
+
readonly "oxygen-table-tidy": "workspace";
|
|
26
|
+
readonly "oxygen-tables": "workspace";
|
|
27
|
+
readonly "oxygen-ugc": "workspace";
|
|
28
|
+
readonly "oxygen-unibox": "workspace";
|
|
29
|
+
readonly "oxygen-workflow-authoring": "workspace";
|
|
30
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// GENERATED by scripts/codegen/product-skill-audiences.mjs from
|
|
2
|
+
// apps/web/src/agent-skills/<skill>.manifest.ts. Do not edit; rerun it after
|
|
3
|
+
// adding a skill or changing its audience.
|
|
4
|
+
export const SERVED_PRODUCT_SKILL_AUDIENCES = {
|
|
5
|
+
"oxygen-agency-directory": "agency_partner",
|
|
6
|
+
"oxygen-clay-migration": "workspace",
|
|
7
|
+
"oxygen-collaboration": "workspace",
|
|
8
|
+
"oxygen-crm": "workspace",
|
|
9
|
+
"oxygen-custom-http": "workspace",
|
|
10
|
+
"oxygen-deliverability": "workspace",
|
|
11
|
+
"oxygen-diagnostics": "workspace",
|
|
12
|
+
"oxygen-email-infra": "workspace",
|
|
13
|
+
"oxygen-enrichment": "workspace",
|
|
14
|
+
"oxygen-feedback": "workspace",
|
|
15
|
+
"oxygen-geo": "internal_dev",
|
|
16
|
+
"oxygen-gtm": "workspace",
|
|
17
|
+
"oxygen-gtm-consultant": "workspace",
|
|
18
|
+
"oxygen-knowledge": "workspace",
|
|
19
|
+
"oxygen-linkedin-content": "workspace",
|
|
20
|
+
"oxygen-onboarding": "workspace",
|
|
21
|
+
"oxygen-publishing": "workspace",
|
|
22
|
+
"oxygen-quickstart": "workspace",
|
|
23
|
+
"oxygen-recipes": "workspace",
|
|
24
|
+
"oxygen-reply-oxygent": "internal_dev",
|
|
25
|
+
"oxygen-sequencer": "workspace",
|
|
26
|
+
"oxygen-signals": "workspace",
|
|
27
|
+
"oxygen-sourcing": "workspace",
|
|
28
|
+
"oxygen-table-tidy": "workspace",
|
|
29
|
+
"oxygen-tables": "workspace",
|
|
30
|
+
"oxygen-ugc": "workspace",
|
|
31
|
+
"oxygen-unibox": "workspace",
|
|
32
|
+
"oxygen-workflow-authoring": "workspace",
|
|
33
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skills OXYGEN once served and has retired (2026-10-04: plays are inspiration
|
|
3
|
+
* read through the recipes API, never skills, and visual design is taught by
|
|
4
|
+
* its commands' own help; LinkedIn marketing split into the Publishing and
|
|
5
|
+
* Signals feature skills, with its account-safety rules in the sequencer's
|
|
6
|
+
* LinkedIn reference). The manifest no longer serves them, so nothing new
|
|
7
|
+
* can install, attach or advertise them; their audience below stays so an Agent
|
|
8
|
+
* version or Copilot session that already pinned one keeps its snapshot.
|
|
9
|
+
*/
|
|
10
|
+
export declare const RETIRED_PRODUCT_SKILLS: readonly string[];
|
|
11
|
+
/**
|
|
12
|
+
* Current hosted instruction audiences, shared by discovery and Agent snapshots.
|
|
13
|
+
* Served skills come from each skill's catalog manifest (generated); retired ones
|
|
14
|
+
* are listed here.
|
|
15
|
+
*/
|
|
16
|
+
export declare const OXYGEN_PRODUCT_SKILL_AUDIENCES: Readonly<Record<string, "workspace" | "agency_partner" | "internal_dev">>;
|
|
17
|
+
export declare function canReadProductSkillInstructions(name: string, entitlements: {
|
|
18
|
+
authenticated?: boolean;
|
|
19
|
+
agencyPartner: boolean;
|
|
20
|
+
internalDev?: boolean;
|
|
21
|
+
}): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Largest `oxygen_skills_get` result, in serialized characters, that an agent
|
|
24
|
+
* runtime keeps whole in the transcript instead of storing it behind a preview.
|
|
25
|
+
* A play or reference is read to be followed: stored, the model saw only the
|
|
26
|
+
* file list in the 600-character preview, and a stored copy holds the body on one
|
|
27
|
+
* escaped line that grep and line reads cut at 4,000 characters. Sized to fit
|
|
28
|
+
* every served Markdown file whole (largest 2026-10-23: oxygen-ugc/operations.md,
|
|
29
|
+
* 39,744 escaped characters; plays at most 13,550; SKILL.md at most 8,136), pinned
|
|
30
|
+
* by the skills get route test. Only the 203 KB oxygen-gtm/prompts.json asset is
|
|
31
|
+
* over it, and it is over the store's ceiling too.
|
|
32
|
+
*/
|
|
33
|
+
export declare const PRODUCT_SKILL_READ_INLINE_CHARS = 48000;
|
|
34
|
+
/** Identify hosted instruction bodies by native tool lineage, never by user prose. */
|
|
35
|
+
export declare function readProductSkillInstructionResult(capabilityName: string, result: unknown): {
|
|
36
|
+
slug: string | null;
|
|
37
|
+
} | null;
|
|
38
|
+
/** Public action cards never advertise invite-only, retired or unknown skill instructions. */
|
|
39
|
+
export declare function isPublicCapabilitySkill(name: string): boolean;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { SERVED_PRODUCT_SKILL_AUDIENCES } from "./capability-discovery-skill-audiences.generated.js";
|
|
2
|
+
/**
|
|
3
|
+
* Skills OXYGEN once served and has retired (2026-10-04: plays are inspiration
|
|
4
|
+
* read through the recipes API, never skills, and visual design is taught by
|
|
5
|
+
* its commands' own help; LinkedIn marketing split into the Publishing and
|
|
6
|
+
* Signals feature skills, with its account-safety rules in the sequencer's
|
|
7
|
+
* LinkedIn reference). The manifest no longer serves them, so nothing new
|
|
8
|
+
* can install, attach or advertise them; their audience below stays so an Agent
|
|
9
|
+
* version or Copilot session that already pinned one keeps its snapshot.
|
|
10
|
+
*/
|
|
11
|
+
export const RETIRED_PRODUCT_SKILLS = Object.freeze(["oxygen-playbooks", "oxygen-visual-design", "oxygen-linkedin-marketing"]);
|
|
12
|
+
/**
|
|
13
|
+
* Current hosted instruction audiences, shared by discovery and Agent snapshots.
|
|
14
|
+
* Served skills come from each skill's catalog manifest (generated); retired ones
|
|
15
|
+
* are listed here.
|
|
16
|
+
*/
|
|
17
|
+
export const OXYGEN_PRODUCT_SKILL_AUDIENCES = Object.freeze({
|
|
18
|
+
...SERVED_PRODUCT_SKILL_AUDIENCES,
|
|
19
|
+
// Retired (RETIRED_PRODUCT_SKILLS): readable for existing pins, never served.
|
|
20
|
+
"oxygen-playbooks": "workspace",
|
|
21
|
+
"oxygen-visual-design": "workspace",
|
|
22
|
+
"oxygen-linkedin-marketing": "workspace",
|
|
23
|
+
});
|
|
24
|
+
export function canReadProductSkillInstructions(name, entitlements) {
|
|
25
|
+
if (entitlements.authenticated !== true)
|
|
26
|
+
return false;
|
|
27
|
+
const audience = Object.hasOwn(OXYGEN_PRODUCT_SKILL_AUDIENCES, name)
|
|
28
|
+
? OXYGEN_PRODUCT_SKILL_AUDIENCES[name]
|
|
29
|
+
: undefined;
|
|
30
|
+
return audience === "workspace" || (audience === "internal_dev" && entitlements.internalDev === true) || (audience === "agency_partner" && entitlements.agencyPartner);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Largest `oxygen_skills_get` result, in serialized characters, that an agent
|
|
34
|
+
* runtime keeps whole in the transcript instead of storing it behind a preview.
|
|
35
|
+
* A play or reference is read to be followed: stored, the model saw only the
|
|
36
|
+
* file list in the 600-character preview, and a stored copy holds the body on one
|
|
37
|
+
* escaped line that grep and line reads cut at 4,000 characters. Sized to fit
|
|
38
|
+
* every served Markdown file whole (largest 2026-10-23: oxygen-ugc/operations.md,
|
|
39
|
+
* 39,744 escaped characters; plays at most 13,550; SKILL.md at most 8,136), pinned
|
|
40
|
+
* by the skills get route test. Only the 203 KB oxygen-gtm/prompts.json asset is
|
|
41
|
+
* over it, and it is over the store's ceiling too.
|
|
42
|
+
*/
|
|
43
|
+
export const PRODUCT_SKILL_READ_INLINE_CHARS = 48_000;
|
|
44
|
+
/** Identify hosted instruction bodies by native tool lineage, never by user prose. */
|
|
45
|
+
export function readProductSkillInstructionResult(capabilityName, result) {
|
|
46
|
+
if (capabilityName !== "oxygen_skills_get")
|
|
47
|
+
return null;
|
|
48
|
+
const pending = [result];
|
|
49
|
+
for (let i = 0; i < pending.length && i < 24; i += 1) {
|
|
50
|
+
let value = pending[i];
|
|
51
|
+
if (typeof value === "string") {
|
|
52
|
+
try {
|
|
53
|
+
value = JSON.parse(value);
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (value === null || typeof value !== "object" || Array.isArray(value))
|
|
60
|
+
continue;
|
|
61
|
+
const envelope = value;
|
|
62
|
+
if (envelope.ok === false || envelope.isError === true || envelope.status === "error")
|
|
63
|
+
continue;
|
|
64
|
+
if (typeof envelope.content === "string") {
|
|
65
|
+
const name = typeof envelope.name === "string" ? envelope.name : "";
|
|
66
|
+
return { slug: Object.hasOwn(OXYGEN_PRODUCT_SKILL_AUDIENCES, name) ? name : null };
|
|
67
|
+
}
|
|
68
|
+
for (const key of ["result", "data", "structuredContent", "structured"]) {
|
|
69
|
+
if (envelope[key] !== undefined)
|
|
70
|
+
pending.push(envelope[key]);
|
|
71
|
+
}
|
|
72
|
+
if (Array.isArray(envelope.content)) {
|
|
73
|
+
for (const block of envelope.content) {
|
|
74
|
+
if (block && typeof block === "object" && block.type === "text" && typeof block.text === "string")
|
|
75
|
+
pending.push(block.text);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
/** Public action cards never advertise invite-only, retired or unknown skill instructions. */
|
|
82
|
+
export function isPublicCapabilitySkill(name) {
|
|
83
|
+
return Object.hasOwn(OXYGEN_PRODUCT_SKILL_AUDIENCES, name)
|
|
84
|
+
&& OXYGEN_PRODUCT_SKILL_AUDIENCES[name] === "workspace"
|
|
85
|
+
&& !RETIRED_PRODUCT_SKILLS.includes(name);
|
|
86
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { RecipePrimitive } from "./recipes.js";
|
|
2
|
+
export type CapabilityLayer = "Control" | "Knowledge" | "Data" | "Action" | "External";
|
|
3
|
+
export type CapabilityPosture = "read_only" | "workspace_write" | "paid_read" | "external_write" | "mixed";
|
|
4
|
+
export type CapabilityRouteCard = {
|
|
5
|
+
id: string;
|
|
6
|
+
layer: CapabilityLayer;
|
|
7
|
+
primitive: RecipePrimitive | null;
|
|
8
|
+
owns: string;
|
|
9
|
+
notFor: string;
|
|
10
|
+
execution: string;
|
|
11
|
+
posture: CapabilityPosture;
|
|
12
|
+
gatewayTools: readonly string[];
|
|
13
|
+
gatewayCommands: readonly string[];
|
|
14
|
+
skills: readonly string[];
|
|
15
|
+
endpointSections: readonly string[];
|
|
16
|
+
intentTerms: readonly string[];
|
|
17
|
+
negativeTerms?: readonly string[];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* One file under `capability-routes/` defines one card. `order` is the card's
|
|
21
|
+
* position in OXYGEN_CAPABILITY_ROUTES, ascending and unique: scoring keeps the
|
|
22
|
+
* first card on a tie, and every listing (CLI, MCP, docs) follows this order.
|
|
23
|
+
* Space new values between neighbours rather than renumbering.
|
|
24
|
+
*/
|
|
25
|
+
export type CapabilityRouteDefinition = {
|
|
26
|
+
order: number;
|
|
27
|
+
card: CapabilityRouteCard;
|
|
28
|
+
};
|
|
29
|
+
/** One MCP tool call with placeholder arguments, e.g. `"<sequence>"`. */
|
|
30
|
+
export type CapabilityMcpCall = {
|
|
31
|
+
tool: string;
|
|
32
|
+
arguments: Record<string, unknown>;
|
|
33
|
+
};
|
|
34
|
+
/** What a route recommends; `exactCommand`/`exactMcpCall` only when the ask is one narrow invocation. */
|
|
35
|
+
export type CapabilityRecommendation = {
|
|
36
|
+
tools: string[];
|
|
37
|
+
commands: string[];
|
|
38
|
+
exactCommand?: string;
|
|
39
|
+
exactMcpCall?: CapabilityMcpCall;
|
|
40
|
+
};
|
|
41
|
+
/** A whole route a pre-route rule builds before any card is chosen. */
|
|
42
|
+
export type CapabilityPreRoute = {
|
|
43
|
+
card: CapabilityRouteCard;
|
|
44
|
+
recommendedTools: string[];
|
|
45
|
+
recommendedCommands: string[];
|
|
46
|
+
exactCommand?: string;
|
|
47
|
+
exactMcpCall?: CapabilityMcpCall;
|
|
48
|
+
};
|
|
49
|
+
/** Cards by id or primitive, for pre-route rules. */
|
|
50
|
+
export type CapabilityCardLookup = {
|
|
51
|
+
byId(id: string): CapabilityRouteCard | undefined;
|
|
52
|
+
byPrimitive(primitive: string): CapabilityRouteCard | undefined;
|
|
53
|
+
};
|
|
54
|
+
/** A card the route reports instead; `done` stops further views (`preferSkill` still applies the skill rules). */
|
|
55
|
+
export type CapabilityCardView = {
|
|
56
|
+
card: CapabilityRouteCard;
|
|
57
|
+
done?: boolean;
|
|
58
|
+
preferSkill?: boolean;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* One `capability-intents/<owner>.rules.ts` file's rules. Each list runs in
|
|
62
|
+
* ascending `order` across every file and the first rule that answers wins (card
|
|
63
|
+
* views chain until one is `done`), so `order` is the contract: a new rule takes
|
|
64
|
+
* an unused value between the neighbours it must follow and precede. Orders are
|
|
65
|
+
* unique per list across all files.
|
|
66
|
+
*/
|
|
67
|
+
export type CapabilityIntentRules = {
|
|
68
|
+
/** Whole routes decided before card choice, from the normalized and the raw query. */
|
|
69
|
+
preRoutes?: readonly {
|
|
70
|
+
order: number;
|
|
71
|
+
route: (query: string, rawQuery: string, cards: CapabilityCardLookup) => CapabilityPreRoute | null;
|
|
72
|
+
}[];
|
|
73
|
+
/** The card id an explicit ask owns, ahead of term scoring. */
|
|
74
|
+
explicit?: readonly {
|
|
75
|
+
order: number;
|
|
76
|
+
route: (query: string) => string | null;
|
|
77
|
+
}[];
|
|
78
|
+
/** Recommendations for the chosen card; its gateways answer when no rule does. */
|
|
79
|
+
recommendations?: readonly {
|
|
80
|
+
order: number;
|
|
81
|
+
recommend: (card: CapabilityRouteCard, query: string) => CapabilityRecommendation | null;
|
|
82
|
+
}[];
|
|
83
|
+
/** The card the route reports; each view sees the previous one's card. */
|
|
84
|
+
cardViews?: readonly {
|
|
85
|
+
order: number;
|
|
86
|
+
view: (card: CapabilityRouteCard, query: string) => CapabilityCardView | null;
|
|
87
|
+
}[];
|
|
88
|
+
/** The skill the reported card names first. */
|
|
89
|
+
skills?: readonly {
|
|
90
|
+
order: number;
|
|
91
|
+
skill: (card: CapabilityRouteCard, query: string) => string | null;
|
|
92
|
+
}[];
|
|
93
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|