@0perator/operator 0.1.285 → 0.1.313
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 +24 -2
- package/dist/acp/agent.js +2 -1
- package/dist/acp/config-options.js +3 -1
- package/dist/acp/tool-map.js +2 -1
- package/dist/auth/commands.js +69 -13
- package/dist/autonomy/agent-cli.js +304 -0
- package/dist/autonomy/cloud-agent.js +439 -0
- package/dist/autonomy/cron-lifecycle.js +78 -0
- package/dist/autonomy/cron-lock.js +121 -0
- package/dist/autonomy/cron.js +216 -43
- package/dist/autonomy/delegate.js +5 -1
- package/dist/autonomy/incidents.js +135 -0
- package/dist/autonomy/session-factory.js +25 -16
- package/dist/background/index.js +40 -0
- package/dist/bus/inbox.js +20 -0
- package/dist/classifier/config.js +47 -0
- package/dist/classifier/modes.js +41 -0
- package/dist/classifier/types.js +1 -0
- package/dist/cli.js +529 -53
- package/dist/config/features.js +69 -0
- package/dist/config/persona.js +118 -99
- package/dist/config/scaffold.js +15 -0
- package/dist/config/settings.js +96 -6
- package/dist/consolidation/sleep.js +73 -11
- package/dist/engine/agent.js +275 -18
- package/dist/engine/anthropic-chat.js +343 -0
- package/dist/engine/aurora.js +101 -13
- package/dist/engine/batch-scheduler.js +41 -9
- package/dist/engine/classifier.js +85 -0
- package/dist/engine/compaction.js +24 -5
- package/dist/engine/fast-start.js +25 -0
- package/dist/engine/loop-guard.js +448 -0
- package/dist/engine/net-error.js +24 -0
- package/dist/engine/repetition-guard.js +180 -0
- package/dist/engine/selfheal.js +8 -0
- package/dist/engine/toolcalls.js +51 -1
- package/dist/engine/verify-gate.js +2 -0
- package/dist/flywheel/processor.js +78 -31
- package/dist/flywheel/srft.js +13 -0
- package/dist/hooks/index.js +196 -0
- package/dist/mcp/config.js +21 -1
- package/dist/memory/index.js +0 -0
- package/dist/memory/providers.js +210 -0
- package/dist/memory/session-catalog.js +422 -0
- package/dist/memory/session-providers.js +121 -0
- package/dist/memory/session-sources.js +335 -0
- package/dist/memory/skylark.js +131 -0
- package/dist/models/bench.js +103 -0
- package/dist/models/registry.js +144 -0
- package/dist/models/switch.js +69 -0
- package/dist/observability/blackbox.js +37 -0
- package/dist/permissions/policy.js +31 -6
- package/dist/router/discovery.js +127 -0
- package/dist/router/models.js +107 -16
- package/dist/router/portal.js +100 -0
- package/dist/router/router.js +1 -1
- package/dist/services/preflight.js +55 -7
- package/dist/session.js +316 -46
- package/dist/tools/chauffeur.js +12 -0
- package/dist/tools/executor.js +19 -9
- package/dist/tools/find-files.js +483 -0
- package/dist/tools/git-pr.js +94 -0
- package/dist/tools/incident-tools.js +82 -0
- package/dist/tools/memory.js +12 -2
- package/dist/tools/registry.js +281 -85
- package/dist/tools/semantic-compress.js +124 -0
- package/dist/tools/shell-context.js +1 -0
- package/dist/tools/shell-jobs.js +160 -0
- package/dist/tools/shell-session.js +170 -4
- package/dist/tools/wave-tools.js +609 -0
- package/dist/tools/wave2-tools.js +411 -0
- package/dist/ui/App.js +15 -4
- package/dist/ui/BgPanel.js +30 -6
- package/dist/ui/Composer.js +11 -1
- package/dist/ui/QuestionPrompt.js +31 -11
- package/dist/ui/SessionPicker.js +86 -0
- package/dist/ui/StatusRule.js +5 -5
- package/dist/ui/ToolStep.js +2 -1
- package/dist/ui/Transcript.js +17 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui/liveTools.js +21 -3
- package/dist/ui/slashCommands.js +2 -0
- package/dist/util/screenshots.js +74 -8
- package/dist/util/slash.js +2 -2
- package/package.json +8 -2
- package/dist/engine/cli.js +0 -1171
- package/dist/router/models.js.bak +0 -78
- package/dist/router/models.js.bak-1791259923 +0 -78
- package/dist/router/models.js.bak-pre-gateway +0 -78
- package/dist/router/models.js.bak-pre-patch2 +0 -78
- package/dist/router/models.js.bak2 +0 -78
- package/dist/services/model-autodetect.js +0 -240
- package/dist/tools/native-redirect.js +0 -140
- package/dist/tools/power-tools.js +0 -627
- package/dist/tools/registry.js.bak-1791259948 +0 -1914
- package/dist/tools/registry.js.bak-pre-plugins +0 -1914
- package/dist/ui/BusTray.js +0 -70
- package/dist/ui/resize.js +0 -160
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** The single "proceed" label for the act-vs-ask gate; every OTHER candidate is an ASK signal. */
|
|
2
|
+
export const ACT_LABEL = "act now";
|
|
3
|
+
/** Default ASK signals — overridable via settings.classifier.askLabels without touching code. */
|
|
4
|
+
export const DEFAULT_ASK_LABELS = [
|
|
5
|
+
"needs user options or confirmation",
|
|
6
|
+
"ambiguous scope",
|
|
7
|
+
"heavy or irreversible work",
|
|
8
|
+
];
|
|
9
|
+
const MODE_DEFAULTS = {
|
|
10
|
+
fast: { askMinScore: 0.60, tauAbs: 0.40, tauMargin: 0.15, onAbstain: "act", onDegraded: "act" },
|
|
11
|
+
safe: { askMinScore: 0.30, tauAbs: 0.55, tauMargin: 0.25, onAbstain: "ask", onDegraded: "ask" },
|
|
12
|
+
};
|
|
13
|
+
const IRREVERSIBLE_DEFAULTS = {
|
|
14
|
+
labels: ["pentest", "fleet_ops", "delete_destructive"],
|
|
15
|
+
tauIrrev: { fast: 0.20, safe: 0.10 },
|
|
16
|
+
keywordPrefilter: ["rm -rf", "find -delete", "DROP ", "DELETE ", "TRUNCATE", "force-push", "systemctl", "launchctl bootout", "rotate key"],
|
|
17
|
+
};
|
|
18
|
+
/** The 9 intent-route labels (topic axis). Kept here as the single source; the tier map lives with the job. */
|
|
19
|
+
export const ROUTE_LABELS = [
|
|
20
|
+
"research", "tool_call", "chat_simple", "chat_complex", "code", "creative", "nl_to_sql", "pentest", "fleet_ops",
|
|
21
|
+
];
|
|
22
|
+
export const DEFAULT_ENDPOINT = "http://127.0.0.1:8400";
|
|
23
|
+
/** Resolve the full classifier config for the current settings. */
|
|
24
|
+
export function classifierConfig(s) {
|
|
25
|
+
const c = s?.classifier ?? {};
|
|
26
|
+
return {
|
|
27
|
+
endpoint: c.endpoint ?? DEFAULT_ENDPOINT,
|
|
28
|
+
apiKey: c.apiKey,
|
|
29
|
+
actAsk: {
|
|
30
|
+
actLabel: ACT_LABEL,
|
|
31
|
+
askLabels: c.askLabels ?? [...DEFAULT_ASK_LABELS],
|
|
32
|
+
/** legacy single knob; still honored as a per-mode askMinScore override when set */
|
|
33
|
+
legacyMinScore: c.gateMinScore,
|
|
34
|
+
},
|
|
35
|
+
intentRoute: { labels: [...ROUTE_LABELS] },
|
|
36
|
+
irreversible: IRREVERSIBLE_DEFAULTS,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** Mode thresholds, with the legacy `gateMinScore` honored as an askMinScore override if the caller set it. */
|
|
40
|
+
export function modeThresholds(mode, s) {
|
|
41
|
+
const base = MODE_DEFAULTS[mode];
|
|
42
|
+
const legacy = s?.classifier?.gateMinScore;
|
|
43
|
+
return typeof legacy === "number" ? { ...base, askMinScore: legacy } : base;
|
|
44
|
+
}
|
|
45
|
+
export function irreversibleConfig(_s) {
|
|
46
|
+
return IRREVERSIBLE_DEFAULTS;
|
|
47
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { isFeatureEnabled } from "../config/features.js";
|
|
2
|
+
const MODES = ["off", "fast", "safe"];
|
|
3
|
+
/** Parse a mode string (env or settings); undefined (unset/unrecognized) lets resolution fall through. */
|
|
4
|
+
function parseMode(v) {
|
|
5
|
+
if (!v)
|
|
6
|
+
return undefined;
|
|
7
|
+
const t = v.trim().toLowerCase();
|
|
8
|
+
return MODES.includes(t) ? t : undefined;
|
|
9
|
+
}
|
|
10
|
+
/** Resolve the active mode. FIRST decisive wins:
|
|
11
|
+
* 1. KODE_FEATURES_OFF=1 → off (the master kill-switch still rules everything).
|
|
12
|
+
* 2. env KODE_CLASSIFIER_MODE ∈ off|fast|safe.
|
|
13
|
+
* 3. settings.classifier.mode.
|
|
14
|
+
* 4. BACK-COMPAT: legacy `classifierGate` feature on (settings or KODE_FEATURE_CLASSIFIER_GATE) → safe,
|
|
15
|
+
* so the one knob people already set keeps meaning what it meant.
|
|
16
|
+
* 5. default off. */
|
|
17
|
+
export function resolveMode(settings) {
|
|
18
|
+
if (process.env.KODE_FEATURES_OFF === "1")
|
|
19
|
+
return "off";
|
|
20
|
+
const env = parseMode(process.env.KODE_CLASSIFIER_MODE);
|
|
21
|
+
if (env)
|
|
22
|
+
return env;
|
|
23
|
+
const configured = parseMode(settings?.classifier?.mode);
|
|
24
|
+
if (configured)
|
|
25
|
+
return configured;
|
|
26
|
+
if (isFeatureEnabled("classifierGate", settings))
|
|
27
|
+
return "safe"; // legacy flag → safe, nobody's config changes silently
|
|
28
|
+
return "off";
|
|
29
|
+
}
|
|
30
|
+
/** Which jobs each mode runs, and whether a job may block the turn. Adding a mode = one row; adding a job to a
|
|
31
|
+
* mode = one entry. `blocking:false` everywhere today — a job surfaces a directive, it never hard-blocks.
|
|
32
|
+
* NOTE `safe` does NOT drop the speed job: being careful and being fast-routed aren't exclusive; `fast` is
|
|
33
|
+
* the one that drops safety. */
|
|
34
|
+
export const MODE_JOBS = {
|
|
35
|
+
off: [],
|
|
36
|
+
fast: [{ job: "intent-route", blocking: false }],
|
|
37
|
+
safe: [
|
|
38
|
+
{ job: "intent-route", blocking: false },
|
|
39
|
+
{ job: "act-ask", blocking: false },
|
|
40
|
+
],
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|