@sellable/install 0.1.650 → 0.1.651
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/container/Dockerfile +4 -4
- package/container/README.md +1 -1
- package/lib/sellable-agent/fly-customer-image/Dockerfile +1 -1
- package/lib/sellable-agent/fly-customer-image/customer-runtime.mjs +1 -1
- package/lib/sellable-agent/hermes-bridge.mjs +159 -1
- package/lib/sellable-agent/host-bootstrap.mjs +1 -1
- package/lib/sellable-agent/host-worker.mjs +1 -1
- package/lib/sellable-agent/profile-materializer.mjs +1 -1
- package/lib/sellable-agent/provisioning-adapter.mjs +1 -1
- package/package.json +1 -1
package/container/Dockerfile
CHANGED
|
@@ -3,12 +3,12 @@ FROM ${HERMES_IMAGE}
|
|
|
3
3
|
|
|
4
4
|
USER root
|
|
5
5
|
|
|
6
|
-
ARG INSTALLER_PACKAGE=@sellable/install@0.1.
|
|
6
|
+
ARG INSTALLER_PACKAGE=@sellable/install@0.1.651
|
|
7
7
|
ARG MCP_PACKAGE=@sellable/mcp@0.1.880
|
|
8
8
|
ARG INSTALLER_INTEGRITY
|
|
9
9
|
ARG MCP_INTEGRITY=sha512-+Fo8aQlYduLaQMQff+ZA25LeUhWZ7I7UH5DECpND84LQ+rHSjKeKFj4Zs93bVHXwQCIy2OLbr75y4f4+CyT57w==
|
|
10
10
|
|
|
11
|
-
RUN test "${INSTALLER_PACKAGE}" = "@sellable/install@0.1.
|
|
11
|
+
RUN test "${INSTALLER_PACKAGE}" = "@sellable/install@0.1.651" \
|
|
12
12
|
&& test "${MCP_PACKAGE}" = "@sellable/mcp@0.1.880" \
|
|
13
13
|
&& test -n "${INSTALLER_INTEGRITY}" \
|
|
14
14
|
&& test "$(npm view "${INSTALLER_PACKAGE}" dist.integrity)" = "${INSTALLER_INTEGRITY}" \
|
|
@@ -23,9 +23,9 @@ RUN test "${INSTALLER_PACKAGE}" = "@sellable/install@0.1.650" \
|
|
|
23
23
|
&& mkdir -p /opt/sellable-agent/install-root /opt/sellable-agent/mcp-root \
|
|
24
24
|
&& npm install --prefix /opt/sellable-agent/install-root --omit=dev --ignore-scripts --no-audit --no-fund "${INSTALLER_PACKAGE}" \
|
|
25
25
|
&& npm install --prefix /opt/sellable-agent/mcp-root --omit=dev --ignore-scripts --no-audit --no-fund "${MCP_PACKAGE}" \
|
|
26
|
-
&& node --input-type=module -e "import { readFileSync } from 'node:fs'; const install = JSON.parse(readFileSync('/opt/sellable-agent/install-root/node_modules/@sellable/install/package.json')); const mcp = JSON.parse(readFileSync('/opt/sellable-agent/mcp-root/node_modules/@sellable/mcp/package.json')); if (install.name !== '@sellable/install' || install.version !== '0.1.
|
|
26
|
+
&& node --input-type=module -e "import { readFileSync } from 'node:fs'; const install = JSON.parse(readFileSync('/opt/sellable-agent/install-root/node_modules/@sellable/install/package.json')); const mcp = JSON.parse(readFileSync('/opt/sellable-agent/mcp-root/node_modules/@sellable/mcp/package.json')); if (install.name !== '@sellable/install' || install.version !== '0.1.651' || mcp.name !== '@sellable/mcp' || mcp.version !== '0.1.880') throw new Error('package identity rejected');" \
|
|
27
27
|
&& node --input-type=module -e "import { buildExternalRuntimeClosure } from '/opt/sellable-agent/install-root/node_modules/@sellable/install/lib/sellable-agent/external-runtime-builder.mjs'; const built = buildExternalRuntimeClosure({ mcpPackageRoot: '/opt/sellable-agent/mcp-root/node_modules/@sellable/mcp', mcpNodeModulesRoot: '/opt/sellable-agent/mcp-root/node_modules', hermesSourceRoot: '/opt/hermes', ownerUid: 0, ownerGid: 0 }); if (!built.closureDigest) throw new Error('runtime closure rejected');" \
|
|
28
|
-
&& node --input-type=module -e "import { chmodSync, writeFileSync } from 'node:fs'; const release = { installerPackage: '@sellable/install@0.1.
|
|
28
|
+
&& node --input-type=module -e "import { chmodSync, writeFileSync } from 'node:fs'; const release = { installerPackage: '@sellable/install@0.1.651', installerIntegrity: process.argv[1], mcpPackage: '@sellable/mcp@0.1.880', mcpIntegrity: process.argv[2] }; writeFileSync('/opt/sellable-agent/release.json', JSON.stringify(release) + '\\n', { mode: 0o444 }); chmodSync('/opt/sellable-agent/release.json', 0o444);" "${INSTALLER_INTEGRITY}" "${MCP_INTEGRITY}" \
|
|
29
29
|
&& npm cache clean --force
|
|
30
30
|
|
|
31
31
|
COPY entrypoint.sh /usr/local/bin/sellable-agent-container-entrypoint
|
package/container/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
This image is a dedicated Agent worker/runtime boundary beside an existing Hermes dashboard. It never replaces or reconfigures the dashboard container.
|
|
4
4
|
|
|
5
5
|
Build from this directory after
|
|
6
|
-
`@sellable/install@0.1.
|
|
6
|
+
`@sellable/install@0.1.651` is
|
|
7
7
|
published:
|
|
8
8
|
|
|
9
9
|
```sh
|
|
@@ -8,7 +8,7 @@ ENV PLAYWRIGHT_BROWSERS_PATH=/opt/hermes/.playwright
|
|
|
8
8
|
|
|
9
9
|
ARG MCP_PACKAGE=@sellable/mcp@0.1.880
|
|
10
10
|
ARG MCP_INTEGRITY=sha512-+Fo8aQlYduLaQMQff+ZA25LeUhWZ7I7UH5DECpND84LQ+rHSjKeKFj4Zs93bVHXwQCIy2OLbr75y4f4+CyT57w==
|
|
11
|
-
ARG INSTALLER_PACKAGE=@sellable/install@0.1.
|
|
11
|
+
ARG INSTALLER_PACKAGE=@sellable/install@0.1.651
|
|
12
12
|
ARG ADMIN_MCP_PACKAGE=@sellable/admin-mcp@0.1.186-wip.phase158.20260802034727
|
|
13
13
|
ARG ADMIN_MCP_INTEGRITY=sha512-qYNew5wd2IfgVcp1UYOG9QvpF/8Mx19YJ5HQtMKzvSfUf3evePjtaKsoXLf2C/GUJ5QlLlHJo84VWOI3V01+9A==
|
|
14
14
|
ARG TUS_JS_CLIENT_VERSION=4.3.1
|
|
@@ -105,7 +105,7 @@ const BOOT_SESSION_ID = randomUUID();
|
|
|
105
105
|
const HERMES_VERSION = process.env.SELLABLE_AGENT_HERMES_VERSION ?? "0.20.0";
|
|
106
106
|
const INSTALLER_PACKAGE =
|
|
107
107
|
process.env.SELLABLE_AGENT_INSTALLER_PACKAGE ??
|
|
108
|
-
"@sellable/install@0.1.
|
|
108
|
+
"@sellable/install@0.1.651";
|
|
109
109
|
const MCP_PACKAGE =
|
|
110
110
|
process.env.SELLABLE_AGENT_MCP_PACKAGE ?? "@sellable/mcp@0.1.880";
|
|
111
111
|
const DEFAULT_PROFILE_BUNDLE_ROOT =
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
1
|
+
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
|
2
2
|
import {
|
|
3
3
|
closeSync,
|
|
4
4
|
constants,
|
|
@@ -18,11 +18,169 @@ import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
|
18
18
|
|
|
19
19
|
export const HERMES_AGENT_BRIDGE_ID = "sellable-agent-hermes-bridge/v1";
|
|
20
20
|
export const HERMES_AGENT_BRIDGE_MARKER = "SELLABLE_AGENT_HERMES_BRIDGE_V1";
|
|
21
|
+
export const HERMES_DEVELOPER_SLACK_METADATA_CONTRACT =
|
|
22
|
+
"hermes-developer-native-slack-metadata/v1";
|
|
23
|
+
|
|
24
|
+
const HERMES_DEVELOPER_NATIVE_SOURCE = "hermes-developer-node-socket-mode/v1";
|
|
25
|
+
const HERMES_DEVELOPER_EVENT_TYPES = new Set([
|
|
26
|
+
"app_mention",
|
|
27
|
+
"message",
|
|
28
|
+
"interactive",
|
|
29
|
+
]);
|
|
30
|
+
const HERMES_DEVELOPER_EVENT_SUBTYPES = new Set([
|
|
31
|
+
"",
|
|
32
|
+
"message_changed",
|
|
33
|
+
"message_deleted",
|
|
34
|
+
"unsupported",
|
|
35
|
+
]);
|
|
36
|
+
const HERMES_DEVELOPER_SLACK_ID = /^[A-Z][A-Z0-9]{8,31}$/;
|
|
37
|
+
const HERMES_DEVELOPER_SLACK_TS = /^\d{1,16}\.\d{6}$/;
|
|
38
|
+
const HERMES_DEVELOPER_EVENT_ID = /^[A-Za-z0-9_.:-]{1,128}$/;
|
|
21
39
|
|
|
22
40
|
const sha256 = (value) => createHash("sha256").update(value).digest("hex");
|
|
23
41
|
const isSha256 = (value) =>
|
|
24
42
|
typeof value === "string" && /^[a-f0-9]{64}$/.test(value);
|
|
25
43
|
|
|
44
|
+
function canonicalHermesDeveloperMetadata(value) {
|
|
45
|
+
if (Array.isArray(value)) return value.map(canonicalHermesDeveloperMetadata);
|
|
46
|
+
if (value && typeof value === "object") {
|
|
47
|
+
return Object.fromEntries(
|
|
48
|
+
Object.keys(value)
|
|
49
|
+
.sort()
|
|
50
|
+
.map((key) => [key, canonicalHermesDeveloperMetadata(value[key])])
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function exactHermesDeveloperMetadataKeys(value, expected) {
|
|
57
|
+
return (
|
|
58
|
+
value &&
|
|
59
|
+
typeof value === "object" &&
|
|
60
|
+
!Array.isArray(value) &&
|
|
61
|
+
Object.keys(value).sort().join("\0") === [...expected].sort().join("\0")
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Seal identity copied by the repo-owned Socket Mode receiver before any
|
|
67
|
+
* planner or worker execution. This deliberately has no text or tool
|
|
68
|
+
* arguments: downstream code cannot select a Slack principal, route, event or
|
|
69
|
+
* acknowledgement contract.
|
|
70
|
+
*/
|
|
71
|
+
export function createHermesDeveloperTrustedSlackMetadata(
|
|
72
|
+
input,
|
|
73
|
+
authenticationKey
|
|
74
|
+
) {
|
|
75
|
+
if (!Buffer.isBuffer(authenticationKey) || authenticationKey.length < 32) {
|
|
76
|
+
throw new HermesAgentBridgeError(
|
|
77
|
+
"HERMES_DEVELOPER_SLACK_METADATA_KEY_REQUIRED",
|
|
78
|
+
"Hermes developer Slack metadata requires a gateway-private authentication key"
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
const keys = [
|
|
82
|
+
"source",
|
|
83
|
+
"teamId",
|
|
84
|
+
"channelId",
|
|
85
|
+
"actorId",
|
|
86
|
+
"eventId",
|
|
87
|
+
"eventType",
|
|
88
|
+
"eventSubtype",
|
|
89
|
+
"messageTs",
|
|
90
|
+
"threadTs",
|
|
91
|
+
"botId",
|
|
92
|
+
"ackCapability",
|
|
93
|
+
"adapterGeneration",
|
|
94
|
+
];
|
|
95
|
+
if (
|
|
96
|
+
!exactHermesDeveloperMetadataKeys(input, keys) ||
|
|
97
|
+
input.source !== HERMES_DEVELOPER_NATIVE_SOURCE ||
|
|
98
|
+
!HERMES_DEVELOPER_SLACK_ID.test(input.teamId ?? "") ||
|
|
99
|
+
!HERMES_DEVELOPER_SLACK_ID.test(input.channelId ?? "") ||
|
|
100
|
+
!HERMES_DEVELOPER_SLACK_ID.test(input.actorId ?? "") ||
|
|
101
|
+
!HERMES_DEVELOPER_EVENT_ID.test(input.eventId ?? "") ||
|
|
102
|
+
!HERMES_DEVELOPER_EVENT_TYPES.has(input.eventType) ||
|
|
103
|
+
!HERMES_DEVELOPER_EVENT_SUBTYPES.has(input.eventSubtype ?? "") ||
|
|
104
|
+
!HERMES_DEVELOPER_SLACK_TS.test(input.messageTs ?? "") ||
|
|
105
|
+
(input.threadTs !== null &&
|
|
106
|
+
!HERMES_DEVELOPER_SLACK_TS.test(input.threadTs ?? "")) ||
|
|
107
|
+
(input.botId !== null &&
|
|
108
|
+
!HERMES_DEVELOPER_SLACK_ID.test(input.botId ?? "")) ||
|
|
109
|
+
input.ackCapability !== "defer_until_durable_intake" ||
|
|
110
|
+
!Number.isSafeInteger(input.adapterGeneration) ||
|
|
111
|
+
input.adapterGeneration < 1
|
|
112
|
+
) {
|
|
113
|
+
throw new HermesAgentBridgeError(
|
|
114
|
+
"HERMES_DEVELOPER_SLACK_METADATA_REJECTED",
|
|
115
|
+
"Hermes developer Slack metadata must come from the deferred-ack repo-owned receiver"
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
const body = canonicalHermesDeveloperMetadata({
|
|
119
|
+
contract: HERMES_DEVELOPER_SLACK_METADATA_CONTRACT,
|
|
120
|
+
...input,
|
|
121
|
+
});
|
|
122
|
+
const metadataDigest = sha256(JSON.stringify(body));
|
|
123
|
+
return Object.freeze({
|
|
124
|
+
...body,
|
|
125
|
+
metadataDigest,
|
|
126
|
+
authenticationTag: createHmac("sha256", authenticationKey)
|
|
127
|
+
.update(metadataDigest)
|
|
128
|
+
.digest("hex"),
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export function verifyHermesDeveloperTrustedSlackMetadata(
|
|
133
|
+
value,
|
|
134
|
+
authenticationKey
|
|
135
|
+
) {
|
|
136
|
+
try {
|
|
137
|
+
if (!Buffer.isBuffer(authenticationKey) || authenticationKey.length < 32) {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
if (
|
|
141
|
+
!exactHermesDeveloperMetadataKeys(value, [
|
|
142
|
+
"contract",
|
|
143
|
+
"source",
|
|
144
|
+
"teamId",
|
|
145
|
+
"channelId",
|
|
146
|
+
"actorId",
|
|
147
|
+
"eventId",
|
|
148
|
+
"eventType",
|
|
149
|
+
"eventSubtype",
|
|
150
|
+
"messageTs",
|
|
151
|
+
"threadTs",
|
|
152
|
+
"botId",
|
|
153
|
+
"ackCapability",
|
|
154
|
+
"adapterGeneration",
|
|
155
|
+
"metadataDigest",
|
|
156
|
+
"authenticationTag",
|
|
157
|
+
]) ||
|
|
158
|
+
value.contract !== HERMES_DEVELOPER_SLACK_METADATA_CONTRACT
|
|
159
|
+
) {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
const {
|
|
163
|
+
contract: _contract,
|
|
164
|
+
metadataDigest,
|
|
165
|
+
authenticationTag,
|
|
166
|
+
...input
|
|
167
|
+
} = value;
|
|
168
|
+
const rebuilt = createHermesDeveloperTrustedSlackMetadata(
|
|
169
|
+
input,
|
|
170
|
+
authenticationKey
|
|
171
|
+
);
|
|
172
|
+
const supplied = Buffer.from(authenticationTag ?? "", "hex");
|
|
173
|
+
const expected = Buffer.from(rebuilt.authenticationTag, "hex");
|
|
174
|
+
return (
|
|
175
|
+
rebuilt.metadataDigest === metadataDigest &&
|
|
176
|
+
supplied.length === expected.length &&
|
|
177
|
+
timingSafeEqual(supplied, expected)
|
|
178
|
+
);
|
|
179
|
+
} catch {
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
26
184
|
export class HermesAgentBridgeError extends Error {
|
|
27
185
|
constructor(code, message, details = {}) {
|
|
28
186
|
super(message);
|
|
@@ -38,7 +38,7 @@ import { installAgentHostServices } from "./service-installer.mjs";
|
|
|
38
38
|
const PACKAGE_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "../..");
|
|
39
39
|
const VERSION = "sellable-agent-host-bootstrap/v1";
|
|
40
40
|
const RECEIPT_VERSION = "sellable-agent-host-registration/v1";
|
|
41
|
-
const INSTALLER_PACKAGE = "@sellable/install@0.1.
|
|
41
|
+
const INSTALLER_PACKAGE = "@sellable/install@0.1.651";
|
|
42
42
|
const MCP_PACKAGE = "@sellable/mcp@0.1.880";
|
|
43
43
|
const HERMES_VERSION = "0.18.0";
|
|
44
44
|
const SHA256 = /^[a-f0-9]{64}$/;
|
|
@@ -1547,7 +1547,7 @@ export function compileClaimToProfileDesired(activeClaim, config) {
|
|
|
1547
1547
|
pinned.hermesCli !== "hermes" ||
|
|
1548
1548
|
pinned.hermesVersion !== "0.18.0" ||
|
|
1549
1549
|
pinned.installerPackage !==
|
|
1550
|
-
"@sellable/install@0.1.
|
|
1550
|
+
"@sellable/install@0.1.651" ||
|
|
1551
1551
|
pinned.mcpPackage !== "@sellable/mcp@0.1.880" ||
|
|
1552
1552
|
!Array.isArray(policy.toolInclude) ||
|
|
1553
1553
|
policy.toolInclude.length === 0 ||
|
|
@@ -283,7 +283,7 @@ function validateDesired(desired) {
|
|
|
283
283
|
desired.hermesCli !== "hermes" ||
|
|
284
284
|
desired.hermesVersion !== "0.18.0" ||
|
|
285
285
|
desired.installerPackage !==
|
|
286
|
-
"@sellable/install@0.1.
|
|
286
|
+
"@sellable/install@0.1.651" ||
|
|
287
287
|
desired.mcpPackage !== "@sellable/mcp@0.1.880" ||
|
|
288
288
|
!Array.isArray(desired.toolInclude) ||
|
|
289
289
|
desired.toolInclude.length === 0 ||
|
|
@@ -26,7 +26,7 @@ import { deriveContainedProfileId } from "./profile-materializer.mjs";
|
|
|
26
26
|
|
|
27
27
|
export const PROVISIONING_ACTION = "PROVISION_HERMES_PROFILE";
|
|
28
28
|
export const PINNED_INSTALL_PACKAGE =
|
|
29
|
-
"@sellable/install@0.1.
|
|
29
|
+
"@sellable/install@0.1.651";
|
|
30
30
|
export const PINNED_MCP_PACKAGE = "@sellable/mcp@0.1.880";
|
|
31
31
|
const PINNED_INSTALL_VERSION = PINNED_INSTALL_PACKAGE.slice(
|
|
32
32
|
PINNED_INSTALL_PACKAGE.lastIndexOf("@") + 1
|