Generate typed asynchronous service capability bindings

This commit is contained in:
Timothy J. Aveni
2026-09-20 20:35:16 -07:00
parent 21502ed023
commit c4ae58831d
13 changed files with 192 additions and 21 deletions
+10
View File
@@ -0,0 +1,10 @@
external atom Document id "async:document";
import interface DocumentData;
import interface Summarizer;
package ControllerRuntime id "async:controller-runtime" revision "async:controller-runtime@1" {
operation refresh id "async:controller:refresh" : record { operationId: string; } -> string
mode call execution remote receiver atom Document requires {
interface document id "async:controller:document" : DocumentData using [content.get, summary.set];
interface provider id "async:controller:provider" : Summarizer using [summarize.call];
};
}
+10
View File
@@ -0,0 +1,10 @@
type Summary = record { text: string; basedOn: string; };
interface DocumentData id "async:document-data" revision "async:document-data@1" {
queryable value content id "async:content" : string {
get id "async:content:get" execution snapshot targets [browser, server];
}
queryable value summary id "async:summary" : Summary {
get id "async:summary:get" execution snapshot targets [browser, server];
set id "async:summary:set" execution transaction targets [browser, server];
}
}
+5
View File
@@ -0,0 +1,5 @@
external atom Provider id "async:provider";
package ProviderRuntime id "async:provider-runtime" revision "async:provider-runtime@2" {
operation summarize id "async:provider:summarize" : string -> string
mode call execution remote receiver atom Provider;
}
+5
View File
@@ -0,0 +1,5 @@
interface Summarizer id "async:summarizer" revision "async:summarizer@1" {
operation summarize id "async:summarize" : string -> string {
call id "async:summarize:call" execution remote;
}
}
+5
View File
@@ -0,0 +1,5 @@
interface SummaryController id "async:controller" revision "async:controller@1" {
operation refresh id "async:refresh" : record { operationId: string; } -> string {
call id "async:refresh:call" execution remote;
}
}
+31
View File
@@ -0,0 +1,31 @@
workspace AsyncObjects id "workspace:async" revision "workspace:async@1" commit "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" {
import interface DocumentData;
import interface SummaryController;
import interface Summarizer;
import package ControllerRuntime;
import package ProviderRuntime;
atom Document id "async:document";
atom Provider id "async:provider";
conform Document as DocumentData id "async:document:data" {
private state Content id "async:state:content" on Document : string policy register;
private state Summary id "async:state:summary" on Document : record { text: string; basedOn: string; }
policy register default { "text": "", "basedOn": "" };
private edge ProviderLink id "async:provider-link" {
atom Document projection provider id "async:provider-projection" exactly-one public-traversal;
atom Provider projection documents id "async:documents-projection" many-unique;
}
initialize { content to state Content; provider to edge ProviderLink.provider; };
bind content.get to state Content.read;
bind summary.get to state Summary.read;
bind summary.set to state Summary.write;
}
conform Document as SummaryController id "async:document:controller" {
bind refresh.call to package ControllerRuntime.refresh with {
document to interface DocumentData;
provider to interface Summarizer via edge ProviderLink.provider;
};
}
conform Provider as Summarizer id "async:provider:summarizer" {
bind summarize.call to package ProviderRuntime.summarize;
}
}