@jungjaehoon/mama-os 0.41.0 → 0.42.0

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 (44) hide show
  1. package/dist/agent/gateway-tool-executor.d.ts.map +1 -1
  2. package/dist/agent/gateway-tool-executor.js +11 -0
  3. package/dist/agent/gateway-tool-executor.js.map +1 -1
  4. package/dist/api/graph-api.d.ts.map +1 -1
  5. package/dist/api/graph-api.js +23 -4
  6. package/dist/api/graph-api.js.map +1 -1
  7. package/dist/cli/commands/start.d.ts.map +1 -1
  8. package/dist/cli/commands/start.js +45 -0
  9. package/dist/cli/commands/start.js.map +1 -1
  10. package/dist/cli/runtime/mama-core-init.d.ts.map +1 -1
  11. package/dist/cli/runtime/mama-core-init.js +2 -0
  12. package/dist/cli/runtime/mama-core-init.js.map +1 -1
  13. package/dist/gateways/context-injector.d.ts +10 -0
  14. package/dist/gateways/context-injector.d.ts.map +1 -1
  15. package/dist/gateways/context-injector.js.map +1 -1
  16. package/dist/gateways/message-router.d.ts +4 -0
  17. package/dist/gateways/message-router.d.ts.map +1 -1
  18. package/dist/gateways/message-router.js +86 -2
  19. package/dist/gateways/message-router.js.map +1 -1
  20. package/dist/operator/learning-context.d.ts +49 -0
  21. package/dist/operator/learning-context.d.ts.map +1 -0
  22. package/dist/operator/learning-context.js +129 -0
  23. package/dist/operator/learning-context.js.map +1 -0
  24. package/dist/operator/learning-markers.d.ts +19 -0
  25. package/dist/operator/learning-markers.d.ts.map +1 -0
  26. package/dist/operator/learning-markers.js +147 -0
  27. package/dist/operator/learning-markers.js.map +1 -0
  28. package/dist/operator/learning-read.d.ts +16 -0
  29. package/dist/operator/learning-read.d.ts.map +1 -0
  30. package/dist/operator/learning-read.js +18 -0
  31. package/dist/operator/learning-read.js.map +1 -0
  32. package/dist/operator/owner-event-prompt.d.ts +2 -0
  33. package/dist/operator/owner-event-prompt.d.ts.map +1 -1
  34. package/dist/operator/owner-event-prompt.js +1 -0
  35. package/dist/operator/owner-event-prompt.js.map +1 -1
  36. package/dist/operator/turn-observer.d.ts +34 -0
  37. package/dist/operator/turn-observer.d.ts.map +1 -0
  38. package/dist/operator/turn-observer.js +79 -0
  39. package/dist/operator/turn-observer.js.map +1 -0
  40. package/dist/operator/workorder-consumer.d.ts +5 -0
  41. package/dist/operator/workorder-consumer.d.ts.map +1 -1
  42. package/dist/operator/workorder-consumer.js +8 -1
  43. package/dist/operator/workorder-consumer.js.map +1 -1
  44. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"graph-api.d.ts","sourceRoot":"","sources":["../../src/api/graph-api.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAqDH,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EAET,cAAc,EACd,mBAAmB,EAGnB,cAAc,EACf,MAAM,sBAAsB,CAAC;AA8C9B,QAAA,MAAM,cAAc,QAAO,MAAwD,CAAC;AACpF,QAAA,MAAM,aAAa,QAAO,MAAuD,CAAC;AAclF,QAAA,MAAM,mBAAmB,MAAM,CAAC;AA8DhC,iBAAS,4BAA4B,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CA4ErF;AAqFD,KAAK,gBAAgB,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAUF,iBAAS,yBAAyB,CAAC,GAAG,EAAE,gBAAgB,GAAG,SAAS,CASnE;AAED,iBAAS,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAgB/D;AAED,iBAAS,cAAc,CAAC,KAAK,EAAE;IA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OAAO,CAAC,SAAS,EAAE,CAAC,CAmBtE;AAqDD,iBAAe,WAAW,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,CA0BjD;AAWD,iBAAe,iBAAiB,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAiC5D;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,CAGrD;AAED,iBAAS,kBAAkB,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,CAE1E;AAED,iBAAS,kBAAkB,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAG/E;AAgsBD,iBAAS,kBAAkB,CAAC,OAAO,GAAE,mBAAwB,GAAG,cAAc,CAgyC7E;AAguBD,iBAAS,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,EAAE,CAmGnE;AAm3BD,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,4BAA4B,EAC5B,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,aAAa,GACd,CAAC;AAEF,YAAY,EACV,SAAS,EACT,SAAS,EACT,cAAc,EACd,cAAc,EACd,mBAAmB,GACpB,MAAM,sBAAsB,CAAC"}
