@ouro.bot/cli 0.1.0-alpha.1145 → 0.1.0-alpha.1147
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/changelog.json +12 -0
- package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
- package/deploy/unraid/sanctuary.xml +1 -1
- package/dist/heart/daemon/cli-defaults.js +16 -25
- package/dist/heart/shepherd/operations.js +1 -1
- package/dist/heart/shepherd-config.js +3 -13
- package/dist/heart/versioning/release-sources.js +15 -3
- package/dist/repertoire/guardrails.js +4 -1
- package/dist/repertoire/tools-app-sessions.js +82 -315
- package/dist/senses/app-sessions/app-interface.js +317 -0
- package/dist/senses/app-sessions/client.js +86 -250
- package/dist/senses/app-sessions/prompts.js +101 -0
- package/dist/senses/app-sessions/sense.js +13 -9
- package/dist/senses/app-sessions/size-watch.js +3 -2
- package/dist/senses/app-sessions/store.js +12 -2
- package/dist/senses/app-sessions/waiting-prompts.js +1 -5
- package/dist/senses/app-sessions/wake-runner.js +2 -1
- package/dist/senses/shepherd/host.js +0 -3
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/senses/shepherd/copilot-app-holds.js +0 -138
- package/dist/senses/shepherd/copilot-app.js +0 -676
package/changelog.json
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.1147",
|
|
6
|
+
"changes": [
|
|
7
|
+
"`ouro up` and `ouro up --latest` now find and install a new release from the GitHub release when npm is blocked on your network or its feed lags behind, instead of skipping the update with \"registry unavailable\". They ask npmjs, your configured npm feed and GitHub, and install from whichever serves the newest version, and say which sources failed when none answers."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"version": "0.1.0-alpha.1146",
|
|
12
|
+
"changes": [
|
|
13
|
+
"The app-sessions tools are now the GitHub Copilot app's own client tools (list_sessions_and_chats, get_sessions_status, get_session, send_session_message, create_session, answer_session_input, respond_to_session_plan_v2, archive_session, navigate_to, save_session_automation, get_session_automation, list_workflows, run_workflow), sent over the app's local WebSocket as the app's sessions do, so Ouroboros coordinates sessions the way a coordinating session does. The shepherd's Copilot-app host, the app's database and repository-trust reads, and the old app_sessions_list/send/new/resume/archive/watch tools are gone."
|
|
14
|
+
]
|
|
15
|
+
},
|
|
4
16
|
{
|
|
5
17
|
"version": "0.1.0-alpha.1145",
|
|
6
18
|
"changes": [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0"?>
|
|
2
2
|
<Container version="2">
|
|
3
3
|
<Name>ouro-butler</Name>
|
|
4
|
-
<Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.
|
|
4
|
+
<Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1147</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -238,29 +238,8 @@ function defaultReadRecentDaemonLogLines(lines = 10) {
|
|
|
238
238
|
}
|
|
239
239
|
return recentLines.slice(-lines).map((line) => (0, log_tailer_1.formatLogLine)(line));
|
|
240
240
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
const controller = new AbortController();
|
|
244
|
-
const timeoutId = setTimeout(() => {
|
|
245
|
-
controller.abort();
|
|
246
|
-
}, timeoutMs);
|
|
247
|
-
try {
|
|
248
|
-
const res = await fetch("https://registry.npmjs.org/@ouro.bot/cli", {
|
|
249
|
-
signal: controller.signal,
|
|
250
|
-
});
|
|
251
|
-
return res.json();
|
|
252
|
-
}
|
|
253
|
-
catch (error) {
|
|
254
|
-
if (error instanceof Error && error.name === "AbortError") {
|
|
255
|
-
throw new Error(`update check timed out after ${Math.max(1, Math.round(timeoutMs / 1000))}s`);
|
|
256
|
-
}
|
|
257
|
-
throw error;
|
|
258
|
-
}
|
|
259
|
-
finally {
|
|
260
|
-
clearTimeout(timeoutId);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
/* v8 ignore stop */
|
|
241
|
+
/** The last release lookup the update check made, so an install tries the same sources. */
|
|
242
|
+
let lastReleaseLookup = null;
|
|
264
243
|
function defaultSleep(ms) {
|
|
265
244
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
266
245
|
}
|
|
@@ -878,16 +857,28 @@ function createDefaultOuroCliDeps(socketPath = socket_client_1.DEFAULT_DAEMON_SO
|
|
|
878
857
|
},
|
|
879
858
|
/* v8 ignore stop */
|
|
880
859
|
/* v8 ignore start -- CLI version management defaults: integration code @preserve */
|
|
860
|
+
// Ask npmjs, the configured npm registry and the signed GitHub release, so a
|
|
861
|
+
// blocked or lagging registry cannot hide a published release.
|
|
881
862
|
checkForCliUpdate: async () => {
|
|
882
863
|
const { checkForUpdate } = await Promise.resolve().then(() => __importStar(require("../versioning/update-checker")));
|
|
864
|
+
const { lookupLatestRelease, lookupAsRegistryJson } = await Promise.resolve().then(() => __importStar(require("../versioning/release-sources")));
|
|
865
|
+
const { releaseSourceDeps } = await Promise.resolve().then(() => __importStar(require("../versioning/self-update-defaults")));
|
|
883
866
|
return checkForUpdate((0, bundle_manifest_1.getPackageVersion)(), {
|
|
884
|
-
fetchRegistryJson: () =>
|
|
867
|
+
fetchRegistryJson: async () => {
|
|
868
|
+
lastReleaseLookup = await lookupLatestRelease({ ...releaseSourceDeps, lookupTimeoutMs: update_checker_1.CLI_UPDATE_CHECK_TIMEOUT_MS - 500 });
|
|
869
|
+
return lookupAsRegistryJson(lastReleaseLookup);
|
|
870
|
+
},
|
|
885
871
|
distTag: update_checker_1.CLI_UPDATE_DIST_TAG,
|
|
886
872
|
});
|
|
887
873
|
},
|
|
888
874
|
readVersionIntent: () => (0, version_intent_1.readVersionIntent)(),
|
|
889
875
|
writeVersionIntent: (intent) => (0, version_intent_1.writeVersionIntent)(intent),
|
|
890
|
-
installCliVersion: async (version) => {
|
|
876
|
+
installCliVersion: async (version) => {
|
|
877
|
+
const { lookupLatestRelease, installRelease } = await Promise.resolve().then(() => __importStar(require("../versioning/release-sources")));
|
|
878
|
+
const { releaseSourceDeps } = await Promise.resolve().then(() => __importStar(require("../versioning/self-update-defaults")));
|
|
879
|
+
const lookup = lastReleaseLookup ?? await lookupLatestRelease(releaseSourceDeps);
|
|
880
|
+
await installRelease(version, lookup, (0, ouro_version_manager_1.getOuroCliHome)(), releaseSourceDeps);
|
|
881
|
+
},
|
|
891
882
|
validateCliVersionForActivation: (version) => (0, ouro_version_manager_1.validateInstalledVersionForActivation)(version, {}),
|
|
892
883
|
activateCliVersion: (version) => {
|
|
893
884
|
(0, ouro_version_manager_1.activateVersion)(version, {});
|
|
@@ -89,7 +89,7 @@ function parseShepherdOperation(args) {
|
|
|
89
89
|
const common = { agent, ...(values.has("json") ? { json: true } : {}) };
|
|
90
90
|
const host = () => {
|
|
91
91
|
const value = required("host");
|
|
92
|
-
return value === "cmux" || value === "herdr"
|
|
92
|
+
return value === "cmux" || value === "herdr" ? value : fail();
|
|
93
93
|
};
|
|
94
94
|
if (operation === "status")
|
|
95
95
|
return { kind: "shepherd.status", ...common };
|
|
@@ -37,7 +37,6 @@ exports.shepherdRepairHint = shepherdRepairHint;
|
|
|
37
37
|
exports.shepherdConfigFacts = shepherdConfigFacts;
|
|
38
38
|
exports.shepherdSenseStatus = shepherdSenseStatus;
|
|
39
39
|
exports.defaultHerdrSocketPath = defaultHerdrSocketPath;
|
|
40
|
-
exports.defaultCopilotAppStateDir = defaultCopilotAppStateDir;
|
|
41
40
|
exports.defaultCmuxSocketPath = defaultCmuxSocketPath;
|
|
42
41
|
exports.resolveShepherdConnection = resolveShepherdConnection;
|
|
43
42
|
const fs = __importStar(require("node:fs"));
|
|
@@ -45,7 +44,7 @@ const os = __importStar(require("node:os"));
|
|
|
45
44
|
const path = __importStar(require("node:path"));
|
|
46
45
|
const runtime_1 = require("../nerves/runtime");
|
|
47
46
|
function shepherdRepairHint(agent) {
|
|
48
|
-
return `human-required:
|
|
47
|
+
return `human-required: in a cmux terminal run 'ouro vault config set --agent ${agent} --scope machine --key cmux.socketCapability --value "$CMUX_SOCKET_CAPABILITY"' (or set cmux.socketPassword when cmux is in password mode), then 'ouro up'. On Herdr instead: 'ouro vault config set --agent ${agent} --scope machine --key herdr.socketPath --value "$HOME/.config/herdr/herdr.sock"', then 'ouro up'.`;
|
|
49
48
|
}
|
|
50
49
|
function text(record, key) {
|
|
51
50
|
const value = record?.[key];
|
|
@@ -67,8 +66,6 @@ function cmuxAuth(cmux) {
|
|
|
67
66
|
return null;
|
|
68
67
|
}
|
|
69
68
|
function shepherdConfigFacts(machinePayload) {
|
|
70
|
-
if (hostRecord(machinePayload, "copilotApp"))
|
|
71
|
-
return { configured: true, detail: "GitHub Copilot app" };
|
|
72
69
|
const cmux = hostRecord(machinePayload, "cmux");
|
|
73
70
|
const auth = cmuxAuth(cmux);
|
|
74
71
|
if (!auth && hostRecord(machinePayload, "herdr"))
|
|
@@ -90,10 +87,6 @@ function shepherdSenseStatus(enabled, machinePayload) {
|
|
|
90
87
|
function defaultHerdrSocketPath(homeDir = os.homedir()) {
|
|
91
88
|
return path.join(homeDir, ".config", "herdr", "herdr.sock");
|
|
92
89
|
}
|
|
93
|
-
/** The Copilot app's state directory, where it writes `run/ws.port` and `run/ws.token`. */
|
|
94
|
-
function defaultCopilotAppStateDir(homeDir = os.homedir()) {
|
|
95
|
-
return path.join(homeDir, ".copilot");
|
|
96
|
-
}
|
|
97
90
|
/** cmux's own default: `~/.local/state/cmux/cmux-<uid>.sock`, then the older unscoped `cmux.sock`. */
|
|
98
91
|
function defaultCmuxSocketPath(homeDir = os.homedir(), uid = process.getuid?.() ?? 0, exists = fs.existsSync) {
|
|
99
92
|
const dir = path.join(homeDir, ".local", "state", "cmux");
|
|
@@ -104,17 +97,14 @@ function defaultCmuxSocketPath(homeDir = os.homedir(), uid = process.getuid?.()
|
|
|
104
97
|
function resolveShepherdConnection(agent, machinePayload, defaultSocketPath = defaultCmuxSocketPath) {
|
|
105
98
|
const cmux = hostRecord(machinePayload, "cmux");
|
|
106
99
|
const herdr = hostRecord(machinePayload, "herdr");
|
|
107
|
-
const copilotApp = hostRecord(machinePayload, "copilotApp");
|
|
108
100
|
const auth = cmuxAuth(cmux);
|
|
109
|
-
const host =
|
|
101
|
+
const host = auth ? "cmux" : herdr ? "herdr" : "none";
|
|
110
102
|
(0, runtime_1.emitNervesEvent)({
|
|
111
103
|
component: "senses",
|
|
112
104
|
event: "senses.shepherd_connection_resolved",
|
|
113
105
|
message: "resolved Shepherd terminal host connection settings",
|
|
114
|
-
meta: { agent, host, auth:
|
|
106
|
+
meta: { agent, host, auth: auth?.kind ?? "missing" },
|
|
115
107
|
});
|
|
116
|
-
if (copilotApp)
|
|
117
|
-
return { ok: true, connection: { host: "copilot-app", stateDir: text(copilotApp, "stateDir") || defaultCopilotAppStateDir() } };
|
|
118
108
|
if (auth)
|
|
119
109
|
return { ok: true, connection: { host: "cmux", socketPath: text(cmux, "socketPath") || defaultSocketPath(), auth } };
|
|
120
110
|
if (herdr)
|
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.GITHUB_RELEASE_PUBLISHER = exports.GITHUB_DOWNLOAD_BASE = exports.GITHUB_RELEASES_API = exports.NPMJS_REGISTRY = exports.CLI_PACKAGE = void 0;
|
|
37
37
|
exports.selfUpdateE2eOverrides = selfUpdateE2eOverrides;
|
|
38
38
|
exports.githubTarballName = githubTarballName;
|
|
39
|
+
exports.lookupAsRegistryJson = lookupAsRegistryJson;
|
|
39
40
|
exports.lookupLatestRelease = lookupLatestRelease;
|
|
40
41
|
exports.installRelease = installRelease;
|
|
41
42
|
const path = __importStar(require("path"));
|
|
@@ -69,14 +70,14 @@ function message(error) {
|
|
|
69
70
|
return error instanceof Error ? error.message : String(error);
|
|
70
71
|
}
|
|
71
72
|
async function askNpmjs(deps) {
|
|
72
|
-
const body = await deps.fetchJson(`${exports.NPMJS_REGISTRY}${exports.CLI_PACKAGE.replace("/", "%2f")}`, LOOKUP_TIMEOUT_MS);
|
|
73
|
+
const body = await deps.fetchJson(`${exports.NPMJS_REGISTRY}${exports.CLI_PACKAGE.replace("/", "%2f")}`, deps.lookupTimeoutMs ?? LOOKUP_TIMEOUT_MS);
|
|
73
74
|
const version = body?.["dist-tags"]?.latest;
|
|
74
75
|
if (typeof version !== "string")
|
|
75
76
|
throw new Error("registry response has no latest dist-tag");
|
|
76
77
|
return { source: "npmjs", version };
|
|
77
78
|
}
|
|
78
79
|
async function askConfiguredRegistry(deps) {
|
|
79
|
-
const stdout = await deps.execFile("npm", ["view", exports.CLI_PACKAGE, "dist-tags.latest", "--json"], { timeoutMs: LOOKUP_TIMEOUT_MS });
|
|
80
|
+
const stdout = await deps.execFile("npm", ["view", exports.CLI_PACKAGE, "dist-tags.latest", "--json"], { timeoutMs: deps.lookupTimeoutMs ?? LOOKUP_TIMEOUT_MS });
|
|
80
81
|
const version = JSON.parse(stdout.trim());
|
|
81
82
|
if (typeof version !== "string")
|
|
82
83
|
throw new Error("npm view returned no latest dist-tag");
|
|
@@ -84,7 +85,7 @@ async function askConfiguredRegistry(deps) {
|
|
|
84
85
|
}
|
|
85
86
|
async function askGithub(deps) {
|
|
86
87
|
const github = deps.github ?? { apiUrl: exports.GITHUB_RELEASES_API, downloadBase: exports.GITHUB_DOWNLOAD_BASE };
|
|
87
|
-
const releases = await deps.fetchJson(github.apiUrl, LOOKUP_TIMEOUT_MS);
|
|
88
|
+
const releases = await deps.fetchJson(github.apiUrl, deps.lookupTimeoutMs ?? LOOKUP_TIMEOUT_MS);
|
|
88
89
|
if (!Array.isArray(releases))
|
|
89
90
|
throw new Error("GitHub releases response is not a list");
|
|
90
91
|
let best = null;
|
|
@@ -110,6 +111,17 @@ async function askGithub(deps) {
|
|
|
110
111
|
throw new Error(`no GitHub release published by ${exports.GITHUB_RELEASE_PUBLISHER} carries an npm tarball`);
|
|
111
112
|
return best;
|
|
112
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* The update check reads a registry-shaped document. When no source answered,
|
|
116
|
+
* say so in words the `ouro up` phase summary maps to "registry unavailable".
|
|
117
|
+
*/
|
|
118
|
+
function lookupAsRegistryJson(lookup) {
|
|
119
|
+
if (!lookup.latestVersion) {
|
|
120
|
+
const detail = lookup.answers.map((answer) => `${answer.source}: ${answer.error}`).join("; ");
|
|
121
|
+
throw new Error(`registry unavailable (${detail})`);
|
|
122
|
+
}
|
|
123
|
+
return { "dist-tags": { latest: lookup.latestVersion } };
|
|
124
|
+
}
|
|
113
125
|
async function lookupLatestRelease(deps) {
|
|
114
126
|
const asks = [
|
|
115
127
|
["npmjs", () => askNpmjs(deps)],
|
|
@@ -424,7 +424,10 @@ const COMMERCE_AUTHORITY_TOOLS = new Set(["stripe_create_card", "flight_hold", "
|
|
|
424
424
|
// A call with no known trust level fails closed.
|
|
425
425
|
const SHEPHERD_FAMILY_TOOLS = new Set(["shepherd_overview", "shepherd_read", "shepherd_signal", "shepherd_send"]);
|
|
426
426
|
// The app-sessions tools read and write the owner's Copilot app sessions on this machine: family only, as Shepherd's.
|
|
427
|
-
const APP_SESSIONS_FAMILY_TOOLS = new Set([
|
|
427
|
+
const APP_SESSIONS_FAMILY_TOOLS = new Set([
|
|
428
|
+
"list_sessions_and_chats", "get_sessions_status", "get_session", "send_session_message", "create_session", "answer_session_input", "respond_to_session_plan_v2", "archive_session",
|
|
429
|
+
"navigate_to", "save_session_automation", "get_session_automation", "list_workflows", "run_workflow", "app_sessions_tail", "app_sessions_restart", "app_sessions_digest",
|
|
430
|
+
]);
|
|
428
431
|
const MAIL_FAMILY_TOOLS = new Set(["mail_screener", "mail_decide", "mail_access_log", "mail_send", "mail_index_refresh"]);
|
|
429
432
|
const MAIL_DELEGATED_READ_TOOLS = new Set(["mail_recent", "mail_search"]);
|
|
430
433
|
function opaqueAnsiShellAtoms(command) {
|