@ouro.bot/cli 0.1.0-alpha.1105 → 0.1.0-alpha.1107
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/attachments/downloaded-store.js +7 -2
- package/dist/heart/attachments/originals.js +14 -0
- package/dist/heart/attachments/sources/bluebubbles.js +2 -3
- package/dist/repertoire/tools-surface.js +5 -1
- package/dist/senses/bluebubbles/attachment-download.js +9 -3
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
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.1107",
|
|
6
|
+
"changes": [
|
|
7
|
+
"iMessage stops downloading a file as soon as it passes the size limit, keeps originals with an atomic write, and names voice notes and clips by their format."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"version": "0.1.0-alpha.1106",
|
|
12
|
+
"changes": [
|
|
13
|
+
"When a surface send to Teams fails, the result now says the send failed and delivery is not confirmed, instead of reading like a plain queue. The message is still queued for the next Teams message, as before."
|
|
14
|
+
]
|
|
15
|
+
},
|
|
4
16
|
{
|
|
5
17
|
"version": "0.1.0-alpha.1105",
|
|
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.1107</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -33,6 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.DownloadTooLargeError = void 0;
|
|
36
37
|
exports.readBoundedResponse = readBoundedResponse;
|
|
37
38
|
exports.storeDownloadedAttachment = storeDownloadedAttachment;
|
|
38
39
|
const path = __importStar(require("node:path"));
|
|
@@ -42,10 +43,14 @@ const store_1 = require("./store");
|
|
|
42
43
|
const originals_1 = require("./originals");
|
|
43
44
|
const downloaded_1 = require("./sources/downloaded");
|
|
44
45
|
// Download and keep an inbound file the same way for every sense: read no more than the limit, write it atomically, remember it.
|
|
46
|
+
/** The file is bigger than the sense may keep. Other download failures stay plain errors. */
|
|
47
|
+
class DownloadTooLargeError extends Error {
|
|
48
|
+
}
|
|
49
|
+
exports.DownloadTooLargeError = DownloadTooLargeError;
|
|
45
50
|
async function readBoundedResponse(response, limit) {
|
|
46
51
|
const advertised = Number(response.headers.get("content-length"));
|
|
47
52
|
if (Number.isFinite(advertised) && advertised > limit)
|
|
48
|
-
throw new
|
|
53
|
+
throw new DownloadTooLargeError("advertised size exceeds limit");
|
|
49
54
|
if (!response.body)
|
|
50
55
|
throw new Error("empty response body");
|
|
51
56
|
const chunks = [];
|
|
@@ -58,7 +63,7 @@ async function readBoundedResponse(response, limit) {
|
|
|
58
63
|
break;
|
|
59
64
|
total += value.byteLength;
|
|
60
65
|
if (total > limit)
|
|
61
|
-
throw new
|
|
66
|
+
throw new DownloadTooLargeError("download exceeds limit");
|
|
62
67
|
chunks.push(value);
|
|
63
68
|
}
|
|
64
69
|
}
|
|
@@ -67,7 +67,21 @@ function extensionForAttachment(displayName, mimeType) {
|
|
|
67
67
|
case "audio/mpeg":
|
|
68
68
|
return ".mp3";
|
|
69
69
|
case "audio/mp4":
|
|
70
|
+
case "audio/x-m4a":
|
|
70
71
|
return ".m4a";
|
|
72
|
+
case "audio/ogg":
|
|
73
|
+
return ".ogg";
|
|
74
|
+
case "audio/wav":
|
|
75
|
+
case "audio/x-wav":
|
|
76
|
+
return ".wav";
|
|
77
|
+
case "audio/x-caf":
|
|
78
|
+
return ".caf";
|
|
79
|
+
case "audio/aac":
|
|
80
|
+
return ".aac";
|
|
81
|
+
case "video/mp4":
|
|
82
|
+
return ".mp4";
|
|
83
|
+
case "video/quicktime":
|
|
84
|
+
return ".mov";
|
|
71
85
|
default:
|
|
72
86
|
return "";
|
|
73
87
|
}
|
|
@@ -36,7 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.blueBubblesAttachmentSourceAdapter = void 0;
|
|
37
37
|
exports.buildBlueBubblesAttachmentRecord = buildBlueBubblesAttachmentRecord;
|
|
38
38
|
exports.persistBlueBubblesAttachmentSource = persistBlueBubblesAttachmentSource;
|
|
39
|
-
const
|
|
39
|
+
const atomic_file_1 = require("../../atomic-file");
|
|
40
40
|
const path = __importStar(require("node:path"));
|
|
41
41
|
const runtime_1 = require("../../../nerves/runtime");
|
|
42
42
|
const attachment_download_1 = require("../../../senses/bluebubbles/attachment-download");
|
|
@@ -97,8 +97,7 @@ function buildBlueBubblesAttachmentRecord(summary, now = Date.now(), options = {
|
|
|
97
97
|
async function persistBlueBubblesAttachmentSource(agentName, attachment, input, agentRoot = (0, identity_1.getAgentRoot)(agentName)) {
|
|
98
98
|
const normalizedAttachment = normalizeBlueBubblesRecord(attachment);
|
|
99
99
|
const targetPath = (0, originals_1.originalStoragePath)(agentRoot, normalizedAttachment, input.mimeType);
|
|
100
|
-
await
|
|
101
|
-
await fs.writeFile(targetPath, input.buffer);
|
|
100
|
+
await (0, atomic_file_1.writeFileAtomic)(targetPath, input.buffer);
|
|
102
101
|
const updated = buildBlueBubblesAttachmentRecord({
|
|
103
102
|
...normalizedAttachment.sourceData,
|
|
104
103
|
mimeType: input.mimeType ?? normalizedAttachment.sourceData.mimeType,
|
|
@@ -188,7 +188,11 @@ async function routeSurfaceToFriend(agentName, friendId, content, queueItem, hin
|
|
|
188
188
|
const sent = await sendTeamsOffTurn({ friendId: target.friendId, key: target.key, text: content, origin: "proactive" }, { agentRoot });
|
|
189
189
|
if (sent?.forwardedTo)
|
|
190
190
|
return { status: "queued", detail: `forwarded to ${sent.forwardedTo}, which runs Teams; it sends on its next sync` };
|
|
191
|
-
|
|
191
|
+
if (sent?.delivered)
|
|
192
|
+
return { status: "delivered", detail: "sent to Teams now" };
|
|
193
|
+
if (sent?.reason === "send_error")
|
|
194
|
+
return queueToSession(target, `Teams send failed, so delivery is not confirmed; saved ${detail}`);
|
|
195
|
+
return queueToSession(target, detail);
|
|
192
196
|
};
|
|
193
197
|
const deliverOrQueue = (target, detail) => target.channel === "telegram"
|
|
194
198
|
? deliverTelegramOrQueue(target, detail)
|
|
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.isBlueBubblesImageAttachment = isBlueBubblesImageAttachment;
|
|
37
37
|
exports.downloadBlueBubblesAttachment = downloadBlueBubblesAttachment;
|
|
38
|
+
const downloaded_store_1 = require("../../heart/attachments/downloaded-store");
|
|
38
39
|
const path = __importStar(require("node:path"));
|
|
39
40
|
const image_normalize_1 = require("../../heart/attachments/image-normalize");
|
|
40
41
|
const runtime_1 = require("../../nerves/runtime");
|
|
@@ -112,15 +113,20 @@ async function downloadBlueBubblesAttachment(attachment, config, channelConfig,
|
|
|
112
113
|
throw new Error(`HTTP ${response.status}`);
|
|
113
114
|
}
|
|
114
115
|
const contentType = inferContentType(attachment, response.headers.get("content-type"));
|
|
115
|
-
const buffer = Buffer.from(await response.arrayBuffer());
|
|
116
116
|
const actualLimit = maxDownloadBytesForAttachment(attachment, contentType);
|
|
117
|
-
|
|
117
|
+
let buffer;
|
|
118
|
+
try {
|
|
119
|
+
buffer = response.body ? await (0, downloaded_store_1.readBoundedResponse)(response, actualLimit) : Buffer.alloc(0);
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
if (!(error instanceof downloaded_store_1.DownloadTooLargeError))
|
|
123
|
+
throw error;
|
|
118
124
|
(0, runtime_1.emitNervesEvent)({
|
|
119
125
|
level: "warn",
|
|
120
126
|
component: "senses",
|
|
121
127
|
event: "senses.bluebubbles_attachment_download_error",
|
|
122
128
|
message: "bluebubbles attachment download failed",
|
|
123
|
-
meta: { attachmentGuid: guid, reason: "actual_limit_exceeded", actualLimit,
|
|
129
|
+
meta: { attachmentGuid: guid, reason: "actual_limit_exceeded", actualLimit, contentType: contentType ?? null },
|
|
124
130
|
});
|
|
125
131
|
throw new Error(`attachment exceeds ${actualLimit} byte limit`);
|
|
126
132
|
}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouro.bot/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.1107",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@ouro.bot/cli",
|
|
9
|
-
"version": "0.1.0-alpha.
|
|
9
|
+
"version": "0.1.0-alpha.1107",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.78.0",
|
|
12
12
|
"@ouro.bot/friends": "0.1.0-alpha.18",
|