32 lines
1.5 KiB
Plaintext
32 lines
1.5 KiB
Plaintext
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;
|
|
}
|
|
}
|