@rubytech/create-realagent-code 0.1.565 → 0.1.567
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/package.json +1 -1
- package/payload/platform/config/brand-registry.json +1 -1
- package/payload/platform/neo4j/schema.cypher +9 -0
- package/payload/platform/package-lock.json +66 -1
- package/payload/platform/plugins/.claude-plugin/marketplace.json +5 -0
- package/payload/platform/plugins/admin/hooks/lib/maxy-mcp-plugins.txt +1 -0
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +48 -1
- package/payload/platform/plugins/admin/skills/public-agent-manager/SKILL.md +5 -1
- package/payload/platform/plugins/admin/skills/whats-new/SKILL.md +10 -0
- package/payload/platform/plugins/docs/references/channel-wake-and-prompt.md +47 -0
- package/payload/platform/plugins/inventory/.claude-plugin/plugin.json +21 -0
- package/payload/platform/plugins/inventory/PLUGIN.md +75 -0
- package/payload/platform/plugins/inventory/lib/mcp-spawn-tee/index.js +204 -0
- package/payload/platform/plugins/inventory/lib/mcp-spawn-tee/package.json +3 -0
- package/payload/platform/plugins/inventory/mcp/dist/index.d.ts +2 -0
- package/payload/platform/plugins/inventory/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/index.js +241 -0
- package/payload/platform/plugins/inventory/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/forecast.d.ts +20 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/forecast.d.ts.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/forecast.js +29 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/forecast.js.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/neo4j.d.ts +5 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/neo4j.d.ts.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/neo4j.js +40 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/neo4j.js.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/read.d.ts +28 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/read.d.ts.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/read.js +91 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/read.js.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/replenish.d.ts +56 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/replenish.d.ts.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/replenish.js +107 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/replenish.js.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/types.d.ts +98 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/types.d.ts.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/types.js +7 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/types.js.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/write-rejects.d.ts +12 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/write-rejects.d.ts.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/write-rejects.js +49 -0
- package/payload/platform/plugins/inventory/mcp/dist/lib/write-rejects.js.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/demand-record.d.ts +20 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/demand-record.d.ts.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/demand-record.js +53 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/demand-record.js.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/forecast.d.ts +23 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/forecast.d.ts.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/forecast.js +18 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/forecast.js.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/policy-set.d.ts +25 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/policy-set.d.ts.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/policy-set.js +37 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/policy-set.js.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/purchase-order-record.d.ts +25 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/purchase-order-record.d.ts.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/purchase-order-record.js +43 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/purchase-order-record.js.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/replenish-plan.d.ts +29 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/replenish-plan.d.ts.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/replenish-plan.js +95 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/replenish-plan.js.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/stock-record.d.ts +21 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/stock-record.d.ts.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/stock-record.js +46 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/stock-record.js.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/supplier-terms-set.d.ts +24 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/supplier-terms-set.d.ts.map +1 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/supplier-terms-set.js +29 -0
- package/payload/platform/plugins/inventory/mcp/dist/tools/supplier-terms-set.js.map +1 -0
- package/payload/platform/plugins/inventory/mcp/package.json +21 -0
- package/payload/platform/plugins/memory/references/schema-retail.md +20 -0
- package/payload/platform/scripts/vnc.sh +10 -1
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +8 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.js +66 -5
- package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/public-spawn-model.d.ts +28 -0
- package/payload/platform/services/claude-session-manager/dist/public-spawn-model.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/public-spawn-model.js +58 -0
- package/payload/platform/services/claude-session-manager/dist/public-spawn-model.js.map +1 -0
- package/payload/platform/services/telegram-channel/dist/server.d.ts +5 -0
- package/payload/platform/services/telegram-channel/dist/server.d.ts.map +1 -1
- package/payload/platform/services/telegram-channel/dist/server.js +22 -2
- package/payload/platform/services/telegram-channel/dist/server.js.map +1 -1
- package/payload/platform/services/telegram-channel/dist/turn-follow.d.ts +34 -2
- package/payload/platform/services/telegram-channel/dist/turn-follow.d.ts.map +1 -1
- package/payload/platform/services/telegram-channel/dist/turn-follow.js +150 -14
- package/payload/platform/services/telegram-channel/dist/turn-follow.js.map +1 -1
- package/payload/platform/services/webchat-channel/dist/server.d.ts +5 -0
- package/payload/platform/services/webchat-channel/dist/server.d.ts.map +1 -1
- package/payload/platform/services/webchat-channel/dist/server.js +22 -2
- package/payload/platform/services/webchat-channel/dist/server.js.map +1 -1
- package/payload/platform/services/webchat-channel/dist/turn-follow.d.ts +34 -2
- package/payload/platform/services/webchat-channel/dist/turn-follow.d.ts.map +1 -1
- package/payload/platform/services/webchat-channel/dist/turn-follow.js +150 -14
- package/payload/platform/services/webchat-channel/dist/turn-follow.js.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/server.d.ts +10 -2
- package/payload/platform/services/whatsapp-channel/dist/server.d.ts.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/server.js +45 -6
- package/payload/platform/services/whatsapp-channel/dist/server.js.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/turn-follow.d.ts +34 -2
- package/payload/platform/services/whatsapp-channel/dist/turn-follow.d.ts.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/turn-follow.js +153 -15
- package/payload/platform/services/whatsapp-channel/dist/turn-follow.js.map +1 -1
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { movingAverage } from "../lib/forecast.js";
|
|
2
|
+
import { daysOfCover, orderQuantity, reorderPoint, standardDeviation, } from "../lib/replenish.js";
|
|
3
|
+
import { ok, } from "../lib/types.js";
|
|
4
|
+
function addDays(isoDate, days) {
|
|
5
|
+
const d = new Date(`${isoDate}T00:00:00Z`);
|
|
6
|
+
d.setUTCDate(d.getUTCDate() + days);
|
|
7
|
+
return d.toISOString().slice(0, 10);
|
|
8
|
+
}
|
|
9
|
+
export async function replenishPlan(params) {
|
|
10
|
+
const { session, readCandidates, accountId, location, window, periodDays, today } = params;
|
|
11
|
+
const candidates = await readCandidates(session, accountId, location.trim());
|
|
12
|
+
const lines = [];
|
|
13
|
+
const skipped = [];
|
|
14
|
+
let asOfOldest = null;
|
|
15
|
+
let asOfNewest = null;
|
|
16
|
+
for (const c of candidates) {
|
|
17
|
+
if (asOfOldest === null || c.asOf < asOfOldest)
|
|
18
|
+
asOfOldest = c.asOf;
|
|
19
|
+
if (asOfNewest === null || c.asOf > asOfNewest)
|
|
20
|
+
asOfNewest = c.asOf;
|
|
21
|
+
if (c.history.length === 0) {
|
|
22
|
+
skipped.push({ sku: c.sku, location: c.location, missing: "history" });
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
if (c.serviceLevel === null || c.reviewPeriodDays === null) {
|
|
26
|
+
skipped.push({ sku: c.sku, location: c.location, missing: "serviceLevel" });
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (c.leadTimeDays === null ||
|
|
30
|
+
c.orderMultiple === null ||
|
|
31
|
+
c.minimumOrderQuantity === null ||
|
|
32
|
+
c.supplierNodeId === null) {
|
|
33
|
+
skipped.push({ sku: c.sku, location: c.location, missing: "leadTime" });
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
const perPeriod = movingAverage(c.history, window);
|
|
37
|
+
const spread = standardDeviation(c.history.slice(-window));
|
|
38
|
+
const target = reorderPoint({
|
|
39
|
+
perPeriod,
|
|
40
|
+
stdDevPerPeriod: spread,
|
|
41
|
+
periodDays,
|
|
42
|
+
leadTimeDays: c.leadTimeDays,
|
|
43
|
+
reviewPeriodDays: c.reviewPeriodDays,
|
|
44
|
+
serviceLevel: c.serviceLevel,
|
|
45
|
+
});
|
|
46
|
+
const available = c.quantityOnHand + c.quantityOnOrder;
|
|
47
|
+
const recommended = orderQuantity({
|
|
48
|
+
target,
|
|
49
|
+
available,
|
|
50
|
+
minimumOrderQuantity: c.minimumOrderQuantity,
|
|
51
|
+
orderMultiple: c.orderMultiple,
|
|
52
|
+
});
|
|
53
|
+
if (recommended === 0)
|
|
54
|
+
continue;
|
|
55
|
+
lines.push({
|
|
56
|
+
sku: c.sku,
|
|
57
|
+
location: c.location,
|
|
58
|
+
daysOfCover: daysOfCover(c.quantityOnHand, perPeriod, periodDays),
|
|
59
|
+
reorderPoint: target,
|
|
60
|
+
recommendedQuantity: recommended,
|
|
61
|
+
supplierNodeId: c.supplierNodeId,
|
|
62
|
+
expectedArrival: addDays(today, c.leadTimeDays),
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
// Shortest cover first. A null cover means nothing is selling, which is the
|
|
66
|
+
// least urgent thing on the list, so it sorts last.
|
|
67
|
+
lines.sort((a, b) => {
|
|
68
|
+
if (a.daysOfCover === null)
|
|
69
|
+
return 1;
|
|
70
|
+
if (b.daysOfCover === null)
|
|
71
|
+
return -1;
|
|
72
|
+
return a.daysOfCover - b.daysOfCover;
|
|
73
|
+
});
|
|
74
|
+
console.error(`[inventory] op=plan accountId=${accountId} location=${location.trim()} lines=${lines.length} skipped=${skipped.length} asOfOldest=${asOfOldest ?? "-"} asOfNewest=${asOfNewest ?? "-"} recentWriteRejects=${params.recentWriteRejects ?? 0}`);
|
|
75
|
+
for (const s of skipped) {
|
|
76
|
+
console.error(`[inventory] op=plan-skip accountId=${accountId} sku=${s.sku} location=${s.location} missing=${s.missing}`);
|
|
77
|
+
}
|
|
78
|
+
const header = `op=plan lines=${lines.length} skipped=${skipped.length} asOfOldest=${asOfOldest ?? "-"} asOfNewest=${asOfNewest ?? "-"}`;
|
|
79
|
+
const body = lines
|
|
80
|
+
.map((l) => `${l.sku}: order ${l.recommendedQuantity}, cover ${l.daysOfCover === null ? "n/a" : l.daysOfCover.toFixed(1)} days, reorder point ${l.reorderPoint.toFixed(1)}, supplier ${l.supplierNodeId}, arrives ${l.expectedArrival}`)
|
|
81
|
+
.join("\n");
|
|
82
|
+
const skips = skipped
|
|
83
|
+
.map((s) => `${s.sku} at ${s.location}: missing=${s.missing}`)
|
|
84
|
+
.join("\n");
|
|
85
|
+
return ok([
|
|
86
|
+
header,
|
|
87
|
+
lines.length > 0 ? body : "Nothing needs ordering.",
|
|
88
|
+
skipped.length > 0
|
|
89
|
+
? `Could not be worked out:\n${skips}\nNo value was assumed for any of these.`
|
|
90
|
+
: "",
|
|
91
|
+
]
|
|
92
|
+
.filter((s) => s !== "")
|
|
93
|
+
.join("\n\n"));
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=replenish-plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replenish-plan.js","sourceRoot":"","sources":["../../src/tools/replenish-plan.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAKL,EAAE,GACH,MAAM,iBAAiB,CAAC;AAuBzB,SAAS,OAAO,CAAC,OAAe,EAAE,IAAY;IAC5C,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,OAAO,YAAY,CAAC,CAAC;IAC3C,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC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WAAW,CAAC,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,cAAc,aAAa,CAAC,CAAC,eAAe,EAAE,CAC9N;SACA,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,MAAM,KAAK,GAAG,OAAO;SAClB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,QAAQ,aAAa,CAAC,CAAC,OAAO,EAAE,CAAC;SAC7D,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO,EAAE,CACP;QACE,MAAM;QACN,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,yBAAyB;QACnD,OAAO,CAAC,MAAM,GAAG,CAAC;YAChB,CAAC,CAAC,6BAA6B,KAAK,0CAA0C;YAC9E,CAAC,CAAC,EAAE;KACP;SACE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;SACvB,IAAI,CAAC,MAAM,CAAC,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task 2448 — record measured stock at a product-plus-location grain.
|
|
3
|
+
*
|
|
4
|
+
* One node per row. The tool resolves the SKU and confirms the location
|
|
5
|
+
* rather than creating either: a position pointing at a product that does not
|
|
6
|
+
* exist is worse than a rejected row, because the plan would silently omit it.
|
|
7
|
+
* Rejected rows are counted and named in the reply, never dropped quietly.
|
|
8
|
+
*/
|
|
9
|
+
import type { Session } from "neo4j-driver";
|
|
10
|
+
import { type CreatedBy, type ResolveLocationFn, type ResolveProductFn, type StockRow, type ToolResult, type WriteFn } from "../lib/types.js";
|
|
11
|
+
export interface StockRecordParams {
|
|
12
|
+
session: Session;
|
|
13
|
+
write: WriteFn;
|
|
14
|
+
resolveProduct: ResolveProductFn;
|
|
15
|
+
resolveLocation: ResolveLocationFn;
|
|
16
|
+
accountId: string;
|
|
17
|
+
createdBy: CreatedBy;
|
|
18
|
+
rows: StockRow[];
|
|
19
|
+
}
|
|
20
|
+
export declare function stockRecord(params: StockRecordParams): Promise<ToolResult>;
|
|
21
|
+
//# sourceMappingURL=stock-record.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stock-record.d.ts","sourceRoot":"","sources":["../../src/tools/stock-record.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,OAAO,EAGb,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,EAAE,gBAAgB,CAAC;IACjC,eAAe,EAAE,iBAAiB,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;IACrB,IAAI,EAAE,QAAQ,EAAE,CAAC;CAClB;AAED,wBAAsB,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CA2DhF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { fail, ok, } from "../lib/types.js";
|
|
2
|
+
export async function stockRecord(params) {
|
|
3
|
+
const { session, write, resolveProduct, resolveLocation, accountId, createdBy, rows } = params;
|
|
4
|
+
if (rows.length === 0) {
|
|
5
|
+
return fail(`[inventory] op=reject reason=empty-batch accountId=${accountId} — no stock rows supplied. Nothing was written.`);
|
|
6
|
+
}
|
|
7
|
+
let accepted = 0;
|
|
8
|
+
const rejected = [];
|
|
9
|
+
for (const row of rows) {
|
|
10
|
+
const sku = row.sku.trim();
|
|
11
|
+
const location = row.location.trim();
|
|
12
|
+
const productNodeId = await resolveProduct(session, accountId, sku);
|
|
13
|
+
if (productNodeId === null) {
|
|
14
|
+
rejected.push(`${sku} (unknown sku)`);
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
const locationExists = await resolveLocation(session, accountId, location);
|
|
18
|
+
if (!locationExists) {
|
|
19
|
+
rejected.push(`${sku} (unknown location ${location})`);
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
const relationships = [
|
|
23
|
+
{ type: "OF_PRODUCT", direction: "outgoing", targetNodeId: productNodeId },
|
|
24
|
+
{ type: "AT_LOCATION", direction: "outgoing", targetNodeId: location },
|
|
25
|
+
];
|
|
26
|
+
await write({
|
|
27
|
+
session,
|
|
28
|
+
labels: ["StockPosition"],
|
|
29
|
+
props: {
|
|
30
|
+
accountId,
|
|
31
|
+
product: productNodeId,
|
|
32
|
+
location,
|
|
33
|
+
quantityOnHand: row.quantityOnHand,
|
|
34
|
+
quantityOnOrder: row.quantityOnOrder,
|
|
35
|
+
asOf: row.asOf,
|
|
36
|
+
},
|
|
37
|
+
relationships,
|
|
38
|
+
createdBy,
|
|
39
|
+
});
|
|
40
|
+
accepted += 1;
|
|
41
|
+
}
|
|
42
|
+
console.error(`[inventory] op=stock-record accountId=${accountId} rows=${rows.length} accepted=${accepted} rejected=${rejected.length}`);
|
|
43
|
+
const tail = rejected.length === 0 ? "" : ` Rejected: ${rejected.join("; ")}.`;
|
|
44
|
+
return ok(`op=stock-record rows=${rows.length} accepted=${accepted} rejected=${rejected.length}.${tail}`);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=stock-record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stock-record.js","sourceRoot":"","sources":["../../src/tools/stock-record.ts"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YAAY,EAAE,QAAQ,EAAE;SACvE,CAAC;QAEF,MAAM,KAAK,CAAC;YACV,OAAO;YACP,MAAM,EAAE,CAAC,eAAe,CAAC;YACzB,KAAK,EAAE;gBACL,SAAS;gBACT,OAAO,EAAE,aAAa;gBACtB,QAAQ;gBACR,cAAc,EAAE,GAAG,CAAC,cAAc;gBAClC,eAAe,EAAE,GAAG,CAAC,eAAe;gBACpC,IAAI,EAAE,GAAG,CAAC,IAAI;aACf;YACD,aAAa;YACb,SAAS;SACV,CAAC,CAAC;QACH,QAAQ,IAAI,CAAC,CAAC;IAChB,CAAC;IAED,OAAO,CAAC,KAAK,CACX,yCAAyC,SAAS,SAAS,IAAI,CAAC,MAAM,aAAa,QAAQ,aAAa,QAAQ,CAAC,MAAM,EAAE,CAC1H,CAAC;IAEF,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;IAC/E,OAAO,EAAE,CACP,wBAAwB,IAAI,CAAC,MAAM,aAAa,QAAQ,aAAa,QAAQ,CAAC,MAAM,IAAI,IAAI,EAAE,CAC/F,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task 2448 — put the commercial terms on the product-to-supplier edge.
|
|
3
|
+
*
|
|
4
|
+
* The edge must already exist. Creating it here would let a mistyped supplier
|
|
5
|
+
* id invent a supply relationship that the plan would then order against.
|
|
6
|
+
*/
|
|
7
|
+
import type { Session } from "neo4j-driver";
|
|
8
|
+
import type { SupplierTerms } from "../lib/read.js";
|
|
9
|
+
import { type ResolveProductFn, type ToolResult } from "../lib/types.js";
|
|
10
|
+
export type SetSupplierTermsFn = (session: Session, accountId: string, productNodeId: string, supplierNodeId: string, terms: SupplierTerms) => Promise<boolean>;
|
|
11
|
+
export interface SupplierTermsSetParams {
|
|
12
|
+
session: Session;
|
|
13
|
+
resolveProduct: ResolveProductFn;
|
|
14
|
+
setTerms: SetSupplierTermsFn;
|
|
15
|
+
accountId: string;
|
|
16
|
+
sku: string;
|
|
17
|
+
supplierNodeId: string;
|
|
18
|
+
leadTimeDays: number;
|
|
19
|
+
minimumOrderQuantity: number;
|
|
20
|
+
orderMultiple: number;
|
|
21
|
+
unitCost: number;
|
|
22
|
+
}
|
|
23
|
+
export declare function supplierTermsSet(params: SupplierTermsSetParams): Promise<ToolResult>;
|
|
24
|
+
//# sourceMappingURL=supplier-terms-set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supplier-terms-set.d.ts","sourceRoot":"","sources":["../../src/tools/supplier-terms-set.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,UAAU,EAAY,MAAM,iBAAiB,CAAC;AAEnF,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,aAAa,KACjB,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,gBAAgB,CAAC;IACjC,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,UAAU,CAAC,CAyDrB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { fail, ok } from "../lib/types.js";
|
|
2
|
+
export async function supplierTermsSet(params) {
|
|
3
|
+
const { session, resolveProduct, setTerms, accountId, sku, supplierNodeId, leadTimeDays, minimumOrderQuantity, orderMultiple, unitCost, } = params;
|
|
4
|
+
if (!(leadTimeDays >= 0)) {
|
|
5
|
+
return fail(`[inventory] op=reject reason=negative-lead-time value=${leadTimeDays} — lead time is whole days from order to arrival. Nothing was written.`);
|
|
6
|
+
}
|
|
7
|
+
if (!(orderMultiple > 0)) {
|
|
8
|
+
return fail(`[inventory] op=reject reason=non-positive-order-multiple value=${orderMultiple} — the pack size the supplier ships in. Use 1 when they ship singles. Nothing was written.`);
|
|
9
|
+
}
|
|
10
|
+
if (!(minimumOrderQuantity >= 0)) {
|
|
11
|
+
return fail(`[inventory] op=reject reason=negative-minimum-order value=${minimumOrderQuantity} — use 0 when the supplier has no minimum. Nothing was written.`);
|
|
12
|
+
}
|
|
13
|
+
const productNodeId = await resolveProduct(session, accountId, sku.trim());
|
|
14
|
+
if (productNodeId === null) {
|
|
15
|
+
return fail(`[inventory] op=reject reason=unknown-sku sku=${sku.trim()} — no product with that SKU on this account, or more than one. Nothing was written.`);
|
|
16
|
+
}
|
|
17
|
+
const applied = await setTerms(session, accountId, productNodeId, supplierNodeId.trim(), {
|
|
18
|
+
leadTimeDays,
|
|
19
|
+
minimumOrderQuantity,
|
|
20
|
+
orderMultiple,
|
|
21
|
+
unitCost,
|
|
22
|
+
});
|
|
23
|
+
if (!applied) {
|
|
24
|
+
return fail(`[inventory] op=reject reason=no-supplied-by-edge sku=${sku.trim()} supplier=${supplierNodeId.trim()} — link the product to the supplier first. This tool sets terms on an existing supply relationship, it does not create one. Nothing was written.`);
|
|
25
|
+
}
|
|
26
|
+
console.error(`[inventory] op=supplier-terms-set accountId=${accountId} sku=${sku.trim()} supplier=${supplierNodeId.trim()} leadTimeDays=${leadTimeDays} moq=${minimumOrderQuantity} multiple=${orderMultiple}`);
|
|
27
|
+
return ok(`Terms set for ${sku.trim()}: ${leadTimeDays} day lead time, minimum ${minimumOrderQuantity}, ordered in multiples of ${orderMultiple}, unit cost ${unitCost.toFixed(2)}.`);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=supplier-terms-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supplier-terms-set.js","sourceRoot":"","sources":["../../src/tools/supplier-terms-set.ts"],"names":[],"mappings":"AAQA,OAAO,EAA0C,IAAI,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAuBnF,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAA8B;IAE9B,MAAM,EACJ,OAAO,EACP,cAAc,EACd,QAAQ,EACR,SAAS,EACT,GAAG,EACH,cAAc,EACd,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,QAAQ,GACT,GAAG,MAAM,CAAC;IAEX,IAAI,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,EAAE,CAAC;QACzB,OAAO,IAAI,CACT,yDAAyD,YAAY,wEAAwE,CAC9I,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,CAAC,aAAa,GAAG,CAAC,CAAC,EAAE,CAAC;QACzB,OAAO,IAAI,CACT,kEAAkE,aAAa,4FAA4F,CAC5K,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,CAAC,oBAAoB,IAAI,CAAC,CAAC,EAAE,CAAC;QACjC,OAAO,IAAI,CACT,6DAA6D,oBAAoB,iEAAiE,CACnJ,CAAC;IACJ,CAAC;IAED,MAAM,aAAa,GAAG,MAAM,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3E,IAAI,aAAa,KAAK,IAAI,EAAE,CAAC;QAC3B,OAAO,IAAI,CACT,gDAAgD,GAAG,CAAC,IAAI,EAAE,qFAAqF,CAChJ,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,CAAC,IAAI,EAAE,EAAE;QACvF,YAAY;QACZ,oBAAoB;QACpB,aAAa;QACb,QAAQ;KACT,CAAC,CAAC;IAEH,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CACT,wDAAwD,GAAG,CAAC,IAAI,EAAE,aAAa,cAAc,CAAC,IAAI,EAAE,kJAAkJ,CACvP,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,KAAK,CACX,+CAA+C,SAAS,QAAQ,GAAG,CAAC,IAAI,EAAE,aAAa,cAAc,CAAC,IAAI,EAAE,iBAAiB,YAAY,QAAQ,oBAAoB,aAAa,aAAa,EAAE,CAClM,CAAC;IAEF,OAAO,EAAE,CACP,iBAAiB,GAAG,CAAC,IAAI,EAAE,KAAK,YAAY,2BAA2B,oBAAoB,6BAA6B,aAAa,eAAe,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAC3K,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxy/inventory",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"start": "node dist/index.js",
|
|
10
|
+
"test": "vitest run"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
14
|
+
"neo4j-driver": "^5.28.1"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"typescript": "^5.7.0",
|
|
18
|
+
"@types/node": "^22.0.0",
|
|
19
|
+
"vitest": "^4.1.2"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -16,11 +16,22 @@ When loading this reference, confirm: "Using schema-base + schema-retail".
|
|
|
16
16
|
| StockMovement | `StockMovement` | `cdm:Activity` | `accountId`, `product` (id), `quantity`, `direction` (in/out), `reason`, `date` |
|
|
17
17
|
| PurchaseOrder | `PurchaseOrder` | `schema:Order` (subtype) | `accountId`, `supplier` (id), `lineItems`, `orderDate`, `expectedDelivery`, `orderStatus` |
|
|
18
18
|
| StoreLocation | `StoreLocation` | `schema:Store` | `accountId`, `name`, `address` (id), `openingHours` |
|
|
19
|
+
| StockPosition | `StockPosition` | platform-native | `accountId`, `product` (id), `location` (id), `quantityOnHand`, `quantityOnOrder`, `asOf` |
|
|
20
|
+
| DemandObservation | `DemandObservation` | platform-native | `accountId`, `product` (id), `location` (id), `periodStart`, `periodEnd`, `quantitySold` |
|
|
21
|
+
| ReplenishmentPolicy | `ReplenishmentPolicy` | platform-native | `accountId`, `product` (id), `location` (id), `serviceLevel`, `reviewPeriodDays` |
|
|
19
22
|
|
|
20
23
|
### PurchaseOrder vs base Order
|
|
21
24
|
|
|
22
25
|
`PurchaseOrder` is the retail-specific label for supplier-facing orders (restocking, procurement). Use `PurchaseOrder` (not `Order`) when ordering from a supplier. Customer-facing orders use the base `Order` label.
|
|
23
26
|
|
|
27
|
+
### StockPosition vs Product.stockLevel
|
|
28
|
+
|
|
29
|
+
`StockPosition` is the planning authority. It holds stock at a product-plus-location grain and carries an `asOf` timestamp, so a retailer with a shop and a warehouse can say how much sits where.
|
|
30
|
+
|
|
31
|
+
`Product.stockLevel` remains a required property and is untouched by this vertical's planning tools. No tool in the `inventory` plugin reads it. Treat it as a display convenience on the product record, not as a planning input.
|
|
32
|
+
|
|
33
|
+
`ReplenishmentPolicy` is deliberately a separate node from `StockPosition`: a position is a measured fact rewritten on every upload, a policy is an operator setting that changes rarely. On one node, every stock upload would have to preserve the policy or silently overwrite it.
|
|
34
|
+
|
|
24
35
|
---
|
|
25
36
|
|
|
26
37
|
## Relationship Patterns
|
|
@@ -30,4 +41,13 @@ When loading this reference, confirm: "Using schema-base + schema-retail".
|
|
|
30
41
|
(:Product)-[:SUPPLIED_BY]->(:Organization)
|
|
31
42
|
(:StockMovement)-[:AFFECTS]->(:Product)
|
|
32
43
|
(:PurchaseOrder)-[:FROM_SUPPLIER]->(:Organization)
|
|
44
|
+
(:StockPosition)-[:OF_PRODUCT]->(:Product)
|
|
45
|
+
(:StockPosition)-[:AT_LOCATION]->(:StoreLocation)
|
|
46
|
+
(:DemandObservation)-[:OF_PRODUCT]->(:Product)
|
|
47
|
+
(:DemandObservation)-[:AT_LOCATION]->(:StoreLocation)
|
|
48
|
+
(:ReplenishmentPolicy)-[:OF_PRODUCT]->(:Product)
|
|
49
|
+
(:ReplenishmentPolicy)-[:AT_LOCATION]->(:StoreLocation)
|
|
50
|
+
(:Product)-[:SUPPLIED_BY {leadTimeDays, minimumOrderQuantity, orderMultiple, unitCost}]->(:Organization)
|
|
33
51
|
```
|
|
52
|
+
|
|
53
|
+
`SUPPLIED_BY` carries the commercial terms because they are properties of the product-supplier pair, not of either node alone: the same product from two suppliers has two lead times. `leadTimeDays` is a whole number of days, `minimumOrderQuantity` and `orderMultiple` are in the product's selling unit, `unitCost` is in the account's currency.
|
|
@@ -21,12 +21,21 @@
|
|
|
21
21
|
# rfbport, websockify port, and CDP port are all brand-scoped so any number
|
|
22
22
|
# of brands on the same device run their full VNC stacks concurrently
|
|
23
23
|
# without sharing session cookies, extensions, local storage, or display
|
|
24
|
-
# binding. Defaults: Maxy=:99/5900/6080/
|
|
24
|
+
# binding. Defaults: Maxy=:99/5900/6080/9322, Real Agent=:100/5901/6081/
|
|
25
25
|
# 9223, Maxy-2=:101/5902/6082/9224, Maxy-3=:102/5903/6083/9225,
|
|
26
26
|
# Maxy-4=:103/5904/6084/9226. Each brand's port set is stamped in
|
|
27
27
|
# brand.json at install time and re-read at runtime; missing fields are
|
|
28
28
|
# derived from `vncDisplay` via the ordinal offset rule.
|
|
29
29
|
#
|
|
30
|
+
# Maxy's CDP port is the one deliberate break from that rule. The ordinal
|
|
31
|
+
# value for display :99 is 9222, which is Chrome's own universal default,
|
|
32
|
+
# so any agent-side browser tool that launches Chromium without being told
|
|
33
|
+
# a port lands on it. On a box where Maxy co-resides with another brand,
|
|
34
|
+
# that brand's account agents kept taking 9222 and the installer's
|
|
35
|
+
# UNRELATED-holder preflight then refused to write Maxy's service files.
|
|
36
|
+
# 9322 sits outside the 922x block, which the offset rule cannot reach
|
|
37
|
+
# until display :199, so no future brand can derive onto it either.
|
|
38
|
+
#
|
|
30
39
|
# retired the admin-UI terminal surface entirely. This script
|
|
31
40
|
# no longer spawns GUI terminal emulators of any kind; upgrades and
|
|
32
41
|
# cloudflare-setup actions run via the detached action runner
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-tool-names.generated.d.ts","sourceRoot":"","sources":["../src/canonical-tool-names.generated.ts"],"names":[],"mappings":"AAQA,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"canonical-tool-names.generated.d.ts","sourceRoot":"","sources":["../src/canonical-tool-names.generated.ts"],"names":[],"mappings":"AAQA,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EA0B7C,CAAA;AAED,gEAAgE;AAChE,eAAO,MAAM,yBAAyB,EAAE,SAAS,MAAM,EAyVtD,CAAA"}
|
package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js
CHANGED
|
@@ -17,6 +17,7 @@ export const MAXY_MCP_PLUGINS = [
|
|
|
17
17
|
"google",
|
|
18
18
|
"graph",
|
|
19
19
|
"graph-viewer",
|
|
20
|
+
"inventory",
|
|
20
21
|
"joblogic",
|
|
21
22
|
"ledger",
|
|
22
23
|
"memory",
|
|
@@ -160,6 +161,13 @@ export const CANONICAL_MAXY_TOOL_NAMES = [
|
|
|
160
161
|
"mcp__plugin_graph_graph__maxy-graph-get_neo4j_schema",
|
|
161
162
|
"mcp__plugin_graph_graph__maxy-graph-read_neo4j_cypher",
|
|
162
163
|
"mcp__plugin_graph_graph__maxy-graph-write_neo4j_cypher",
|
|
164
|
+
"mcp__plugin_inventory_inventory__inventory-demand-record",
|
|
165
|
+
"mcp__plugin_inventory_inventory__inventory-forecast",
|
|
166
|
+
"mcp__plugin_inventory_inventory__inventory-policy-set",
|
|
167
|
+
"mcp__plugin_inventory_inventory__inventory-purchase-order-record",
|
|
168
|
+
"mcp__plugin_inventory_inventory__inventory-replenish-plan",
|
|
169
|
+
"mcp__plugin_inventory_inventory__inventory-stock-record",
|
|
170
|
+
"mcp__plugin_inventory_inventory__inventory-supplier-terms-set",
|
|
163
171
|
"mcp__plugin_joblogic_joblogic__joblogic-asset-create",
|
|
164
172
|
"mcp__plugin_joblogic_joblogic__joblogic-asset-get",
|
|
165
173
|
"mcp__plugin_joblogic_joblogic__joblogic-asset-list",
|
package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-tool-names.generated.js","sourceRoot":"","sources":["../src/canonical-tool-names.generated.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,kEAAkE;AAClE,yDAAyD;AACzD,kFAAkF;AAClF,EAAE;AACF,yEAAyE;AACzE,6DAA6D;AAE7D,+EAA+E;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAsB;IACjD,OAAO;IACP,KAAK;IACL,SAAS;IACT,WAAW;IACX,UAAU;IACV,OAAO;IACP,YAAY;IACZ,QAAQ;IACR,OAAO;IACP,cAAc;IACd,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,gBAAgB;IAChB,UAAU;IACV,SAAS;IACT,cAAc;IACd,UAAU;IACV,MAAM;IACN,WAAW;CACZ,CAAA;AAED,gEAAgE;AAChE,MAAM,CAAC,MAAM,yBAAyB,GAAsB;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IAC/C,gDAAgD;IAChD,gDAAgD;IAChD,kDAAkD;IAClD,oDAAoD;CACrD,CAAA"}
|
|
1
|
+
{"version":3,"file":"canonical-tool-names.generated.js","sourceRoot":"","sources":["../src/canonical-tool-names.generated.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,kEAAkE;AAClE,yDAAyD;AACzD,kFAAkF;AAClF,EAAE;AACF,yEAAyE;AACzE,6DAA6D;AAE7D,+EAA+E;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAsB;IACjD,OAAO;IACP,KAAK;IACL,SAAS;IACT,WAAW;IACX,UAAU;IACV,OAAO;IACP,YAAY;IACZ,QAAQ;IACR,OAAO;IACP,cAAc;IACd,WAAW;IACX,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,gBAAgB;IAChB,UAAU;IACV,SAAS;IACT,cAAc;IACd,UAAU;IACV,MAAM;IACN,WAAW;CACZ,CAAA;AAED,gEAAgE;AAChE,MAAM,CAAC,MAAM,yBAAyB,GAAsB;IAC1D,yCAAyC;IACzC,yCAAyC;IACzC,kDAAkD;IAClD,sDAAsD;IACtD,yCAAyC;IACzC,yCAAyC;IACzC,uCAAuC;IACvC,wCAAwC;IACxC,iDAAiD;IACjD,yCAAyC;IACzC,iDAAiD;IACjD,yCAAyC;IACzC,sCAAsC;IACtC,yCAAyC;IACzC,wCAAwC;IACxC,oCAAoC;IACpC,yCAAyC;IACzC,qCAAqC;IACrC,uCAAuC;IACvC,2CAA2C;IAC3C,4CAA4C;IAC5C,uCAAuC;IACvC,uCAAuC;IACvC,sCAAsC;IACtC,qCAAqC;IACrC,uCAAuC;IACvC,yCAAyC;IACzC,4CAA4C;IAC5C,0CAA0C;IAC1C,2CAA2C;IAC3C,gDAAgD;IAChD,oCAAoC;IACpC,sCAAsC;IACtC,gDAAgD;IAChD,0CAA0C;IAC1C,uCAAuC;IACvC,0CAA0C;IAC1C,uCAAuC;IACvC,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pD,iDAAiD;IACjD,8DAA8D;IAC9D,4DAA4D;IAC5D,6DAA6D;IAC7D,gEAAgE;IAChE,iEAAiE;IACjE,iEAAiE;IACjE,qEAAqE;IACrE,mEAAmE;IACnE,qEAAqE;IACrE,kEAAkE;IAClE,mEAAmE;IACnE,kEAAkE;IAClE,wCAAwC;IACxC,gDAAgD;IAChD,0DAA0D;IAC1D,sCAAsC;IACtC,6DAA6D;IAC7D,kEAAkE;IAClE,8DAA8D;IAC9D,oEAAoE;IACpE,0DAA0D;IAC1D,kDAAkD;IAClD,gDAAgD;IAChD,kEAAkE;IAClE,uDAAuD;IACvD,oDAAoD;IACpD,oDAAoD;IACpD,qDAAqD;IACrD,oDAAoD;IACpD,kDAAkD;IAClD,+CAA+C;IAC/C,oDAAoD;IACpD,gDAAgD;IAChD,yCAAyC;IACzC,uCAAuC;IACvC,oCAAoC;IACpC,qCAAqC;IACrC,uCAAuC;IACvC,qCAAqC;IACrC,yCAAyC;IACzC,qCAAqC;IACrC,sCAAsC;IACtC,oCAAoC;IACpC,iCAAiC;IACjC,kCAAkC;IAClC,mCAAmC;IACnC,oCAAoC;IACpC,oCAAoC;IACpC,kDAAkD;IAClD,kDAAkD;IAClD,mDAAmD;IACnD,+CAA+C;IAC/C,gDAAgD;IAChD,gDAAgD;IAChD,kDAAkD;IAClD,oDAAoD;CACrD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-server.d.ts","sourceRoot":"","sources":["../src/http-server.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"http-server.d.ts","sourceRoot":"","sources":["../src/http-server.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAqB3B,OAAO,KAAK,EAAU,SAAS,EAAW,MAAM,YAAY,CAAA;AAK5D,OAAO,EAkBL,KAAK,SAAS,EAEf,MAAM,kBAAkB,C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,GAAG,IAAI,EACxB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,GACtB,MAAM,CAER;AAkCD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAe5F;AAiGD,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CASvG;AAUD,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,QAAQ,EACd,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,OAAO,GACxB,IAAI,CA4BN;AAkED;;;kEAGkE;AAClE,MAAM,MAAM,OAAO,GAAG,IAAI,GAAG;IAC3B,2BAA2B,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACpD;;;+CAG2C;IAC3C,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CAChD,CAAA;AA8CD,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAssHpD"}
|
|
@@ -29,6 +29,7 @@ import { buildWebchatChannelMcpServers, buildWebchatChannelArgv, webchatChannelM
|
|
|
29
29
|
import { buildTelegramChannelMcpServers, buildTelegramChannelArgv, telegramChannelMcpConfigPath, TELEGRAM_CHANNEL_SERVER_NAME } from './telegram-channel-mcp.js';
|
|
30
30
|
import { buildChannelMcpServers, buildChannelArgv, channelMcpConfigPath, CHANNEL_SERVER_NAME } from './channel-mcp.js';
|
|
31
31
|
import { buildRcPublicLockdownArgv, formatToolAllowlistLine, PUBLIC_ALLOWED_TOOLS_ENV, allowedToolsFromArgv, formatRoleResolutionLine, } from './rc-public-lockdown.js';
|
|
32
|
+
import { resolvePublicSpawnModel } from './public-spawn-model.js';
|
|
32
33
|
import { mergeTarget, isMultiTarget, targetKinds } from './channel-targets.js';
|
|
33
34
|
import { randomUUID, createHash } from 'node:crypto';
|
|
34
35
|
import { execFile, execFileSync } from 'node:child_process';
|
|
@@ -2993,9 +2994,47 @@ export function buildHttpApp(deps) {
|
|
|
2993
2994
|
// Task 969 — the new-session picker's model/effort apply only to a genuinely
|
|
2994
2995
|
// fresh ADMIN spawn (the /chat popover posts role:'admin'). Gating on the
|
|
2995
2996
|
// admin role as well as freshness keeps any other fresh spawn (LinkedIn
|
|
2996
|
-
// ingest,
|
|
2997
|
-
//
|
|
2997
|
+
// ingest, specialist, channel cold-start) on the settings defaults even if
|
|
2998
|
+
// a future caller were to put model/effort on its body.
|
|
2999
|
+
// Task 2452 — `public` left that list. A public spawn no longer takes the
|
|
3000
|
+
// settings default model; it resolves one from its own agent below. Its
|
|
3001
|
+
// EFFORT is still the settings default, so this gate is unchanged.
|
|
2998
3002
|
const freshAdminLevers = mode === 'fresh' && rcRole === 'admin';
|
|
3003
|
+
// Task 2452 — the model a public spawn runs under. Commit 725731df9 routed
|
|
3004
|
+
// public Telegram to this door, which pushes --model only for the two admin
|
|
3005
|
+
// shapes below, so a visitor's session silently took settings.json — pinned
|
|
3006
|
+
// to Opus for the ADMIN session by the rc-daemon.
|
|
3007
|
+
//
|
|
3008
|
+
// Gated on the BODY role, not `effectiveRcRole`: that resolves ~180 lines
|
|
3009
|
+
// below, after the argv push this feeds. Both callers that reach this door
|
|
3010
|
+
// with role:'public' — Telegram (telegram-ensure-session.ts) and a slugless
|
|
3011
|
+
// WhatsApp public inbound (server/index.ts, the no-enabled-agent
|
|
3012
|
+
// fall-through) — put `role` in the body on every spawn, fresh and resume
|
|
3013
|
+
// alike, so the body role covers every public spawn that arrives here. A
|
|
3014
|
+
// channel-bound resume carrying no role at all is not covered; no public
|
|
3015
|
+
// caller produces that shape.
|
|
3016
|
+
//
|
|
3017
|
+
// A re-seat fork is excluded, which Task 2452 states as a scope boundary
|
|
3018
|
+
// and the argv shape enforces anyway: a fork takes the `forkArgvSegment`
|
|
3019
|
+
// branch below, which pushes its own caller-picked `--model`, so the public
|
|
3020
|
+
// push never runs for one. Resolving here regardless would make
|
|
3021
|
+
// `effectiveRcModel` and `op=public-model-assert` report the agent's
|
|
3022
|
+
// config.json model for a session whose command carries the re-seat model —
|
|
3023
|
+
// a false green on the surface this task added to catch false greens.
|
|
3024
|
+
const publicModel = rcRole === 'public' && forkFromSessionId === null
|
|
3025
|
+
? resolvePublicSpawnModel(effectiveAccountDir, rcAgentSlug)
|
|
3026
|
+
: null;
|
|
3027
|
+
if (publicModel?.rejected) {
|
|
3028
|
+
// An operator wrote a model id that is not selectable. Emitted before the
|
|
3029
|
+
// resolution line so the pair reads as cause then consequence.
|
|
3030
|
+
deps.logger(`[rc-spawn] op=public-model-rejected sessionId=${sessionId ? sessionId.slice(0, 8) : 'new'} value=${publicModel.rejected.value} from=${publicModel.rejected.from} reason=not-selectable`);
|
|
3031
|
+
}
|
|
3032
|
+
if (publicModel) {
|
|
3033
|
+
// Emitted on EVERY public spawn, including the one that resolves nothing:
|
|
3034
|
+
// `source=settings` is a positive line rather than a silence, which is
|
|
3035
|
+
// exactly what this failure had for a day.
|
|
3036
|
+
deps.logger(`[rc-spawn] op=public-model sessionId=${sessionId ? sessionId.slice(0, 8) : 'new'} slug=${rcAgentSlug ?? 'none'} resolved=${publicModel.model ?? 'none'} source=${publicModel.source}`);
|
|
3037
|
+
}
|
|
2999
3038
|
// Task 1392 — resolve whether this spawn runs under the WhatsApp Sonnet-5/max
|
|
3000
3039
|
// override, for BOTH the argv and the reported launch params below. Only
|
|
3001
3040
|
// sessions BORN under the override adopt it, so an existing Opus-born WhatsApp
|
|
@@ -3052,6 +3091,12 @@ export function buildHttpApp(deps) {
|
|
|
3052
3091
|
// (reseatModel null) leaves the settings.json default model in force.
|
|
3053
3092
|
if (whatsappSonnetSpawn)
|
|
3054
3093
|
argv.push('--model', WHATSAPP_ADMIN_MODEL);
|
|
3094
|
+
// Task 2452 — a public spawn carries its agent's own model. The three
|
|
3095
|
+
// gates are mutually exclusive: both admin arms require rcRole==='admin'
|
|
3096
|
+
// (whatsappSonnetSpawn on the fresh branch, freshAdminLevers always), so
|
|
3097
|
+
// ordering here carries no precedence decision.
|
|
3098
|
+
else if (publicModel?.model)
|
|
3099
|
+
argv.push('--model', publicModel.model);
|
|
3055
3100
|
else if (freshAdminLevers && reseatModel)
|
|
3056
3101
|
argv.push('--model', reseatModel);
|
|
3057
3102
|
}
|
|
@@ -3661,11 +3706,18 @@ export function buildHttpApp(deps) {
|
|
|
3661
3706
|
// Task 969 — a fresh new-session spawn carrying picked levers runs under
|
|
3662
3707
|
// them too (not just a fork), so the sidecar + lifeline + the /chat params
|
|
3663
3708
|
// row report the model/effort the session actually launched on.
|
|
3709
|
+
// Task 2452 — a public spawn's resolved model, so the op=argv line, the
|
|
3710
|
+
// classification sidecar and the lifeline name the model the session
|
|
3711
|
+
// actually launched on instead of the settings default it no longer uses.
|
|
3712
|
+
// Null model (nothing declared) falls through to the settings read, which
|
|
3713
|
+
// is what that spawn genuinely runs under.
|
|
3664
3714
|
const effectiveRcModel = whatsappSonnetSpawn
|
|
3665
3715
|
? WHATSAPP_ADMIN_MODEL
|
|
3666
|
-
:
|
|
3667
|
-
?
|
|
3668
|
-
:
|
|
3716
|
+
: publicModel?.model
|
|
3717
|
+
? publicModel.model
|
|
3718
|
+
: (forkFromSessionId !== null || freshAdminLevers) && reseatModel
|
|
3719
|
+
? reseatModel
|
|
3720
|
+
: resolveSettingsModel(deps.claudeConfigDir);
|
|
3669
3721
|
// Task 970 — the fork path reports its 4-level effort; the fresh path reports
|
|
3670
3722
|
// its 5-level pick (incl. `max`). Falls back to the settings-resolved effort
|
|
3671
3723
|
// when neither path carries one (absent on a fork, invalid/absent on a fresh).
|
|
@@ -3723,6 +3775,15 @@ export function buildHttpApp(deps) {
|
|
|
3723
3775
|
.split(',')
|
|
3724
3776
|
.filter((t) => t.length > 0).length,
|
|
3725
3777
|
}));
|
|
3778
|
+
// Task 2452 — argv is final here. A resolved model that never reached the
|
|
3779
|
+
// command is the 725731df9 regression class, and it is invisible on every
|
|
3780
|
+
// other surface: the resolution line still reads healthy, the spawn still
|
|
3781
|
+
// succeeds, and only the session's own JSONL says which model it ran. This
|
|
3782
|
+
// pair (`resolved` non-none with `argvHasModel=false`) is that state,
|
|
3783
|
+
// greppable without a repro.
|
|
3784
|
+
if (publicModel) {
|
|
3785
|
+
deps.logger(`[rc-spawn] op=public-model-assert sessionId=${sessionId ? sessionId.slice(0, 8) : 'new'} resolved=${publicModel.model ?? 'none'} argvHasModel=${argv.includes('--model')}`);
|
|
3786
|
+
}
|
|
3726
3787
|
deps.logger(`[rc-spawn] op=argv unitToken=${unitToken} cwd=${effectiveAccountDir} permissionMode=${effectiveRcPermissionMode} model=${effectiveRcModel ?? 'unset'} effort=${effectiveRcEffort ?? 'unset'} positionalBytes=${positionalBytes} voiceBytes=${voiceBytes} argv=${JSON.stringify([deps.claudeBin, ...argv])}`);
|
|
3727
3788
|
emitRcLife(deps.logger, 'argv', 'rc-spawn', 'node-pty', rcLifeMode, unitToken, {
|
|
3728
3789
|
cwd: effectiveAccountDir,
|