@@ -24,6 +24,7 @@ exports.getUniqueTopics = getUniqueTopics;
24
24
  exports.filterNodesByTopic = filterNodesByTopic;
25
25
  exports.filterEdgesByNodes = filterEdgesByNodes;
26
26
  const fs_1 = __importDefault(require("fs"));
27
+ const learning_context_js_1 = require("../operator/learning-context.js");
27
28
  const path_1 = __importDefault(require("path"));
28
29
  const os_1 = __importDefault(require("os"));
29
30
  const js_yaml_1 = __importDefault(require("js-yaml"));
@@ -844,6 +845,16 @@ async function handleMamaSearchRequest(_req, res, params) {
844
845
  async function handleMamaSaveRequest(req, res) {
845
846
  try {
846
847
  const body = await readBody(req);
848
+ if ((0, learning_context_js_1.isLearningTopic)(body.topic)) {
849
+ // Same choke as the gateway and /graph/ingest: standing policy is host-written only.
850
+ res.writeHead(400, { 'Content-Type': 'application/json' });
851
+ res.end(JSON.stringify({
852
+ success: false,
853
+ code: 'learning_topic_refused',
854
+ error: 'topic may not start with policy: or lesson:',
855
+ }));
856
+ return;
857
+ }
847
858
  if (!body.topic || !body.decision || !body.reasoning) {
848
859
  res.writeHead(400, { 'Content-Type': 'application/json' });
849
860
  res.end(JSON.stringify({
@@ -1240,6 +1251,17 @@ function createGraphHandler(options = {}) {
1240
1251
  }
1241
1252
  // eslint-disable-next-line @typescript-eslint/no-require-imports
1242
1253
  const { ingestConversation } = require('@jungjaehoon/mama-core');
1254
+ if ((0, learning_context_js_1.isLearningTopic)(body.topicPrefix)) {
1255
+ // policy:/lesson: rows are injected into every later turn as owner instructions;
1256
+ // only the host turn observer writes them (same refusal as the gateway).
1257
+ res.writeHead(400, { 'Content-Type': 'application/json' });
1258
+ res.end(JSON.stringify({
1259
+ success: false,
1260
+ code: 'learning_topic_refused',
1261
+ error: 'topicPrefix may not start with policy: or lesson:',
1262
+ }));
1263
+ return true;
1264
+ }
1243
1265
  const source = body.source || {
1244
1266
  package: 'standalone',
1245
1267
  source_type: 'api',
@@ -2448,10 +2470,7 @@ async function handleUpdateConfigRequest(req, res, options = {}) {
2448
2470
  }));
2449
2471
  return;
2450
2472
  }
2451
- (0, backend_model_policy_js_1.emitBackendModelWarnings)([
2452
- ...modelPolicyEntries.changes,
2453
- ...modelPolicyEntries.warnings,
2454
- ]);
2473
+ (0, backend_model_policy_js_1.emitBackendModelWarnings)([...modelPolicyEntries.changes, ...modelPolicyEntries.warnings]);
2455
2474
  saveMAMAConfig(updatedConfig);
2456
2475
  if (updatedConfig.multi_agent && options.applyMultiAgentConfig) {
2457
2476
  try {