@kody-ade/kody-engine 0.4.523 → 0.4.524

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.
Files changed (2) hide show
  1. package/dist/bin/kody.js +21 -5
  2. package/package.json +1 -1
package/dist/bin/kody.js CHANGED
@@ -15,7 +15,7 @@ var init_package = __esm({
15
15
  "package.json"() {
16
16
  package_default = {
17
17
  name: "@kody-ade/kody-engine",
18
- version: "0.4.523",
18
+ version: "0.4.524",
19
19
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative implementation profiles.",
20
20
  license: "MIT",
21
21
  type: "module",
@@ -2697,6 +2697,7 @@ function requireTenant(tenantId2) {
2697
2697
  }
2698
2698
  function requireChatTenant(tenantId2) {
2699
2699
  const value = tenantId2.trim();
2700
+ if (/^user:\d+$/.test(value)) return value;
2700
2701
  return value === "global" ? value : requireTenant(value);
2701
2702
  }
2702
2703
  function requireNonEmpty(value, name) {
@@ -18142,7 +18143,8 @@ var init_publishReport = __esm({
18142
18143
  if (!publication) return;
18143
18144
  const result = latestResult(ctx.data.capabilityResults, agentResult);
18144
18145
  const stateData = recordField4(recordField4(ctx.data.nextJobState)?.data) ?? {};
18145
- const data = { ...stateData, ...result?.facts ?? {} };
18146
+ const capabilityFacts = recordField4(recordField4(ctx.data.capabilityOutput)?.facts) ?? {};
18147
+ const data = { ...stateData, ...result?.facts ?? {}, ...capabilityFacts };
18146
18148
  if (publication.publishWhenFact && resolveDotted(data, publication.publishWhenFact) === void 0) return;
18147
18149
  const slug = publication.slug ?? stringValue5(resolveDotted(data, publication.slugFact));
18148
18150
  if (!slug || !SAFE_SLUG.test(slug)) return;
@@ -27249,12 +27251,22 @@ function tryLoadConfig(cwd) {
27249
27251
  return null;
27250
27252
  }
27251
27253
  }
27254
+ function conversationTenantId(dashboardUrl) {
27255
+ if (!dashboardUrl) return void 0;
27256
+ try {
27257
+ const value = new URL(dashboardUrl).searchParams.get("conversationTenantId")?.trim();
27258
+ return value && /^user:\d+$/.test(value) ? value : void 0;
27259
+ } catch {
27260
+ return void 0;
27261
+ }
27262
+ }
27252
27263
  function buildSink(cwd, sessionId, dashboardUrl) {
27253
27264
  const backend = createStateBackendFromEnv();
27265
+ const tenantId2 = conversationTenantId(dashboardUrl) ?? "global";
27254
27266
  const sinks = [
27255
27267
  new BackendEventSink(
27256
- (tenantId2, targetSessionId, event) => backend.appendChatEvent(tenantId2, targetSessionId, event),
27257
- "global",
27268
+ (tenantId3, targetSessionId, event) => backend.appendChatEvent(tenantId3, targetSessionId, event),
27269
+ tenantId2,
27258
27270
  sessionId
27259
27271
  ),
27260
27272
  new FileSink(eventsFilePath(cwd, sessionId))
@@ -27332,7 +27344,11 @@ ${CHAT_HELP}`);
27332
27344
  process.stdout.write(`\u2192 kody:chat: litellm proxy ready (url=${litellm?.url ?? "skipped"})
27333
27345
  `);
27334
27346
  const sessionFile = sessionFilePath(cwd, sessionId);
27335
- const store = createSessionStore({ sessionId, sessionFile });
27347
+ const store = createSessionStore({
27348
+ sessionId,
27349
+ sessionFile,
27350
+ tenantId: conversationTenantId(args.dashboardUrl)
27351
+ });
27336
27352
  if (args.initMessage) {
27337
27353
  await store.appendTurn({
27338
27354
  role: "user",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.523",
3
+ "version": "0.4.524",
4
4
  "description": "kody — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative implementation profiles.",
5
5
  "license": "MIT",
6
6
  "type": "module",