@super-one/cli 0.76.0-alpha.1 → 0.76.0-alpha.2
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 +46 -7
- package/package.json +1 -1
package/MANIFEST.json
CHANGED
package/lib/cli.mjs
CHANGED
|
@@ -137,8 +137,8 @@ import { fileURLToPath } from "node:url";
|
|
|
137
137
|
function resolveCliReleaseVersion() {
|
|
138
138
|
const fromEnv = process.env.SUPERONE_CLI_VERSION?.trim();
|
|
139
139
|
if (fromEnv) return fromEnv;
|
|
140
|
-
if ("0.76.0-alpha.
|
|
141
|
-
return "0.76.0-alpha.
|
|
140
|
+
if ("0.76.0-alpha.2".trim()) {
|
|
141
|
+
return "0.76.0-alpha.2".trim();
|
|
142
142
|
}
|
|
143
143
|
const fromDist = readDistManifestVersion();
|
|
144
144
|
if (fromDist) return fromDist;
|
|
@@ -4336,7 +4336,7 @@ var init_host_action_device_descriptors = __esm({
|
|
|
4336
4336
|
"maximum": 9007199254740991
|
|
4337
4337
|
},
|
|
4338
4338
|
"hingeDegrees": {
|
|
4339
|
-
"description": "Required for kind=hinge. The angle picks the form: 0 closed,
|
|
4339
|
+
"description": "Required for kind=hinge. The angle picks the form: 0-30 closed on the cover, 31-60 tent (cover lit), 61-80 and 121-180 open on the inner screen, 81-120 laptop (inner screen, one half flat).",
|
|
4340
4340
|
"type": "number",
|
|
4341
4341
|
"minimum": 0,
|
|
4342
4342
|
"maximum": 180
|
|
@@ -17939,10 +17939,40 @@ var init_session_runtime = __esm({
|
|
|
17939
17939
|
return s5 ? this.clone(s5) : null;
|
|
17940
17940
|
}
|
|
17941
17941
|
list(projectId, options) {
|
|
17942
|
-
const
|
|
17942
|
+
const inProject = [...this.live.values()].filter((s5) => !projectId || s5.projectId === projectId);
|
|
17943
|
+
const byRecency = (a2, b5) => (b5.updatedAt ?? 0) - (a2.updatedAt ?? 0) || (b5.createdAt ?? 0) - (a2.createdAt ?? 0);
|
|
17944
|
+
const parentSessionId = options?.parentSessionId?.trim() || "";
|
|
17945
|
+
const childCounts = /* @__PURE__ */ new Map();
|
|
17946
|
+
let rows;
|
|
17947
|
+
if (parentSessionId) {
|
|
17948
|
+
rows = inProject.filter((s5) => s5.parentSessionId === parentSessionId && s5.isHidden !== true && s5.isSettled !== true);
|
|
17949
|
+
rows.sort(byRecency);
|
|
17950
|
+
} else if (options?.rootsOnly) {
|
|
17951
|
+
const familyUpdated = /* @__PURE__ */ new Map();
|
|
17952
|
+
for (const session of inProject) {
|
|
17953
|
+
if (session.parentSessionId && session.isHidden !== true && session.isSettled !== true) {
|
|
17954
|
+
childCounts.set(session.parentSessionId, (childCounts.get(session.parentSessionId) ?? 0) + 1);
|
|
17955
|
+
const ts2 = session.updatedAt ?? session.createdAt ?? 0;
|
|
17956
|
+
familyUpdated.set(session.parentSessionId, Math.max(familyUpdated.get(session.parentSessionId) ?? 0, ts2));
|
|
17957
|
+
}
|
|
17958
|
+
if (!session.parentSessionId) {
|
|
17959
|
+
const ts2 = session.updatedAt ?? session.createdAt ?? 0;
|
|
17960
|
+
familyUpdated.set(session.sessionId, Math.max(familyUpdated.get(session.sessionId) ?? 0, ts2));
|
|
17961
|
+
}
|
|
17962
|
+
}
|
|
17963
|
+
rows = inProject.filter((s5) => !s5.parentSessionId);
|
|
17964
|
+
rows.sort((a2, b5) => (familyUpdated.get(b5.sessionId) ?? 0) - (familyUpdated.get(a2.sessionId) ?? 0) || byRecency(a2, b5));
|
|
17965
|
+
} else {
|
|
17966
|
+
rows = inProject.sort(byRecency);
|
|
17967
|
+
}
|
|
17943
17968
|
const offset = Math.max(0, options?.offset ?? 0);
|
|
17944
17969
|
const limited = options?.limit != null && options.limit >= 0 ? rows.slice(offset, offset + options.limit) : offset > 0 ? rows.slice(offset) : rows;
|
|
17945
|
-
return limited.map((s5) =>
|
|
17970
|
+
return limited.map((s5) => {
|
|
17971
|
+
const cloned = this.clone(s5);
|
|
17972
|
+
const childCount = childCounts.get(s5.sessionId) ?? 0;
|
|
17973
|
+
if (childCount > 0) cloned.childCount = childCount;
|
|
17974
|
+
return cloned;
|
|
17975
|
+
});
|
|
17946
17976
|
}
|
|
17947
17977
|
snapshotSequence() {
|
|
17948
17978
|
return this.events.headSequence();
|
|
@@ -124182,7 +124212,9 @@ async function callOperation(payload, ctx, method) {
|
|
|
124182
124212
|
if (method === "session.rewind" && !["files", "conversation", "code+chat"].includes(String(p4.mode))) {
|
|
124183
124213
|
throw Object.assign(new Error("invalid rewind mode"), { code: "invalid_argument" });
|
|
124184
124214
|
}
|
|
124185
|
-
if (!ctx.sessions?.get(sessionId))
|
|
124215
|
+
if (method !== "session.scheduledSend.get" && !ctx.sessions?.get(sessionId)) {
|
|
124216
|
+
throw Object.assign(new Error("session not found"), { code: "not_found" });
|
|
124217
|
+
}
|
|
124186
124218
|
const leaseId = SESSION_OPERATION_READS.has(method) ? void 0 : requiredText(p4, "leaseId");
|
|
124187
124219
|
const generation = SESSION_OPERATION_READS.has(method) ? void 0 : requiredText(p4, "generation");
|
|
124188
124220
|
const assertControl2 = () => {
|
|
@@ -129086,6 +129118,7 @@ function mapSessionRow(s5) {
|
|
|
129086
129118
|
providerResume,
|
|
129087
129119
|
...providerSessionId ? { providerSessionId } : {},
|
|
129088
129120
|
...s5.parentSessionId ? { parentSessionId: s5.parentSessionId } : {},
|
|
129121
|
+
...typeof s5.childCount === "number" && s5.childCount > 0 ? { childCount: s5.childCount } : {},
|
|
129089
129122
|
...typeof s5.acpAgentId === "string" && s5.acpAgentId ? { acpAgentId: s5.acpAgentId } : {},
|
|
129090
129123
|
tags: Array.isArray(s5.tags) ? s5.tags : []
|
|
129091
129124
|
};
|
|
@@ -129103,7 +129136,13 @@ function handleSessionList(payload, ctx) {
|
|
|
129103
129136
|
}
|
|
129104
129137
|
const limit2 = Math.min(Math.max(Math.floor(p4.limit), 0), 500);
|
|
129105
129138
|
const offset = Math.max(Math.floor(p4.offset), 0);
|
|
129106
|
-
const
|
|
129139
|
+
const parentSessionId = typeof p4.parentSessionId === "string" ? p4.parentSessionId.trim() : "";
|
|
129140
|
+
const rows = ctx.sessions.list(projectId, {
|
|
129141
|
+
limit: limit2,
|
|
129142
|
+
offset,
|
|
129143
|
+
...p4.rootsOnly === true ? { rootsOnly: true } : {},
|
|
129144
|
+
...parentSessionId ? { parentSessionId } : {}
|
|
129145
|
+
});
|
|
129107
129146
|
return { result: rows.map(mapSessionRow) };
|
|
129108
129147
|
}
|
|
129109
129148
|
function handleSessionListPinned(payload, ctx) {
|
package/package.json
CHANGED