@skrr-ai/cli 0.1.39 → 0.1.40
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/base-command.js +8 -0
- package/dist/commands/agents/create.d.ts +7 -0
- package/dist/commands/agents/create.js +13 -1
- package/dist/commands/agents/triggers/policy.d.ts +1 -0
- package/dist/commands/agents/triggers/policy.js +32 -0
- package/dist/commands/agents/update.js +4 -3
- package/dist/commands/followups/observability.js +6 -2
- package/dist/commands/followups/remind.js +5 -2
- package/dist/commands/followups/reschedule.js +2 -1
- package/dist/commands/followups/show.js +4 -0
- package/dist/commands/followups/watch.d.ts +1 -0
- package/dist/commands/followups/watch.js +9 -3
- package/dist/commands/tasks/lifecycle/detach.js +26 -5
- package/dist/lib/dedicated-lease-command.js +4 -1
- package/dist/lib/dedicated-machines.d.ts +8 -1
- package/dist/lib/dedicated-machines.js +22 -6
- package/dist/lib/dedicated-wait.js +13 -0
- package/dist/lib/followups.d.ts +8 -0
- package/dist/lib/label-ref.d.ts +8 -1
- package/dist/lib/label-ref.js +12 -2
- package/dist/lib/option-hint.d.ts +15 -0
- package/dist/lib/option-hint.js +75 -0
- package/dist/lib/workspaces.d.ts +3 -0
- package/dist/lib/workspaces.js +38 -0
- package/oclif.manifest.json +26312 -26304
- package/package.json +5 -3
package/dist/lib/workspaces.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.describeUnselectedWorkspace = describeUnselectedWorkspace;
|
|
4
4
|
exports.listWorkspaces = listWorkspaces;
|
|
5
|
+
exports.ambientWorkspaceId = ambientWorkspaceId;
|
|
6
|
+
exports.clearAmbientWorkspaceCache = clearAmbientWorkspaceCache;
|
|
5
7
|
exports.listWorkspaceListing = listWorkspaceListing;
|
|
6
8
|
exports.getWorkspace = getWorkspace;
|
|
7
9
|
exports.matchWorkspace = matchWorkspace;
|
|
@@ -60,6 +62,42 @@ function describeUnselectedWorkspace(listing) {
|
|
|
60
62
|
async function listWorkspaces() {
|
|
61
63
|
return (await listWorkspaceListing()).rows;
|
|
62
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* The workspace a bare session actually writes to, for callers merging the
|
|
67
|
+
* caller's vocabulary or defaults across scopes.
|
|
68
|
+
*
|
|
69
|
+
* `OVERSKY_WORKSPACE_ID` is only populated when a workspace was SELECTED —
|
|
70
|
+
* `workspaces use`, `--workspace`, or a daemon session handoff. An account
|
|
71
|
+
* that never selected one still has a server-side `defaultWorkspaceId`, and
|
|
72
|
+
* every unscoped write lands there; a caller that only read the variable
|
|
73
|
+
* would reason about a smaller world than the one the server writes into
|
|
74
|
+
* (observed: `labels list` reported a user-only vocabulary while three
|
|
75
|
+
* workspace-scoped labels existed and were attachable).
|
|
76
|
+
*
|
|
77
|
+
* The listing fetch is memoized and fail-open: this runs to give a better
|
|
78
|
+
* answer, and must never become the error — an unreachable server returns
|
|
79
|
+
* `undefined`, which is the same world the caller saw before this existed.
|
|
80
|
+
*/
|
|
81
|
+
let memoizedDefaultWorkspaceId;
|
|
82
|
+
async function ambientWorkspaceId(env = process.env) {
|
|
83
|
+
const explicit = env.OVERSKY_WORKSPACE_ID?.trim();
|
|
84
|
+
if (explicit)
|
|
85
|
+
return explicit;
|
|
86
|
+
if (memoizedDefaultWorkspaceId !== undefined) {
|
|
87
|
+
return memoizedDefaultWorkspaceId ?? undefined;
|
|
88
|
+
}
|
|
89
|
+
try {
|
|
90
|
+
memoizedDefaultWorkspaceId = (await listWorkspaceListing()).defaultWorkspaceId ?? null;
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
memoizedDefaultWorkspaceId = null;
|
|
94
|
+
}
|
|
95
|
+
return memoizedDefaultWorkspaceId ?? undefined;
|
|
96
|
+
}
|
|
97
|
+
/** Test seam — a memoized network result must not leak between specs. */
|
|
98
|
+
function clearAmbientWorkspaceCache() {
|
|
99
|
+
memoizedDefaultWorkspaceId = undefined;
|
|
100
|
+
}
|
|
63
101
|
/** `listWorkspaces`, keeping the envelope's caller-level fields. */
|
|
64
102
|
async function listWorkspaceListing() {
|
|
65
103
|
const rows = [];
|