@cynodia/axiom-agent-api 0.8.0-alpha.1 → 0.8.1-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 +8 -0
- package/dist/queries.js +22 -1
- package/package.json +2 -2
package/dist/queries.d.ts
CHANGED
|
@@ -122,6 +122,14 @@ export declare class GraphQueries {
|
|
|
122
122
|
getTimedTriggers(): TriggerDef[];
|
|
123
123
|
/** Events at least one trigger reacts to — the external/internal facts this application listens for. */
|
|
124
124
|
getWebhookEvents(): EventDef[];
|
|
125
|
+
/** Whether an ordinary client `InvokeRequest` may name this action at all. */
|
|
126
|
+
isClientInvocable(actionId: NodeId): boolean;
|
|
127
|
+
/** Whether this action accepts only trigger-, event- or effect-outcome-originated calls. */
|
|
128
|
+
isSystemOnly(actionId: NodeId): boolean;
|
|
129
|
+
/** Every action reachable only through a trigger, event or effect outcome — never a client. */
|
|
130
|
+
getSystemOnlyActions(): ActionDef[];
|
|
131
|
+
/** Triggers whose target action cannot accept the `'system'`-sourced invocation the trigger always makes. */
|
|
132
|
+
getTriggersTargetingClientOnlyActions(): TriggerDef[];
|
|
125
133
|
protected enclosingViews(id: NodeId): ViewNode[];
|
|
126
134
|
private resolve;
|
|
127
135
|
}
|
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'];
|
|
@@ -402,6 +402,27 @@ export class GraphQueries {
|
|
|
402
402
|
.map((trigger) => trigger.when.eventId));
|
|
403
403
|
return this.graph.getNodesByKind('event').filter((event) => referenced.has(event.id));
|
|
404
404
|
}
|
|
405
|
+
/** Whether an ordinary client `InvokeRequest` may name this action at all. */
|
|
406
|
+
isClientInvocable(actionId) {
|
|
407
|
+
const action = this.graph.getNode(actionId);
|
|
408
|
+
return action?.kind === 'action' ? actionIsClientInvocable(action) : false;
|
|
409
|
+
}
|
|
410
|
+
/** Whether this action accepts only trigger-, event- or effect-outcome-originated calls. */
|
|
411
|
+
isSystemOnly(actionId) {
|
|
412
|
+
const action = this.graph.getNode(actionId);
|
|
413
|
+
return action?.kind === 'action' ? isSystemOnlyAction(action) : false;
|
|
414
|
+
}
|
|
415
|
+
/** Every action reachable only through a trigger, event or effect outcome — never a client. */
|
|
416
|
+
getSystemOnlyActions() {
|
|
417
|
+
return this.graph.getNodesByKind('action').filter((action) => isSystemOnlyAction(action));
|
|
418
|
+
}
|
|
419
|
+
/** Triggers whose target action cannot accept the `'system'`-sourced invocation the trigger always makes. */
|
|
420
|
+
getTriggersTargetingClientOnlyActions() {
|
|
421
|
+
return this.graph.getNodesByKind('trigger').filter((trigger) => {
|
|
422
|
+
const action = this.graph.getNode(trigger.actionId);
|
|
423
|
+
return action?.kind === 'action' && !allowedInvocationSources(action).includes('system');
|
|
424
|
+
});
|
|
425
|
+
}
|
|
405
426
|
enclosingViews(id) {
|
|
406
427
|
const node = this.graph.getNode(id);
|
|
407
428
|
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.
|
|
3
|
+
"version": "0.8.1-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.
|
|
34
|
+
"@cynodia/axiom-core": "0.8.1-alpha.1"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "tsc -b tsconfig.json tsconfig.test.json",
|