@super-one/cli 0.53.9-alpha → 0.53.11-alpha
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/MANIFEST.json +2 -2
- package/lib/cli.mjs +163 -53
- package/package.json +1 -1
package/MANIFEST.json
CHANGED
package/lib/cli.mjs
CHANGED
|
@@ -3567,7 +3567,7 @@ If the tool returns an error containing "user_locked", the user has manually nam
|
|
|
3567
3567
|
},
|
|
3568
3568
|
"permissionPreset": {
|
|
3569
3569
|
"type": "string",
|
|
3570
|
-
"enum": ["read-only", "default", "full-access"],
|
|
3570
|
+
"enum": ["read-only", "default", "auto-review", "full-access"],
|
|
3571
3571
|
"description": "Codex legacy alias for permissionMode (full-access \u2248 bypassPermissions)."
|
|
3572
3572
|
}
|
|
3573
3573
|
},
|
|
@@ -11638,6 +11638,9 @@ function createCodexAgentEventMapper(options) {
|
|
|
11638
11638
|
let lastItemCompletedAt = startedAt;
|
|
11639
11639
|
let started = false;
|
|
11640
11640
|
let terminal = false;
|
|
11641
|
+
let activeCompaction = null;
|
|
11642
|
+
const completedCompactionTurns = /* @__PURE__ */ new Set();
|
|
11643
|
+
const compactionTrigger = options.turnKind === "compact" ? "manual" : "auto";
|
|
11641
11644
|
const upsert = (item) => {
|
|
11642
11645
|
if (!itemMap.has(item.id)) order.push(item.id);
|
|
11643
11646
|
itemMap.set(item.id, item);
|
|
@@ -11648,9 +11651,54 @@ function createCodexAgentEventMapper(options) {
|
|
|
11648
11651
|
options.emit({ type: "codex_item_delta", messageId: options.messageId, phase, item });
|
|
11649
11652
|
};
|
|
11650
11653
|
const finishStatus = () => options.emit({ type: "status_change", status: "idle" });
|
|
11654
|
+
const startCompaction = (params) => {
|
|
11655
|
+
const turnId = readString(params.turnId) ?? readString(params.turn_id) ?? currentTurnId;
|
|
11656
|
+
if (turnId && completedCompactionTurns.has(turnId)) return;
|
|
11657
|
+
if (activeCompaction && (!activeCompaction.turnId || !turnId || activeCompaction.turnId === turnId)) {
|
|
11658
|
+
if (!activeCompaction.turnId && turnId) {
|
|
11659
|
+
activeCompaction = {
|
|
11660
|
+
turnId,
|
|
11661
|
+
startedAt: readNumber(params.startedAtMs ?? params.started_at_ms) ?? activeCompaction.startedAt,
|
|
11662
|
+
preTokens: currentUsage?.lastInputTokens ?? activeCompaction.preTokens
|
|
11663
|
+
};
|
|
11664
|
+
}
|
|
11665
|
+
return;
|
|
11666
|
+
}
|
|
11667
|
+
activeCompaction = {
|
|
11668
|
+
turnId,
|
|
11669
|
+
startedAt: readNumber(params.startedAtMs ?? params.started_at_ms) ?? now(),
|
|
11670
|
+
preTokens: currentUsage?.lastInputTokens ?? 0
|
|
11671
|
+
};
|
|
11672
|
+
options.emit({ type: "status_indicator", indicator: "compacting" });
|
|
11673
|
+
};
|
|
11674
|
+
const completeCompaction = (params) => {
|
|
11675
|
+
const turnId = readString(params.turnId) ?? readString(params.turn_id) ?? currentTurnId;
|
|
11676
|
+
if (turnId && completedCompactionTurns.has(turnId)) return;
|
|
11677
|
+
if (!activeCompaction) startCompaction(params);
|
|
11678
|
+
const current = activeCompaction;
|
|
11679
|
+
if (!current) return;
|
|
11680
|
+
const completedAt = readNumber(params.completedAtMs ?? params.completed_at_ms) ?? now();
|
|
11681
|
+
const postTokens = currentUsage?.lastInputTokens;
|
|
11682
|
+
options.emit({
|
|
11683
|
+
type: "compact_boundary",
|
|
11684
|
+
trigger: compactionTrigger,
|
|
11685
|
+
preTokens: current.preTokens,
|
|
11686
|
+
...postTokens !== void 0 && postTokens > 0 ? { postTokens } : {},
|
|
11687
|
+
...completedAt >= current.startedAt ? { durationMs: completedAt - current.startedAt } : {},
|
|
11688
|
+
...compactionTrigger === "manual" ? { messageId: options.messageId } : {}
|
|
11689
|
+
});
|
|
11690
|
+
options.emit({ type: "status_indicator", indicator: null, compactResult: "success" });
|
|
11691
|
+
const completedTurnId = turnId ?? current.turnId;
|
|
11692
|
+
if (completedTurnId) completedCompactionTurns.add(completedTurnId);
|
|
11693
|
+
activeCompaction = null;
|
|
11694
|
+
};
|
|
11651
11695
|
const fail2 = (error51, interrupted = false) => {
|
|
11652
11696
|
if (terminal) return;
|
|
11653
11697
|
terminal = true;
|
|
11698
|
+
if (activeCompaction) {
|
|
11699
|
+
activeCompaction = null;
|
|
11700
|
+
options.emit({ type: "status_indicator", indicator: null, compactResult: "failed", compactError: error51 });
|
|
11701
|
+
}
|
|
11654
11702
|
options.emit(interrupted ? { type: "message_interrupted", messageId: options.messageId } : { type: "message_error", messageId: options.messageId, error: error51 });
|
|
11655
11703
|
finishStatus();
|
|
11656
11704
|
};
|
|
@@ -11672,6 +11720,7 @@ function createCodexAgentEventMapper(options) {
|
|
|
11672
11720
|
});
|
|
11673
11721
|
options.emit({ type: "status_change", status: "streaming" });
|
|
11674
11722
|
if (threadId) options.emit({ type: "codex_thread_started", messageId: options.messageId, threadId });
|
|
11723
|
+
if (options.turnKind === "compact") startCompaction({});
|
|
11675
11724
|
},
|
|
11676
11725
|
apply(note) {
|
|
11677
11726
|
const result = emptyApplyResult();
|
|
@@ -11690,6 +11739,11 @@ function createCodexAgentEventMapper(options) {
|
|
|
11690
11739
|
case "item/completed": {
|
|
11691
11740
|
const raw = asRecord(params.item);
|
|
11692
11741
|
if (!raw) break;
|
|
11742
|
+
if (readString(raw.type) === "contextCompaction") {
|
|
11743
|
+
if (note.method === "item/started") startCompaction(params);
|
|
11744
|
+
else completeCompaction(params);
|
|
11745
|
+
break;
|
|
11746
|
+
}
|
|
11693
11747
|
const previous = readString(raw.id) ? itemMap.get(readString(raw.id)) : void 0;
|
|
11694
11748
|
if (previous?.type === "plan" && note.method === "item/completed") {
|
|
11695
11749
|
emitItem("completed", previous);
|
|
@@ -11793,6 +11847,10 @@ function createCodexAgentEventMapper(options) {
|
|
|
11793
11847
|
}
|
|
11794
11848
|
break;
|
|
11795
11849
|
}
|
|
11850
|
+
case "thread/compacted": {
|
|
11851
|
+
completeCompaction(params);
|
|
11852
|
+
break;
|
|
11853
|
+
}
|
|
11796
11854
|
case "mcpServer/startupStatus/updated": {
|
|
11797
11855
|
const name = readString(params.name);
|
|
11798
11856
|
if (!name) break;
|
|
@@ -11829,6 +11887,7 @@ function createCodexAgentEventMapper(options) {
|
|
|
11829
11887
|
fail2(result.error, true);
|
|
11830
11888
|
break;
|
|
11831
11889
|
}
|
|
11890
|
+
if (activeCompaction) completeCompaction(params);
|
|
11832
11891
|
for (const id of order) {
|
|
11833
11892
|
const item = itemMap.get(id);
|
|
11834
11893
|
if (!item) continue;
|
|
@@ -12257,7 +12316,8 @@ async function runCodexAppServerTurn(opts) {
|
|
|
12257
12316
|
messageId: opts.messageId ?? `codex_${turnId ?? Date.now()}`,
|
|
12258
12317
|
emit: opts.onAgentEvent,
|
|
12259
12318
|
model: opts.model,
|
|
12260
|
-
turnId
|
|
12319
|
+
turnId,
|
|
12320
|
+
turnKind
|
|
12261
12321
|
}) : null;
|
|
12262
12322
|
agentEventMapper?.start(threadId);
|
|
12263
12323
|
while (!opts.signal.aborted && Date.now() < deadline) {
|
|
@@ -18770,14 +18830,6 @@ var init_types2 = __esm({
|
|
|
18770
18830
|
}
|
|
18771
18831
|
});
|
|
18772
18832
|
|
|
18773
|
-
// ../../packages/shared/src/platform-registry/capabilities.ts
|
|
18774
|
-
var init_capabilities2 = __esm({
|
|
18775
|
-
"../../packages/shared/src/platform-registry/capabilities.ts"() {
|
|
18776
|
-
"use strict";
|
|
18777
|
-
init_protocols();
|
|
18778
|
-
}
|
|
18779
|
-
});
|
|
18780
|
-
|
|
18781
18833
|
// ../../packages/shared/src/agent-types.ts
|
|
18782
18834
|
function resolveLaunchSummary(task, summary) {
|
|
18783
18835
|
const explicit = typeof summary === "string" ? summary.trim() : "";
|
|
@@ -18793,21 +18845,30 @@ var init_agent_types = __esm({
|
|
|
18793
18845
|
CODEX_PERMISSION_PRESETS = {
|
|
18794
18846
|
"read-only": {
|
|
18795
18847
|
approvalPolicy: "on-request",
|
|
18848
|
+
approvalsReviewer: "user",
|
|
18796
18849
|
sandboxMode: "read-only",
|
|
18797
18850
|
networkAccessEnabled: false
|
|
18798
18851
|
},
|
|
18799
18852
|
default: {
|
|
18800
18853
|
approvalPolicy: "on-request",
|
|
18854
|
+
approvalsReviewer: "user",
|
|
18855
|
+
sandboxMode: "workspace-write",
|
|
18856
|
+
networkAccessEnabled: false
|
|
18857
|
+
},
|
|
18858
|
+
"auto-review": {
|
|
18859
|
+
approvalPolicy: "on-request",
|
|
18860
|
+
approvalsReviewer: "auto_review",
|
|
18801
18861
|
sandboxMode: "workspace-write",
|
|
18802
18862
|
networkAccessEnabled: false
|
|
18803
18863
|
},
|
|
18804
18864
|
"full-access": {
|
|
18805
18865
|
approvalPolicy: "never",
|
|
18866
|
+
approvalsReviewer: "user",
|
|
18806
18867
|
sandboxMode: "danger-full-access",
|
|
18807
18868
|
networkAccessEnabled: true
|
|
18808
18869
|
}
|
|
18809
18870
|
};
|
|
18810
|
-
DEFAULT_CODEX_PERMISSION_PRESET = "
|
|
18871
|
+
DEFAULT_CODEX_PERMISSION_PRESET = "auto-review";
|
|
18811
18872
|
DEFAULT_CODEX_PERMISSION_PROFILE = CODEX_PERMISSION_PRESETS[DEFAULT_CODEX_PERMISSION_PRESET];
|
|
18812
18873
|
MODEL_BUCKETS = ["default", "opus", "sonnet", "haiku", "subagent"];
|
|
18813
18874
|
}
|
|
@@ -18848,42 +18909,6 @@ var init_merge = __esm({
|
|
|
18848
18909
|
}
|
|
18849
18910
|
});
|
|
18850
18911
|
|
|
18851
|
-
// ../../packages/shared/src/model-tasks.ts
|
|
18852
|
-
var init_model_tasks = __esm({
|
|
18853
|
-
"../../packages/shared/src/model-tasks.ts"() {
|
|
18854
|
-
"use strict";
|
|
18855
|
-
}
|
|
18856
|
-
});
|
|
18857
|
-
|
|
18858
|
-
// ../../packages/shared/src/platform-registry/relay-discovery.ts
|
|
18859
|
-
var CANONICAL_CATALOG_PROVIDERS, FIRST_PARTY_CATALOG_PROVIDERS;
|
|
18860
|
-
var init_relay_discovery = __esm({
|
|
18861
|
-
"../../packages/shared/src/platform-registry/relay-discovery.ts"() {
|
|
18862
|
-
"use strict";
|
|
18863
|
-
init_model_tasks();
|
|
18864
|
-
init_protocols();
|
|
18865
|
-
CANONICAL_CATALOG_PROVIDERS = ["openai", "anthropic", "google"];
|
|
18866
|
-
FIRST_PARTY_CATALOG_PROVIDERS = /* @__PURE__ */ new Set([
|
|
18867
|
-
...CANONICAL_CATALOG_PROVIDERS,
|
|
18868
|
-
"xai",
|
|
18869
|
-
"deepseek",
|
|
18870
|
-
"mistral",
|
|
18871
|
-
"cohere",
|
|
18872
|
-
"meta",
|
|
18873
|
-
"moonshotai",
|
|
18874
|
-
"moonshotai-cn",
|
|
18875
|
-
"zhipuai",
|
|
18876
|
-
"zhipuai-coding-plan",
|
|
18877
|
-
"alibaba",
|
|
18878
|
-
"alibaba-cn",
|
|
18879
|
-
"minimax",
|
|
18880
|
-
"minimax-cn",
|
|
18881
|
-
"bytedance",
|
|
18882
|
-
"perplexity"
|
|
18883
|
-
]);
|
|
18884
|
-
}
|
|
18885
|
-
});
|
|
18886
|
-
|
|
18887
18912
|
// ../../packages/shared/src/platform-registry/effective-endpoints.ts
|
|
18888
18913
|
function isCustomPlatformId(platformId) {
|
|
18889
18914
|
return platformId.startsWith("custom:");
|
|
@@ -18891,6 +18916,24 @@ function isCustomPlatformId(platformId) {
|
|
|
18891
18916
|
function isCustomPlatform(platform2) {
|
|
18892
18917
|
return isCustomPlatformId(platform2.id);
|
|
18893
18918
|
}
|
|
18919
|
+
function withCustomAnthropicDefaults(endpoints) {
|
|
18920
|
+
return endpoints.map((endpoint) => {
|
|
18921
|
+
if (!endpoint.protocols.includes("anthropic-messages")) return endpoint;
|
|
18922
|
+
if (endpoint.defaults?.extraEnv && ENABLE_TOOL_SEARCH_ENV in endpoint.defaults.extraEnv) {
|
|
18923
|
+
return endpoint;
|
|
18924
|
+
}
|
|
18925
|
+
return {
|
|
18926
|
+
...endpoint,
|
|
18927
|
+
defaults: {
|
|
18928
|
+
...endpoint.defaults,
|
|
18929
|
+
extraEnv: {
|
|
18930
|
+
[ENABLE_TOOL_SEARCH_ENV]: "true",
|
|
18931
|
+
...endpoint.defaults?.extraEnv
|
|
18932
|
+
}
|
|
18933
|
+
}
|
|
18934
|
+
};
|
|
18935
|
+
});
|
|
18936
|
+
}
|
|
18894
18937
|
function foldOverridesIntoEndpoints(endpoints, overrides) {
|
|
18895
18938
|
if (!overrides || Object.keys(overrides).length === 0) return endpoints;
|
|
18896
18939
|
return endpoints.map((endpoint) => {
|
|
@@ -18916,21 +18959,85 @@ function foldOverridesIntoEndpoints(endpoints, overrides) {
|
|
|
18916
18959
|
}
|
|
18917
18960
|
function effectiveEndpoints(platform2, plan, credential) {
|
|
18918
18961
|
if (isCustomPlatform(platform2)) {
|
|
18919
|
-
|
|
18920
|
-
return
|
|
18962
|
+
const endpoints = credential?.endpoints && credential.endpoints.length > 0 ? credential.endpoints : foldOverridesIntoEndpoints(plan.endpoints, credential?.overrides);
|
|
18963
|
+
return withCustomAnthropicDefaults(endpoints);
|
|
18921
18964
|
}
|
|
18922
18965
|
return plan.endpoints;
|
|
18923
18966
|
}
|
|
18967
|
+
var ENABLE_TOOL_SEARCH_ENV;
|
|
18924
18968
|
var init_effective_endpoints = __esm({
|
|
18925
18969
|
"../../packages/shared/src/platform-registry/effective-endpoints.ts"() {
|
|
18926
18970
|
"use strict";
|
|
18927
18971
|
init_merge();
|
|
18972
|
+
ENABLE_TOOL_SEARCH_ENV = "ENABLE_TOOL_SEARCH";
|
|
18973
|
+
}
|
|
18974
|
+
});
|
|
18975
|
+
|
|
18976
|
+
// ../../packages/shared/src/platform-registry/relay-identify.ts
|
|
18977
|
+
var init_relay_identify = __esm({
|
|
18978
|
+
"../../packages/shared/src/platform-registry/relay-identify.ts"() {
|
|
18979
|
+
"use strict";
|
|
18980
|
+
init_protocols();
|
|
18981
|
+
}
|
|
18982
|
+
});
|
|
18983
|
+
|
|
18984
|
+
// ../../packages/shared/src/platform-registry/capabilities.ts
|
|
18985
|
+
var init_capabilities2 = __esm({
|
|
18986
|
+
"../../packages/shared/src/platform-registry/capabilities.ts"() {
|
|
18987
|
+
"use strict";
|
|
18988
|
+
init_protocols();
|
|
18989
|
+
init_effective_endpoints();
|
|
18990
|
+
init_relay_identify();
|
|
18991
|
+
}
|
|
18992
|
+
});
|
|
18993
|
+
|
|
18994
|
+
// ../../packages/shared/src/model-tasks.ts
|
|
18995
|
+
var init_model_tasks = __esm({
|
|
18996
|
+
"../../packages/shared/src/model-tasks.ts"() {
|
|
18997
|
+
"use strict";
|
|
18998
|
+
}
|
|
18999
|
+
});
|
|
19000
|
+
|
|
19001
|
+
// ../../packages/shared/src/platform-registry/relay-discovery.ts
|
|
19002
|
+
var CANONICAL_CATALOG_PROVIDERS, FIRST_PARTY_CATALOG_PROVIDERS;
|
|
19003
|
+
var init_relay_discovery = __esm({
|
|
19004
|
+
"../../packages/shared/src/platform-registry/relay-discovery.ts"() {
|
|
19005
|
+
"use strict";
|
|
19006
|
+
init_model_tasks();
|
|
19007
|
+
init_protocols();
|
|
19008
|
+
init_relay_identify();
|
|
19009
|
+
CANONICAL_CATALOG_PROVIDERS = ["openai", "anthropic", "google"];
|
|
19010
|
+
FIRST_PARTY_CATALOG_PROVIDERS = /* @__PURE__ */ new Set([
|
|
19011
|
+
...CANONICAL_CATALOG_PROVIDERS,
|
|
19012
|
+
"xai",
|
|
19013
|
+
"deepseek",
|
|
19014
|
+
"mistral",
|
|
19015
|
+
"cohere",
|
|
19016
|
+
"meta",
|
|
19017
|
+
"moonshotai",
|
|
19018
|
+
"moonshotai-cn",
|
|
19019
|
+
"zhipuai",
|
|
19020
|
+
"zhipuai-coding-plan",
|
|
19021
|
+
"alibaba",
|
|
19022
|
+
"alibaba-cn",
|
|
19023
|
+
"minimax",
|
|
19024
|
+
"minimax-cn",
|
|
19025
|
+
"bytedance",
|
|
19026
|
+
"perplexity"
|
|
19027
|
+
]);
|
|
18928
19028
|
}
|
|
18929
19029
|
});
|
|
18930
19030
|
|
|
18931
19031
|
// ../../packages/shared/src/platform-registry/builtin.ts
|
|
18932
19032
|
function anthropic(baseUrl, opts = {}) {
|
|
18933
|
-
const
|
|
19033
|
+
const extraEnv = {
|
|
19034
|
+
[ENABLE_TOOL_SEARCH_ENV]: "true",
|
|
19035
|
+
...opts.extraEnv
|
|
19036
|
+
};
|
|
19037
|
+
const defaults = {
|
|
19038
|
+
extraEnv,
|
|
19039
|
+
...opts.modelMapping ? { modelMapping: opts.modelMapping } : {}
|
|
19040
|
+
};
|
|
18934
19041
|
return { id: opts.id ?? "anthropic", baseUrl, protocols: ["anthropic-messages"], defaults, models: opts.models };
|
|
18935
19042
|
}
|
|
18936
19043
|
function openaiChat(baseUrl, opts = {}) {
|
|
@@ -18941,6 +19048,7 @@ var XIAOMI_MODELS, BAILIAN_CODING_PLAN_MODELS, BAILIAN_TOKEN_PLAN_MODELS, BAILIA
|
|
|
18941
19048
|
var init_builtin = __esm({
|
|
18942
19049
|
"../../packages/shared/src/platform-registry/builtin.ts"() {
|
|
18943
19050
|
"use strict";
|
|
19051
|
+
init_effective_endpoints();
|
|
18944
19052
|
init_protocols();
|
|
18945
19053
|
XIAOMI_MODELS = {
|
|
18946
19054
|
default: { id: "mimo-v2.5-pro", name: "MiMo V2.5 Pro" },
|
|
@@ -19897,6 +20005,7 @@ var init_platform_registry = __esm({
|
|
|
19897
20005
|
init_capabilities2();
|
|
19898
20006
|
init_merge();
|
|
19899
20007
|
init_relay_discovery();
|
|
20008
|
+
init_relay_identify();
|
|
19900
20009
|
init_effective_endpoints();
|
|
19901
20010
|
init_builtin();
|
|
19902
20011
|
}
|
|
@@ -61410,8 +61519,8 @@ import { fileURLToPath } from "node:url";
|
|
|
61410
61519
|
function resolveCliReleaseVersion() {
|
|
61411
61520
|
const fromEnv = process.env.SUPERONE_CLI_VERSION?.trim();
|
|
61412
61521
|
if (fromEnv) return fromEnv;
|
|
61413
|
-
if ("0.53.
|
|
61414
|
-
return "0.53.
|
|
61522
|
+
if ("0.53.11-alpha".trim()) {
|
|
61523
|
+
return "0.53.11-alpha".trim();
|
|
61415
61524
|
}
|
|
61416
61525
|
const fromDist = readDistManifestVersion();
|
|
61417
61526
|
if (fromDist) return fromDist;
|
|
@@ -66987,7 +67096,8 @@ function handleSessionList(payload, ctx) {
|
|
|
66987
67096
|
isAutomation: s2.isAutomation === true,
|
|
66988
67097
|
automationId: s2.automationId ?? null,
|
|
66989
67098
|
providerResume,
|
|
66990
|
-
...providerSessionId ? { providerSessionId } : {}
|
|
67099
|
+
...providerSessionId ? { providerSessionId } : {},
|
|
67100
|
+
tags: Array.isArray(s2.tags) ? s2.tags : []
|
|
66991
67101
|
};
|
|
66992
67102
|
})
|
|
66993
67103
|
};
|
package/package.json
CHANGED