@cynodia/axiom-agent-api 0.8.0-alpha.1 → 0.8.2-alpha.1

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/dist/queries.d.ts CHANGED
@@ -120,8 +120,34 @@ export declare class GraphQueries {
120
120
  };
121
121
  /** Triggers that fire on a schedule rather than on an event or a lifecycle moment. */
122
122
  getTimedTriggers(): TriggerDef[];
123
- /** Events at least one trigger reacts to — the external/internal facts this application listens for. */
123
+ /**
124
+ * Events at least one trigger reacts to — the internal/external facts this application
125
+ * listens for.
126
+ *
127
+ * This is a **graph-static** query: it answers "which `EventDef`s have a `TriggerDef`
128
+ * bound to them", not "which webhook deliveries has this server received". An event
129
+ * returned here may be dispatched by a verified external webhook, by an effect's
130
+ * `succeededEventId`/`failedEventId`, or by any other internal source — "webhook-ness" is
131
+ * not a property the graph records, so a name implying it overstates what this answers
132
+ * (spec 8.2 §34-35).
133
+ */
134
+ getTriggeredEvents(): EventDef[];
135
+ /**
136
+ * @deprecated Renamed to {@link getTriggeredEvents} (spec 8.2 §34-36): this answers
137
+ * "which events have a trigger bound to them", not "which webhook deliveries were
138
+ * received" — the two are not the same, since the same query covers effect-outcome
139
+ * events too. Kept as an alias for backward compatibility; new code should call
140
+ * `getTriggeredEvents()` directly.
141
+ */
124
142
  getWebhookEvents(): EventDef[];
143
+ /** Whether an ordinary client `InvokeRequest` may name this action at all. */
144
+ isClientInvocable(actionId: NodeId): boolean;
145
+ /** Whether this action accepts only trigger-, event- or effect-outcome-originated calls. */
146
+ isSystemOnly(actionId: NodeId): boolean;
147
+ /** Every action reachable only through a trigger, event or effect outcome — never a client. */
148
+ getSystemOnlyActions(): ActionDef[];
149
+ /** Triggers whose target action cannot accept the `'system'`-sourced invocation the trigger always makes. */
150
+ getTriggersTargetingClientOnlyActions(): TriggerDef[];
125
151
  protected enclosingViews(id: NodeId): ViewNode[];
126
152
  private resolve;
127
153
  }
package/dist/queries.js CHANGED
@@ -1,4 +1,4 @@
1
- import { isUINode, locationFieldIds, locationRootStateId, locationSelectorFieldIds, referencedIds, } from '@cynodia/axiom-core';
1
+ import { allowedInvocationSources, isClientInvocable as actionIsClientInvocable, isSystemOnlyAction, isUINode, locationFieldIds, locationRootStateId, locationSelectorFieldIds, referencedIds, } from '@cynodia/axiom-core';
2
2
  const READ_KINDS = ['reads', 'binds', 'derives-from'];
3
3
  const WRITE_KINDS = ['writes'];
4
4
  const CONTAINMENT_KINDS = ['contains', 'renders'];
@@ -394,14 +394,55 @@ export class GraphQueries {
394
394
  .getNodesByKind('trigger')
395
395
  .filter((trigger) => trigger.when.kind === 'interval' || trigger.when.kind === 'delay');
396
396
  }
397
- /** Events at least one trigger reacts to — the external/internal facts this application listens for. */
398
- getWebhookEvents() {
397
+ /**
398
+ * Events at least one trigger reacts to — the internal/external facts this application
399
+ * listens for.
400
+ *
401
+ * This is a **graph-static** query: it answers "which `EventDef`s have a `TriggerDef`
402
+ * bound to them", not "which webhook deliveries has this server received". An event
403
+ * returned here may be dispatched by a verified external webhook, by an effect's
404
+ * `succeededEventId`/`failedEventId`, or by any other internal source — "webhook-ness" is
405
+ * not a property the graph records, so a name implying it overstates what this answers
406
+ * (spec 8.2 §34-35).
407
+ */
408
+ getTriggeredEvents() {
399
409
  const referenced = new Set(this.graph
400
410
  .getNodesByKind('trigger')
401
411
  .filter((trigger) => trigger.when.kind === 'event')
402
412
  .map((trigger) => trigger.when.eventId));
403
413
  return this.graph.getNodesByKind('event').filter((event) => referenced.has(event.id));
404
414
  }
415
+ /**
416
+ * @deprecated Renamed to {@link getTriggeredEvents} (spec 8.2 §34-36): this answers
417
+ * "which events have a trigger bound to them", not "which webhook deliveries were
418
+ * received" — the two are not the same, since the same query covers effect-outcome
419
+ * events too. Kept as an alias for backward compatibility; new code should call
420
+ * `getTriggeredEvents()` directly.
421
+ */
422
+ getWebhookEvents() {
423
+ return this.getTriggeredEvents();
424
+ }
425
+ /** Whether an ordinary client `InvokeRequest` may name this action at all. */
426
+ isClientInvocable(actionId) {
427
+ const action = this.graph.getNode(actionId);
428
+ return action?.kind === 'action' ? actionIsClientInvocable(action) : false;
429
+ }
430
+ /** Whether this action accepts only trigger-, event- or effect-outcome-originated calls. */
431
+ isSystemOnly(actionId) {
432
+ const action = this.graph.getNode(actionId);
433
+ return action?.kind === 'action' ? isSystemOnlyAction(action) : false;
434
+ }
435
+ /** Every action reachable only through a trigger, event or effect outcome — never a client. */
436
+ getSystemOnlyActions() {
437
+ return this.graph.getNodesByKind('action').filter((action) => isSystemOnlyAction(action));
438
+ }
439
+ /** Triggers whose target action cannot accept the `'system'`-sourced invocation the trigger always makes. */
440
+ getTriggersTargetingClientOnlyActions() {
441
+ return this.graph.getNodesByKind('trigger').filter((trigger) => {
442
+ const action = this.graph.getNode(trigger.actionId);
443
+ return action?.kind === 'action' && !allowedInvocationSources(action).includes('system');
444
+ });
445
+ }
405
446
  enclosingViews(id) {
406
447
  const node = this.graph.getNode(id);
407
448
  const self = node && node.kind === 'view' ? [node] : [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cynodia/axiom-agent-api",
3
- "version": "0.8.0-alpha.1",
3
+ "version": "0.8.2-alpha.1",
4
4
  "description": "Semantic queries and transactional graph transformations for AI agents.",
5
5
  "license": "MIT",
6
6
  "author": "AskTech AS",
@@ -31,7 +31,7 @@
31
31
  }
32
32
  },
33
33
  "dependencies": {
34
- "@cynodia/axiom-core": "0.8.0-alpha.1"
34
+ "@cynodia/axiom-core": "0.8.2-alpha.1"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "tsc -b tsconfig.json tsconfig.test.json",