From 1cd582332c577fd9947ae50a152a807dfd6ed649 Mon Sep 17 00:00:00 2001 From: Quixos Template Publisher Date: Sat, 1 Jan 2000 00:00:00 +0000 Subject: [PATCH] Export template source from 11bc3ae35b0034c113daca4c35d1b341aa31ef70:examples/local-first/workspaces/language-reader-studio --- .quixos-template-source.json | 4 + agents.qx | 208 +++++++++++++++++++++++++++++++++++ books.qx | 19 ++++ events.qx | 21 ++++ navigation.qx | 43 ++++++++ presentation/model.qx | 62 +++++++++++ presentation/react.qx | 6 + quixos.check.json | 1 + quixos.entry.json | 5 + quixos.lock | 59 ++++++++++ reading.qx | 163 +++++++++++++++++++++++++++ resources.json | 64 +++++++++++ studio/factory-rules.qx | 15 +++ workspace.qx | 106 ++++++++++++++++++ 14 files changed, 776 insertions(+) create mode 100644 .quixos-template-source.json create mode 100644 agents.qx create mode 100644 books.qx create mode 100644 events.qx create mode 100644 navigation.qx create mode 100644 presentation/model.qx create mode 100644 presentation/react.qx create mode 100644 quixos.check.json create mode 100644 quixos.entry.json create mode 100644 quixos.lock create mode 100644 reading.qx create mode 100644 resources.json create mode 100644 studio/factory-rules.qx create mode 100644 workspace.qx diff --git a/.quixos-template-source.json b/.quixos-template-source.json new file mode 100644 index 0000000..247c890 --- /dev/null +++ b/.quixos-template-source.json @@ -0,0 +1,4 @@ +{ + "monorepoCommit": "11bc3ae35b0034c113daca4c35d1b341aa31ef70", + "sourcePath": "examples/local-first/workspaces/language-reader-studio" +} diff --git a/agents.qx b/agents.qx new file mode 100644 index 0000000..46b765f --- /dev/null +++ b/agents.qx @@ -0,0 +1,208 @@ +fragment { + import package AgentPresentation; + import "presentation/model.qx"; + + type AgentSubmission = record {text:string;data:optional;profile:optional;response:optional;sourceKind:string;sourceLabel:string;publication:optional;createdAt:string;contexts:list>;related:optional>;retryOf:optional>;root:optional>;causalDepth:uint32;}; + type AgentAdmission = record {accepted:bool;reason:optional;thread:optional>;request:optional>;}; + type DirectoryData = record {sequence:uint64;pending:uint32;ordinaryPending:uint32;notificationPending:uint32;profiles:string;availability:string;}; + type ThreadData = record {title:string;kind:string;archived:bool;sequence:uint64;pending:uint32;nextItem:uint64;updatedAt:string;}; + type AgentData = record {name:string;description:string;enabled:bool;settings:string;}; + type RequestData = record {text:string;data:optional;configuration:string;configurationDigest:string;responseKind:string;sequence:uint64;createdAt:string;sourceKind:string;sourceLabel:string;publication:optional;causalDepth:uint32;interactive:bool;}; + type RequestState = record {status:string;attempt:string;generation:uint32;reason:string;result:optional;rawOutput:optional;usage:optional;startedAt:optional;endedAt:optional;cancelRequested:bool;retryCount:uint32;notificationPending:bool;}; + type ItemData = record {key:string;kind:string;text:string;phase:string;activity:optional;presentation:optional;sequence:uint64;version:uint64;createdAt:string;updatedAt:string;control:optional;}; + type QuestionData = record {key:string;title:string;options:string;status:string;answer:optional;createdAt:string;expiresAt:string;attempt:string;generation:uint32;}; + + import interface AgentWorkspace; + import interface AgentDirectory; + import interface Agent; + import interface AgentThread; + import interface AgentRequest; + import interface AgentItem; + import interface AgentQuestion; + import interface AgentContextSubject; + import package AgentRuntime; + atom AgentDirectoryObject id "atom:org.quixos.agent:directory"; + atom AgentObject id "atom:org.quixos.agent:agent"; + atom AgentThreadObject id "atom:org.quixos.agent:thread"; + atom AgentRequestObject id "atom:org.quixos.agent:request"; + atom AgentItemObject id "atom:org.quixos.agent:item"; + atom AgentQuestionObject id "atom:org.quixos.agent:question"; + atom AgentCompletionStreamObject id "atom:org.quixos.agent:completion-stream"; + type AgentCompletion = record {request:atom-ref;thread:atom-ref;status:string;}; + conform Canvas as AgentWorkspace id "agent:conformance:workspace" { + private edge Linkworkspaceagents id "agent:workspace:agents:edge" {atom Canvas projection agents id "agent:workspace:agents:projection" optional-one on-delete "detach" public-traversal;atom AgentDirectoryObject projection workspaces id "agent:directory:workspaces:projection" many on-delete "detach" public-traversal;} + bind agents.resolve to edge Linkworkspaceagents.agents.resolve; + bind install.call to package AgentRuntime.workspace_install with {agents to edge Linkworkspaceagents.agents; + create_directory to creation AgentDirectoryObject with {AgentDirectory from input;}; + directory to interface AgentDirectory from input;}; + } + conform AgentDirectoryObject as AgentDirectory id "agent:conformance:directory" { + private state directorydata id "agent:storage:directory:data" on AgentDirectoryObject : DirectoryData policy register; + private edge Linkdirectorypending id "agent:directory:pending:edge" {atom AgentDirectoryObject projection pending id "agent:directory:pending:projection" many-unique on-delete "detach" public-traversal;atom AgentRequestObject projection pendingIn id "agent:request:pendingIn:projection" many on-delete "detach" public-traversal;} + private edge Linkdirectorynotifications id "agent:directory:notifications:edge" {atom AgentDirectoryObject projection notifications id "agent:directory:notifications:projection" many-unique on-delete "detach" public-traversal;atom AgentRequestObject projection notificationIn id "agent:request:notificationIn:projection" many on-delete "detach" public-traversal;} + private edge LinkdirectorydefaultAgent id "agent:directory:defaultAgent:edge" {atom AgentDirectoryObject projection defaultAgent id "agent:directory:defaultAgent:projection" optional-one on-delete "detach" public-traversal;atom AgentObject projection defaultIn id "agent:agent:defaultIn:projection" many on-delete "detach" public-traversal;} + private edge LinkdirectoryinitialThread id "agent:directory:initialThread:edge" {atom AgentDirectoryObject projection initialThread id "agent:directory:initialThread:projection" optional-one on-delete "detach" public-traversal;atom AgentThreadObject projection initialIn id "agent:thread:initialIn:projection" many on-delete "detach" public-traversal;} + private edge Linkdirectoryrepairs id "agent:directory:repairs:edge" {atom AgentDirectoryObject projection repairs id "agent:directory:repairs:projection" many-unique on-delete "detach" keyed "string";atom AgentRequestObject projection repairDirectory id "agent:request:repair-directory:projection" many on-delete "detach";} + initialize {data to state directorydata;}; + bind data.get to state directorydata.read; + bind agents.resolve to edge Linkagentdirectory.agents.resolve; + bind threads.resolve to edge Linkthreaddirectory.threads.resolve; + bind pending.resolve to edge Linkdirectorypending.pending.resolve; + bind notifications.resolve to edge Linkdirectorynotifications.notifications.resolve; + bind defaultAgent.resolve to edge LinkdirectorydefaultAgent.defaultAgent.resolve; + bind initialThread.resolve to edge LinkdirectoryinitialThread.initialThread.resolve; + bind createAgent.call to package AgentRuntime.directory_createAgent with {create_agent to creation AgentObject with {Agent from input;}; + create_stream to creation AgentCompletionStreamObject with {};}; + bind createThread.call to package AgentRuntime.directory_createThread with {data to state directorydata; + create_thread to creation AgentThreadObject with {AgentThread from input;}; + agent to interface Agent from input;}; + bind admit.call to package AgentRuntime.directory_admit with {data to state directorydata; + root to interface AgentRequest from input; + pending to edge Linkdirectorypending.pending; + create_request to creation AgentRequestObject with {AgentRequest from input;}; + create_item to creation AgentItemObject with {AgentItem from input;}; + agent to interface Agent from input; + thread to interface AgentThread from input; + directory to interface AgentDirectory from input;}; + bind reconcileRepair.call to package AgentRuntime.directory_reconcileRepair with {data to state directorydata;repairs to edge Linkdirectoryrepairs.repairs;pending to edge Linkdirectorypending.pending;defaultAgent to edge LinkdirectorydefaultAgent.defaultAgent;initialThread to edge LinkdirectoryinitialThread.initialThread;create_request to creation AgentRequestObject with {AgentRequest from input;};create_item to creation AgentItemObject with {AgentItem from input;};request to interface AgentRequest from input;thread to interface AgentThread from input;}; + bind settle.call to package AgentRuntime.directory_settle with {data to state directorydata; + pending to edge Linkdirectorypending.pending; + notifications to edge Linkdirectorynotifications.notifications; + thread to interface AgentThread from input;}; + bind advertise.call to package AgentRuntime.directory_advertise with {data to state directorydata;}; + bind initialize.call to package AgentRuntime.directory_initialize with {defaultAgent to edge LinkdirectorydefaultAgent.defaultAgent; + initialThread to edge LinkdirectoryinitialThread.initialThread; + directory to interface AgentDirectory from input;}; + bind notificationSent.call to package AgentRuntime.directory_notificationSent with {notifications to edge Linkdirectorynotifications.notifications;data to state directorydata;}; + } + conform AgentObject as Agent id "agent:conformance:agent" { + private state agentdata id "agent:storage:agent:data" on AgentObject : AgentData policy register; + private state agentinstructions id "agent:storage:agent:instructions" on AgentObject : string policy crdt(string); + private edge Linkagentdirectory id "agent:agent:directory:edge" {atom AgentObject projection directory id "agent:agent:directory:projection" exactly-one on-delete "detach" public-traversal;atom AgentDirectoryObject projection agents id "agent:directory:agents:projection" many-unique on-delete "detach" public-traversal;} + private edge Linkagentcompletions id "agent:agent:completions:edge" {atom AgentObject projection completions id "agent:agent:completions:projection" exactly-one on-delete "detach" public-traversal;interface EventStream projection agentOwners id "agent:agent:completions:owners" many on-delete "detach";} + initialize {data to state agentdata;instructions to state agentinstructions;directory to edge Linkagentdirectory.directory;completions to edge Linkagentcompletions.completions;}; + bind data.get to state agentdata.read; + bind instructions.get to state agentinstructions.read; + bind instructions.edit to state agentinstructions.edit; + bind directory.resolve to edge Linkagentdirectory.directory.resolve; + bind threads.resolve to edge Linkthreadagent.threads.resolve; + bind completions.resolve to edge Linkagentcompletions.completions.resolve; + bind update.call to package AgentRuntime.agent_update with {data to state agentdata;}; + bind createThread.call to package AgentRuntime.agent_createThread with {agent to interface Agent from input; + directory to interface AgentDirectory from input;}; + bind request.call to package AgentRuntime.agent_request with {agent to interface Agent from input; + directory to interface AgentDirectory from input;}; + bind tryRequest.call to package AgentRuntime.agent_tryRequest with {agent to interface Agent from input; + directory to interface AgentDirectory from input;}; + } + conform AgentThreadObject as AgentThread id "agent:conformance:thread" { + private state threaddata id "agent:storage:thread:data" on AgentThreadObject : ThreadData policy register; + private edge Linkthreaddirectory id "agent:thread:directory:edge" {atom AgentThreadObject projection directory id "agent:thread:directory:projection" exactly-one on-delete "detach" public-traversal;atom AgentDirectoryObject projection threads id "agent:directory:threads:projection" many-unique on-delete "detach" public-traversal;} + private edge Linkthreadagent id "agent:thread:agent:edge" {atom AgentThreadObject projection agent id "agent:thread:agent:projection" exactly-one on-delete "detach" public-traversal;atom AgentObject projection threads id "agent:agent:threads:projection" many-unique on-delete "detach" public-traversal;} + private edge Linkthreadactive id "agent:thread:active:edge" {atom AgentThreadObject projection active id "agent:thread:active:projection" optional-one on-delete "detach" public-traversal;atom AgentRequestObject projection activeIn id "agent:request:activeIn:projection" many on-delete "detach" public-traversal;} + private edge Linkthreadcontexts id "agent:thread:contexts:edge" {atom AgentThreadObject projection contexts id "agent:thread:contexts:projection" many-unique on-delete "detach" public-traversal;interface AgentContextSubject projection threadOwners id "agent:thread:contexts:owners" many on-delete "detach";} + initialize {data to state threaddata;directory to edge Linkthreaddirectory.directory;agent to edge Linkthreadagent.agent;contexts to edge Linkthreadcontexts.contexts;}; + bind data.get to state threaddata.read; + bind agent.resolve to edge Linkthreadagent.agent.resolve; + bind directory.resolve to edge Linkthreaddirectory.directory.resolve; + bind active.resolve to edge Linkthreadactive.active.resolve; + bind requests.resolve to edge Linkrequestthread.requests.resolve; + bind items.resolve to edge Linkitemthread.items.resolve; + bind contexts.resolve to edge Linkthreadcontexts.contexts.resolve; + bind send.call to package AgentRuntime.thread_send with {thread to interface AgentThread from input; + directory to interface AgentDirectory from input;}; + bind rename.call to package AgentRuntime.thread_rename with {data to state threaddata;}; + bind archive.call to package AgentRuntime.thread_archive with {data to state threaddata;}; + bind activate.call to package AgentRuntime.thread_activate with {active to edge Linkthreadactive.active;}; + bind release.call to package AgentRuntime.thread_release with {active to edge Linkthreadactive.active;}; + bind adjustPending.call to package AgentRuntime.thread_adjustPending with {data to state threaddata;}; + bind allocateItem.call to package AgentRuntime.thread_allocateItem with {data to state threaddata;}; + } + conform AgentRequestObject as AgentRequest id "agent:conformance:request" { + private state requestspawned id "agent:storage:request:spawned" on AgentRequestObject : uint32 policy register; + private state requestprogress id "agent:storage:request:progress" on AgentRequestObject : RequestState policy register; + private state requestadmission id "agent:storage:request:admission" on AgentRequestObject : RequestData policy register; + private edge Linkrequestthread id "agent:request:thread:edge" {atom AgentRequestObject projection thread id "agent:request:thread:projection" exactly-one on-delete "detach" public-traversal;atom AgentThreadObject projection requests id "agent:thread:requests:projection" many-unique on-delete "detach" public-traversal;} + private edge Linkrequestdirectory id "agent:request:directory:edge" {atom AgentRequestObject projection directory id "agent:request:directory:projection" exactly-one on-delete "detach" public-traversal;atom AgentDirectoryObject projection allRequests id "agent:directory:allRequests:projection" many-unique on-delete "detach" public-traversal;} + private edge Linkrequestrelated id "agent:request:related:edge" {atom AgentRequestObject projection related id "agent:request:related:projection" optional-one on-delete "detach" public-traversal;atom AgentRequestObject projection relatedFrom id "agent:request:relatedFrom:projection" many on-delete "detach" public-traversal;} + private edge LinkrequestretryOf id "agent:request:retryOf:edge" {atom AgentRequestObject projection retryOf id "agent:request:retryOf:projection" optional-one on-delete "detach" public-traversal;atom AgentRequestObject projection retries id "agent:request:retries:projection" many on-delete "detach" public-traversal;} + private edge Linkrequestroot id "agent:request:root:edge" {atom AgentRequestObject projection root id "agent:request:root:projection" optional-one on-delete "detach" public-traversal;atom AgentRequestObject projection descendants id "agent:request:descendants:projection" many on-delete "detach" public-traversal;} + private edge Linkrequestcontexts id "agent:request:contexts:edge" {atom AgentRequestObject projection contexts id "agent:request:contexts:projection" many-unique on-delete "detach" public-traversal;interface AgentContextSubject projection requestOwners id "agent:request:contexts:owners" many on-delete "detach";} + initialize {spawned to state requestspawned;admission to state requestadmission;progress to state requestprogress;contexts to edge Linkrequestcontexts.contexts;directory to edge Linkrequestdirectory.directory;thread to edge Linkrequestthread.thread;related to edge Linkrequestrelated.related;retryOf to edge LinkrequestretryOf.retryOf;root to edge Linkrequestroot.root;}; + bind spawned.get to state requestspawned.read; + bind reserveChild.call to package AgentRuntime.request_reserveChild with {spawned to state requestspawned;}; + bind admission.get to state requestadmission.read; + bind progress.get to state requestprogress.read; + bind thread.resolve to edge Linkrequestthread.thread.resolve; + bind directory.resolve to edge Linkrequestdirectory.directory.resolve; + bind items.resolve to edge Linkitemrequest.items.resolve; + bind questions.resolve to edge Linkquestionrequest.questions.resolve; + bind contexts.resolve to edge Linkrequestcontexts.contexts.resolve; + bind related.resolve to edge Linkrequestrelated.related.resolve; + bind retryOf.resolve to edge LinkrequestretryOf.retryOf.resolve; + bind root.resolve to edge Linkrequestroot.root.resolve; + private edge Linkrequestcorrection id "agent:request:correction:edge" {atom AgentRequestObject projection correction id "agent:request:correction:projection" optional-one on-delete "detach";atom AgentRequestObject projection correctionOf id "agent:request:correctionOf:projection" optional-one on-delete "detach";} + bind correct.call to package AgentRuntime.request_correct with {correction to edge Linkrequestcorrection.correction;request to interface AgentRequest from input;thread to interface AgentThread from input;}; + bind claim.call to package AgentRuntime.request_claim with {progress to state requestprogress; + request to interface AgentRequest from input; + thread to interface AgentThread from input;}; + bind transition.call to package AgentRuntime.request_transition with {progress to state requestprogress;}; + bind finish.call to package AgentRuntime.request_finish with {progress to state requestprogress; + admission to state requestadmission; + request to interface AgentRequest from input; + directory to interface AgentDirectory from input; + thread to interface AgentThread from input; + agent to interface Agent from input;}; + bind cancel.call to package AgentRuntime.request_cancel with {progress to state requestprogress; + request to interface AgentRequest from input;}; + bind steer.call to package AgentRuntime.request_steer with {progress to state requestprogress; + request to interface AgentRequest from input; + directory to interface AgentDirectory from input;}; + bind upsertItem.call to package AgentRuntime.request_upsertItem with {progress to state requestprogress; + request to interface AgentRequest from input; + thread to interface AgentThread from input; + item to interface AgentItem from input; + presentable to interface WebStudioPresentable from input; + create_mount to creation PresentationMountRecord with {}; + create_item to creation AgentItemObject with {AgentItem from input;};}; + bind ask.call to package AgentRuntime.request_ask with {progress to state requestprogress; + request to interface AgentRequest from input; + question to interface AgentQuestion from input; + create_question to creation AgentQuestionObject with {AgentQuestion from input;};}; + bind publishCompletion.call to package AgentRuntime.request_publishCompletion with {progress to state requestprogress; + request to interface AgentRequest from input; + thread to interface AgentThread from input; + agent to interface Agent from input; + stream to interface EventStream from input; + directory to interface AgentDirectory from input;}; + } + conform AgentItemObject as AgentItem id "agent:conformance:item" { + private state itemdata id "agent:storage:item:data" on AgentItemObject : ItemData policy register; + private edge Linkitemrequest id "agent:item:request:edge" {atom AgentItemObject projection request id "agent:item:request:projection" exactly-one on-delete "detach" public-traversal;atom AgentRequestObject projection items id "agent:request:items:projection" many-unique on-delete "detach" public-traversal;} + private edge Linkitemthread id "agent:item:thread:edge" {atom AgentItemObject projection thread id "agent:item:thread:projection" exactly-one on-delete "detach" public-traversal;atom AgentThreadObject projection items id "agent:thread:items:projection" many-unique on-delete "detach" public-traversal;} + private edge Linkitemsubject id "agent:item:subject:edge" {atom AgentItemObject projection subject id "agent:item:subject:projection" optional-one on-delete "detach" public-traversal;interface WebStudioPresentable projection itemOwners id "agent:item:subject:owners" many on-delete "detach";} + private edge Linkitemmount id "agent:item:mount:edge" {atom AgentItemObject projection presentationMount id "agent:item:mount:projection" optional-one on-delete "detach" public-traversal;interface PresentationMount projection itemOwners id "agent:item:mount:owners" many on-delete "detach";} + bind presentationMount.resolve to edge Linkitemmount.presentationMount.resolve; + initialize {presentationMount to edge Linkitemmount.presentationMount;data to state itemdata;thread to edge Linkitemthread.thread;request to edge Linkitemrequest.request;subject to edge Linkitemsubject.subject;}; + bind data.get to state itemdata.read; + bind request.resolve to edge Linkitemrequest.request.resolve; + bind thread.resolve to edge Linkitemthread.thread.resolve; + bind subject.resolve to edge Linkitemsubject.subject.resolve; + bind checkpoint.call to package AgentRuntime.item_checkpoint with {data to state itemdata;item to interface AgentItem from input;request to interface AgentRequest from input;}; + } + conform AgentQuestionObject as AgentQuestion id "agent:conformance:question" { + private state questiondata id "agent:storage:question:data" on AgentQuestionObject : QuestionData policy register; + private edge Linkquestionrequest id "agent:question:request:edge" {atom AgentQuestionObject projection request id "agent:question:request:projection" exactly-one on-delete "detach" public-traversal;atom AgentRequestObject projection questions id "agent:request:questions:projection" many-unique on-delete "detach" public-traversal;} + initialize {data to state questiondata;request to edge Linkquestionrequest.request;}; + bind data.get to state questiondata.read; + bind request.resolve to edge Linkquestionrequest.request.resolve; + bind answer.call to package AgentRuntime.question_answer with {data to state questiondata; + question to interface AgentQuestion from input; + request to interface AgentRequest from input;}; + bind cancel.call to package AgentRuntime.question_cancel with {data to state questiondata;}; + } + conform AgentCompletionStreamObject as EventStream id "agent:completion-stream" {private state Entries id "agent:completion:entries" on AgentCompletionStreamObject : AgentCompletion policy journal {"maxEntries":128,"maxBytes":1048576,"maxPublicationBytes":262144,"maxProtectedSubscriptions":32};bind publish.call to journal Entries.publish;bind head.get to journal Entries.head;bind readPage.call to journal Entries.readPage;} + presentation ThreadView id "presentation:org.quixos.agent:thread" for AgentThread using AgentPresentation.Thread; + conform AgentThreadObject as StandaloneView id "agent:thread:view" {bind render to AgentPresentation.Thread;} + conform AgentThreadObject as WebStudioPresentable id "agent:thread:presentable" {bind canPresent.call to package WebStudioCanvasRuntime.canPresent with {catalog to workspace reflection [presentations];};} +} diff --git a/books.qx b/books.qx new file mode 100644 index 0000000..3bf1795 --- /dev/null +++ b/books.qx @@ -0,0 +1,19 @@ +fragment { + import interface GutenbergCatalog; + import package GutenbergRuntime; + atom GutenbergCatalogObject id "atom:gutenberg:catalog"; + conform GutenbergCatalogObject as GutenbergCatalog id "reading:books:catalog" { + private state CatalogName id "reading:books:name" on Self : string policy register; + initialize {name to state CatalogName;}; + bind name.get to state CatalogName.read; + bind create.call to package GutenbergRuntime.create with {catalog to creation GutenbergCatalogObject with {GutenbergCatalog from input;};}; + bind search.call to package GutenbergRuntime.search; + bind readBook.call to package GutenbergRuntime.readBook; + } + conform ReadingLibrary as GutenbergCatalog id "reading:books:source" { + bind name.get to interface LanguageReader.name.get; + bind create.call to package GutenbergRuntime.create with {catalog to creation GutenbergCatalogObject with {GutenbergCatalog from input;};}; + bind search.call to package GutenbergRuntime.search; + bind readBook.call to package GutenbergRuntime.readBook; + } +} diff --git a/events.qx b/events.qx new file mode 100644 index 0000000..df1f9a1 --- /dev/null +++ b/events.qx @@ -0,0 +1,21 @@ +fragment { + import interface EventStream; + import interface EventHandler; + import interface EventSubscription; + import interface EventStreamRecord; + import interface EventSubscriptionRecord; + conform EventStreamRecord as EventStream id "events:standard-stream" { + private state Entries id "events:entries" on Self : Payload policy journal {"maxEntries":128,"maxBytes":1048576,"maxPublicationBytes":262144,"maxProtectedSubscriptions":32}; + bind publish.call to journal Entries.publish; + bind head.get to journal Entries.head; + bind readPage.call to journal Entries.readPage; + } + conform EventSubscriptionRecord as EventSubscription id "events:standard-subscription" { + private state Delivery id "events:delivery" on Self : Parameters policy subscription(Payload); + bind attach.call to subscription Delivery.attach; + bind status.get to subscription Delivery.status; + bind pause.call to subscription Delivery.pause; + bind resume.call to subscription Delivery.resume; + bind retire.call to subscription Delivery.retire; + } +} diff --git a/navigation.qx b/navigation.qx new file mode 100644 index 0000000..9b036b7 --- /dev/null +++ b/navigation.qx @@ -0,0 +1,43 @@ +fragment { + import interface ReadingNavigation; + atom ReadingNavigationObject id "atom:reading:navigation"; + conform ReadingLibrary as PresentationStateFactory id "reading:navigation:factory" { + bind create.call to package LanguageReaderRuntime.createNavigation with {navigation to creation ReadingNavigationObject with {PresentationState from input;};}; + } + conform ReadingNavigationObject as PresentationStateRecord id "reading:navigation:metadata" {} + conform ReadingNavigationObject as PresentationStateValues id "reading:navigation:copy" { + bind copyValues.call to package LanguageReaderRuntime.copyNavigation with {source to interface ReadingNavigation;target to interface ReadingNavigation from input;}; + } + conform ReadingNavigationObject as ReadingNavigation id "reading:navigation:values" { + private edge SelectedDocument id "reading:navigation:selected" {atom Self projection document id "reading:navigation:document" optional-one on-delete "detach" public-traversal;interface ReadingDocument projection readers id "reading:document:readers" many on-delete "detach";} + private state Cursor id "reading:navigation:cursor" on Self : record {anchor:uint32;focus:uint32;size:uint32;} policy register default {"anchor":0,"focus":0,"size":23}; + private state Draft id "reading:navigation:draft" on Self : record {title:string;text:string;custom:string;} policy crdt(record {title:string;text:string;custom:string;}) default {"title":"","text":"","custom":""}; + bind document.resolve to edge SelectedDocument.document.resolve; + private state ReadingView id "reading:navigation:reading" on Self : record {displayMode:string;position:uint32;} policy register default {"displayMode":"pages","position":0}; + bind reading.get to state ReadingView.read; + bind reading.set to package LanguageReaderRuntime.setReadingView with {reading to state ReadingView;}; + private state AnnotationTarget id "reading:navigation:annotation-target" on Self : optional policy register default null; + private state Viewports id "reading:navigation:viewports" on Self : list policy register default []; + bind annotationTarget to state AnnotationTarget; + bind viewports.get to state Viewports.read; + bind reportViewport.call to package LanguageReaderRuntime.reportViewport with {viewports to state Viewports;}; + bind open.call to package LanguageReaderRuntime.openDocument with {document to edge SelectedDocument.document;cursor to state Cursor;reading to state ReadingView;target to state AnnotationTarget;}; + bind cursor to state Cursor; + private state UI id "reading:navigation:ui" on Self : record {page:string;panel:string;section:string;sourceTab:string;} policy register default {"page":"reading","panel":"","section":"general","sourceTab":"paste"}; + private state Builder id "reading:navigation:builder" on Self : record {style:string;reveal:string;color:string;options:string;} policy register default {"style":"highlight","reveal":"always","color":"#53796c","options":"{}"}; + private state Prompts id "reading:navigation:prompts" on Self : record {name:string;change:string;followup:string;generate:string;} policy crdt(record {name:string;change:string;followup:string;generate:string;}) default {"name":"","change":"","followup":"","generate":""}; + private edge SettingsReader id "reading:navigation:settings-reader" {atom Self projection reader id "reading:navigation:settings-reader" optional-one on-delete "detach" public-traversal;interface ReadingReader projection views id "reading:reader:settings-views" many on-delete "detach";} + private edge SettingsFeature id "reading:navigation:settings-feature" {atom Self projection feature id "reading:navigation:settings-feature" optional-one on-delete "detach" public-traversal;interface ReadingFeature projection views id "reading:feature:settings-views" many on-delete "detach";} + bind ui to state UI; + bind builder to state Builder; + bind prompts.get to state Prompts.read;bind prompts.edit to state Prompts.edit; + bind settingsReader.resolve to edge SettingsReader.reader.resolve; + bind settingsReader.connect to edge SettingsReader.reader.connect; + bind settingsReader.disconnect to edge SettingsReader.reader.disconnect; + bind settingsFeature.resolve to edge SettingsFeature.feature.resolve; + bind settingsFeature.connect to edge SettingsFeature.feature.connect; + bind settingsFeature.disconnect to edge SettingsFeature.feature.disconnect; + bind selectSettings.call to package LanguageReaderRuntime.selectSettings with {ui to state UI;reader to edge SettingsReader.reader;feature to edge SettingsFeature.feature;document to interface ReadingDocument from input;}; + bind draft.get to state Draft.read;bind draft.edit to state Draft.edit; + } +} diff --git a/presentation/model.qx b/presentation/model.qx new file mode 100644 index 0000000..76b5b98 --- /dev/null +++ b/presentation/model.qx @@ -0,0 +1,62 @@ +fragment { + import interface PresentationState; + import interface PresentationSubject; + import interface PresentationStateValues; + import interface PresentationStateRecord; + import interface PresentationStateFactory; + import interface Presentation; + import interface PresentationStates; + import package PresentationRuntime; + atom PresentationMountRecord id "atom:org.quixos.presentation-mount"; + shared edge PresentationMembership id "org.quixos.presentation:membership" { + interface PresentationMount projection members id "org.quixos.presentation:members" many-unique keyed "string" public-traversal; + interface PresentationState projection presentationMount id "org.quixos.presentation:owner" optional-one public-traversal; + } + shared edge PresentationParent id "org.quixos.presentation:parent" { + interface PresentationState projection parent id "org.quixos.presentation:parent" optional-one public-traversal; + interface PresentationState projection children id "org.quixos.presentation:children" many-unique public-traversal; + } + shared edge PresentationRoot id "org.quixos.presentation:root" { + interface PresentationMount projection root id "org.quixos.presentation:root" optional-one public-traversal; + interface PresentationState projection rootOf id "org.quixos.presentation:root-of" optional-one; + } + conform PresentationMountRecord as PresentationMount id "org.quixos.presentation:mount" { + bind copy.call to package PresentationRuntime.copy with {members to edge PresentationMembership.members;root to edge PresentationRoot.root;metadata to interface PresentationState from input;presentationMount to creation PresentationMountRecord with {};}; + bind members.resolve to edge PresentationMembership.members.resolve; + bind find.call to package PresentationRuntime.find with {members to edge PresentationMembership.members;}; + bind attach.call to package PresentationRuntime.claim with {members to edge PresentationMembership.members;root to edge PresentationRoot.root;metadata to interface PresentationState from input;}; + bind root.resolve to edge PresentationRoot.root.resolve; + bind create.call to package PresentationRuntime.createPresentationMount with {presentationMount to creation PresentationMountRecord with {};}; + } + conform Presentation as PresentationSubject id "org.quixos.presentation:subject" {} + conform Presentation as PresentationStates id "org.quixos.presentation:state-association" { + bind ensure.call to package PresentationRuntime.ensure with { + presentationMount to interface PresentationMount from input; + metadata to interface PresentationState from input; + factory to interface PresentationStateFactory; + }; + bind create.call to package PresentationRuntime.create with { + metadata to interface PresentationState from input; + factory to interface PresentationStateFactory; + }; + } + conform & PresentationSubject> PresentationStateRecord as PresentationState id "org.quixos.presentation:state-metadata" { + private state Occurrence id "org.quixos.presentation:occurrence" on Self : string policy register; + private edge Source id "org.quixos.presentation:source" {atom Self projection source id "org.quixos.presentation:source" exactly-one; object Subject projection states id "org.quixos.presentation:source-states" many-unique;} + initialize {occurrence to state Occurrence;source to edge Source.source;}; + bind source.resolve to edge Source.source.resolve; + bind allocate.call to package PresentationRuntime.allocate with {source to interface PresentationStates via edge Source.source;}; + bind copyValues.call to interface PresentationStateValues.copyValues.call; + bind occurrence.get to state Occurrence.read; + bind parent.resolve to edge PresentationParent.parent.resolve; + bind children.resolve to edge PresentationParent.children.resolve; + bind presentationMount.resolve to edge PresentationMembership.presentationMount.resolve; + bind attach.call to package PresentationRuntime.attach with { + owner to edge PresentationMembership.presentationMount; + parent to edge PresentationParent.parent; + rootOf to edge PresentationRoot.rootOf; + metadata to interface PresentationState from input; + presentationMount to interface PresentationMount from input; + }; + } +} diff --git a/presentation/react.qx b/presentation/react.qx new file mode 100644 index 0000000..3cbe3c8 --- /dev/null +++ b/presentation/react.qx @@ -0,0 +1,6 @@ +fragment { + import interface ReactComponent; + conform + ReactComponent as Presentation + id "org.quixos.react:stateful-presentation" {} +} diff --git a/quixos.check.json b/quixos.check.json new file mode 100644 index 0000000..2ddc8f1 --- /dev/null +++ b/quixos.check.json @@ -0,0 +1 @@ +{ "backend": "execution", "queryFrontends": ["react"] } diff --git a/quixos.entry.json b/quixos.entry.json new file mode 100644 index 0000000..481c964 --- /dev/null +++ b/quixos.entry.json @@ -0,0 +1,5 @@ +{ + "atom": "atom:reading:library", + "interface": "interface:reading:library@1", + "operation": "reading:root:call" +} diff --git a/quixos.lock b/quixos.lock new file mode 100644 index 0000000..ccb542f --- /dev/null +++ b/quixos.lock @@ -0,0 +1,59 @@ +quixos-lock version 1 { + quixos source { repository "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos.git"; commit "11bc3ae35b0034c113daca4c35d1b341aa31ef70"; } + package AgentPresentation source { repository "https://repos.quixos.org/quixos-studio/package-agent-presentation.git"; commit "0c83644ab6bb28a829ef45ea3cbfcfded65188b9"; } + interface PresentationState source { repository "https://repos.quixos.org/quixos-studio/interface-presentation-state.git"; commit "94db4272bcca52fbb23325bfa305d7331ea08602"; } + interface PresentationSubject source { repository "https://repos.quixos.org/quixos-studio/interface-presentation-subject.git"; commit "26b1dc891485fa268570718bf283f440691654a7"; } + interface PresentationStateValues source { repository "https://repos.quixos.org/quixos-studio/interface-presentation-state-values.git"; commit "50e11ed980b909f428e99a9b30ede1bb24941ab7"; } + interface PresentationStateRecord source { repository "https://repos.quixos.org/quixos-studio/interface-presentation-state-record.git"; commit "5aacc09bdad3cca73c9add1bb00f970cb6957a73"; } + interface PresentationStateFactory source { repository "https://repos.quixos.org/quixos-studio/interface-presentation-state-factory.git"; commit "87685dc5e408f93a778a83e31463734b8df7709a"; } + interface Presentation source { repository "https://repos.quixos.org/quixos-studio/interface-presentation.git"; commit "2e5e9381120e14fb52b61373aec6b9c0b75de425"; } + interface PresentationStates source { repository "https://repos.quixos.org/quixos-studio/interface-presentation-states.git"; commit "9828a789b25e8a009f6b55cb32cf7e9ce1e3ac3c"; } + package PresentationRuntime source { repository "https://repos.quixos.org/quixos-studio/package-presentation-runtime.git"; commit "61d447d435777d2de057a0a25fd20a37113d1b7e"; } + interface AgentWorkspace source { repository "https://repos.quixos.org/quixos-studio/interface-agent-workspace.git"; commit "6b6fca52d9d9f22dbc8af6b9d59577809f5eeea5"; } + interface AgentDirectory source { repository "https://repos.quixos.org/quixos-studio/interface-agent-directory.git"; commit "a25908aa5da56a365e64dc170f0df8673cc34e24"; } + interface Agent source { repository "https://repos.quixos.org/quixos-studio/interface-agent.git"; commit "e5aeaa3a59e3c0cac99e43553b04227fb99a7462"; } + interface AgentThread source { repository "https://repos.quixos.org/quixos-studio/interface-agent-thread.git"; commit "9d689bbeecfc3321f97bfbaa9adf405eeee89e5c"; } + interface AgentRequest source { repository "https://repos.quixos.org/quixos-studio/interface-agent-request.git"; commit "d9bb364113d6590770f4733d3a9d42364e3b8806"; } + interface AgentItem source { repository "https://repos.quixos.org/quixos-studio/interface-agent-item.git"; commit "a80f9eebbefe6fdfe8b86db3103eed1a4b8e55f7"; } + interface AgentQuestion source { repository "https://repos.quixos.org/quixos-studio/interface-agent-question.git"; commit "c6fb1da16e29c599c1ba0dc510faa926615f0686"; } + interface AgentContextSubject source { repository "https://repos.quixos.org/quixos-studio/interface-agent-context-subject.git"; commit "0a1dd60f7457856bcfa6c8cf580e516d69d59ee7"; } + package AgentRuntime source { repository "https://repos.quixos.org/quixos-studio/package-agent-runtime.git"; commit "c13085fa041f888728fca00236b78f63f4957f43"; } + interface EventStream source { repository "https://repos.quixos.org/quixos-studio/interface-event-stream.git"; commit "5d9409557059ca2a3247af080a33516985916f66"; } + interface EventHandler source { repository "https://repos.quixos.org/quixos-studio/interface-event-handler.git"; commit "a57f8a5f4636228e63feeb83d4809a9f58367d78"; } + interface EventSubscription source { repository "https://repos.quixos.org/quixos-studio/interface-event-subscription.git"; commit "6b35cc235b111934fd2c0cee26d28d2578b7ce1b"; } + interface EventStreamRecord source { repository "https://repos.quixos.org/quixos-studio/interface-event-stream-record.git"; commit "2a75acdd79e99e0ad629668b91ebb64a767e8745"; } + interface EventSubscriptionRecord source { repository "https://repos.quixos.org/quixos-studio/interface-event-subscription-record.git"; commit "cf2fd94cccc48425536c15dcfb1bf12241b2e897"; } + interface ApplicationEntry source { repository "https://repos.quixos.org/quixos-studio/interface-application-entry.git"; commit "919a9def2c7e0b4601f5160ef0cdc0485131e13f"; } + interface ReadingServices source { repository "https://repos.quixos.org/quixos-local-first-examples/interface-reading-services.git"; commit "3e8bfba9030384d366600d05cdf16bb6c3b3d6a4"; } + interface ReadingOwner source { repository "https://repos.quixos.org/quixos-local-first-examples/interface-reading-owner.git"; commit "ca870ff6dc5ee7d8cc7f4ad1754e48fcf3f250cf"; } + interface LanguageReader source { repository "https://repos.quixos.org/quixos-local-first-examples/interface-language-reader.git"; commit "06624fd6a5d9761f74e3cc862e7bc0696cd78f21"; } + interface ReadingReader source { repository "https://repos.quixos.org/quixos-local-first-examples/interface-reading-reader.git"; commit "2ae966b8b05ea05b05818c2ca3378bd8b3a112cf"; } + interface ReadingDocument source { repository "https://repos.quixos.org/quixos-local-first-examples/interface-reading-document.git"; commit "544956d30f88e6f65bf10f571e4d09ebbbb77284"; } + interface ReadingFeature source { repository "https://repos.quixos.org/quixos-local-first-examples/interface-reading-feature.git"; commit "ef2316f66784f4fb9250dadecc09750bcbd6f776"; } + interface ReadingJob source { repository "https://repos.quixos.org/quixos-local-first-examples/interface-reading-job.git"; commit "cc078cccb5488b89e11e4cd4e9fe009211a50746"; } + interface ReadingRequest source { repository "https://repos.quixos.org/quixos-local-first-examples/interface-reading-request.git"; commit "892b678af3a89a86c7757e616ccd556b3ae80fb7"; } + interface ReadingWord source { repository "https://repos.quixos.org/quixos-local-first-examples/interface-reading-word.git"; commit "b1496ba5435dae96dd50814bd6a65f8ab3f89b04"; } + interface AgentDocumentation source { repository "https://repos.quixos.org/quixos-studio/interface-agent-documentation.git"; commit "8c076556c434e5da02baa79f7e8f0aabe88f1b8b"; } + interface ReadingVocabulary source { repository "https://repos.quixos.org/quixos-local-first-examples/interface-reading-vocabulary.git"; commit "8475d219b8a37da1c0acb477e175c96fba9127c7"; } + package LanguageReaderRuntime source { repository "https://repos.quixos.org/quixos-local-first-examples/package-language-reader-runtime.git"; commit "f8c252aa2cb32334ba28f3c87a64b285fe7d8a72"; } + package LanguageReaderPresentation source { repository "https://repos.quixos.org/quixos-local-first-examples/package-language-reader-presentation.git"; commit "7ad9faebf0ed9471d759ed2737cace9a9ec4c4b5"; } + interface GutenbergCatalog source { repository "https://repos.quixos.org/quixos-local-first-examples/interface-gutenberg-catalog.git"; commit "af88f1abc529f82f4464e4c0ed99cd2fff6b82ea"; } + package GutenbergRuntime source { repository "https://repos.quixos.org/quixos-local-first-examples/package-gutenberg-runtime.git"; commit "3c9c86d8178a3e677afb4daa2732ea9cc75896c4"; } + interface ReactComponent source { repository "https://repos.quixos.org/quixos-studio/interface-react-component.git"; commit "6ba635dbef73a0ae545933c052635c0ebad8d5c5"; } + interface ReadingNavigation source { repository "https://repos.quixos.org/quixos-local-first-examples/interface-reading-navigation.git"; commit "05c791c093b1151a49b0e058609b9d01147c8549"; } + package AgentWorkspaceBootstrap source { repository "https://repos.quixos.org/quixos-studio/package-agent-workspace-bootstrap.git"; commit "42783681b8d81d92c41adfed3874f01b065405d6"; } + interface WebStudioFactory source { repository "https://repos.quixos.org/quixos-studio/interface-web-studio-factory.git"; commit "a4136d9bfd765db6b2de2188ef2caf341e0f7a61"; } + interface WebStudioCanvasFactory source { repository "https://repos.quixos.org/quixos-studio/interface-web-studio-canvas-factory.git"; commit "545e687a7d41822a883774e385aa1d7ee3aca475"; } + interface WebStudioPlaceable source { repository "https://repos.quixos.org/quixos-studio/interface-web-studio-placeable.git"; commit "a998ebd982f7b61946156a0fa7038bc1295c3afc"; } + interface WebStudioCanvas source { repository "https://repos.quixos.org/quixos-studio/interface-web-studio-canvas.git"; commit "fb076e2d0d48080f76b88b2ffa4edeb4c37a7342"; } + package WebStudioCanvasRuntime source { repository "https://repos.quixos.org/quixos-studio/package-web-studio-canvas-runtime.git"; commit "885e1d754484586202d502008bbd3f8f6108aaa2"; } + interface WebStudioPresentable source { repository "https://repos.quixos.org/quixos-studio/interface-web-studio-presentable.git"; commit "f7b38219572810912fad596c7e4a33903209f71b"; } + interface PresentationMount source { repository "https://repos.quixos.org/quixos-studio/interface-presentation-mount.git"; commit "30566340643355d8509bf116c2c3d91f09173d98"; } + interface WebStudioDisplayTarget source { repository "https://repos.quixos.org/quixos-studio/interface-web-studio-display-target.git"; commit "1360b6175a77b8e69a5db83eaa63910d60699651"; } + interface WebStudioDisplayDirectory source { repository "https://repos.quixos.org/quixos-studio/interface-web-studio-display-directory.git"; commit "b6b70722e81f75ff2cd969118c5b8d0bba240a00"; } + package WebStudioDisplayRuntime source { repository "https://repos.quixos.org/quixos-studio/package-web-studio-display-runtime.git"; commit "c48e604a523cefe3d6cd2e231262988936b79bec"; } + interface WebStudioSearchable source { repository "https://repos.quixos.org/quixos-studio/interface-web-studio-searchable.git"; commit "b51116e6d320fc4dcd79f0d067124adf6a8e919f"; } + interface StandaloneView source { repository "https://repos.quixos.org/quixos-studio/interface-react-standalone-view.git"; commit "67b00f7ff8df87a477e12c5668c42684d8fa1708"; } + interface WebStudioCanvasPlacement source { repository "https://repos.quixos.org/quixos-studio/interface-web-studio-canvas-placement.git"; commit "8bee874e37700fc860f066f11946efc82a1f521d"; } + package WebStudioCanvasEditor source { repository "https://repos.quixos.org/quixos-studio/package-web-studio-canvas-editor.git"; commit "f22f01e37161e25291542ff6cf5428ad83efe8c6"; } +} diff --git a/reading.qx b/reading.qx new file mode 100644 index 0000000..7f7332d --- /dev/null +++ b/reading.qx @@ -0,0 +1,163 @@ +fragment { + import "events.qx"; + + + + + import interface ApplicationEntry; + import interface ReadingServices; + import interface ReadingOwner; import interface LanguageReader; import interface ReadingReader; import interface ReadingDocument; import interface ReadingFeature; import interface ReadingJob; import interface ReadingRequest; import interface ReadingWord; import interface AgentDocumentation; + import interface ReadingVocabulary; + atom ReadingVocabularyObject id "atom:reading:vocabulary"; + import package LanguageReaderRuntime; import package LanguageReaderPresentation; + atom ReadingReaderObject id "atom:reading:reader"; atom ReadingLibrary id "atom:reading:library"; atom ReadingDocumentObject id "atom:reading:document"; atom ReadingFeatureObject id "atom:reading:feature"; atom ReadingJobObject id "atom:reading:job"; atom ReadingWordObject id "atom:reading:word"; atom ReadingSubscription id "atom:reading:subscription"; + conform ReadingSubscription as EventSubscriptionRecord id "reading:completion-subscription" {} + conform ReadingReaderObject as ReadingReader id "reading:reader" { + private edge ReaderVocabulary id "reading:reader:vocabulary:edge" {atom Self projection vocabulary id "reading:reader:vocabulary:target" optional-one on-delete "detach" public-traversal;interface ReadingVocabulary projection readers id "reading:vocabulary:readers" many-unique on-delete "detach";} + bind vocabulary.resolve to edge ReaderVocabulary.vocabulary.resolve; + bind vocabulary.connect to package LanguageReaderRuntime.attachVocabulary with {library to edge ReaderLibrary.library;vocabulary to edge ReaderVocabulary.vocabulary;target to interface ReadingVocabulary from input;}; + bind remove.call to lifecycle.delete; + private state ReaderPalette id "reading:state:ReaderPalette" on Self : record {text:string;accent:string;} policy register default {"text":"#252923","accent":"#39745b"}; + bind palette.get to state ReaderPalette.read;bind palette.set to state ReaderPalette.write; + private state ReaderData id "reading:state:ReaderData" on Self : record {name:string;size:uint32;width:uint32;font:string;background:string;configRevision:uint32;} policy register; + private edge ReaderLibrary id "reading:edge:ReaderLibrary" {atom Self projection library id "reading:projection:ReaderLibrary:library" exactly-one on-delete "detach" public-traversal; interface LanguageReader projection readers id "reading:projection:ReaderLibrary:readers" many-unique on-delete "detach" public-traversal;} + initialize {palette to state ReaderPalette;data to state ReaderData;library to edge ReaderLibrary.library;};bind data.get to state ReaderData.read;bind library.resolve to edge ReaderLibrary.library.resolve;bind features.resolve to edge FeatureReader.features.resolve; + bind configure.call to package LanguageReaderRuntime.configureReader with {data to state ReaderData;}; + bind documents.resolve to edge DocumentReader.documents.resolve; + } + conform ReadingReaderObject as AgentContextSubject id "reading:reader:context" {} + conform ReadingReaderObject as AgentDocumentation id "reading:reader:guide" {bind guide.get to package LanguageReaderRuntime.guide with {};} + conform ReadingLibrary as LanguageReader id "reading:library" { + private edge DefaultVocabulary id "reading:library:default-vocabulary:edge" {atom Self projection vocabulary id "reading:library:default-vocabulary:target" optional-one on-delete "detach" public-traversal;interface ReadingVocabulary projection defaults id "reading:vocabulary:defaults" many-unique on-delete "detach";} + bind defaultVocabulary.resolve to edge DefaultVocabulary.vocabulary.resolve;bind vocabularies.resolve to edge VocabularyLibrary.vocabularies.resolve; + bind addVocabulary.call to package LanguageReaderRuntime.addVocabulary with {vocabulary to creation ReadingVocabularyObject with {ReadingVocabulary from input;};}; + bind ensureVocabulary.call to package LanguageReaderRuntime.ensureVocabulary with {default_vocabulary to edge DefaultVocabulary.vocabulary;vocabulary to creation ReadingVocabularyObject with {ReadingVocabulary from input;};home to interface LanguageReader from input;word to interface ReadingWord from input;}; + private edge DefaultReader id "reading:edge:DefaultReader" {atom Self projection defaultReader id "reading:projection:DefaultReader:reader" optional-one on-delete "detach" public-traversal; interface ReadingReader projection defaults id "reading:projection:DefaultReader:defaults" many-unique on-delete "detach" public-traversal;} + bind readers.resolve to edge ReaderLibrary.readers.resolve;bind defaultReader.resolve to edge DefaultReader.defaultReader.resolve; + bind ensureReaders.call to package LanguageReaderRuntime.ensureReaders with {default_reader to edge DefaultReader.defaultReader;home to interface LanguageReader from input;feature to interface ReadingFeature from input;document to interface ReadingDocument from input;reader to creation ReadingReaderObject with {ReadingReader from input;};}; + bind addFrenchReader.call to package LanguageReaderRuntime.addFrenchReader with {reader to creation ReadingReaderObject with {ReadingReader from input;};feature to creation ReadingFeatureObject with {ReadingFeature from input;};document to creation ReadingDocumentObject with {ReadingDocument from input;};}; + bind generateDocument.call to package LanguageReaderRuntime.generateDocument with {inference to edge ReaderInference.inference;target_reader to interface ReadingReader from input;agent to interface Agent from input;job to creation ReadingJobObject with {ReadingJob from input;};job_api to interface ReadingJob from input;}; + bind addReader.call to package LanguageReaderRuntime.addReader with {source to interface ReadingReader from input;reader_api to interface ReadingReader from input;feature to interface ReadingFeature from input;reader to creation ReadingReaderObject with {ReadingReader from input;};feature_copy to creation ReadingFeatureObject with {ReadingFeature from input;};}; + private state InferenceProfile id "reading:state:InferenceProfile" on Self : string policy register default "quick-fast"; + bind inferenceProfile.get to state InferenceProfile.read; + bind inferenceProfile.set to package LanguageReaderRuntime.setInferenceProfile with {profile to state InferenceProfile;}; + private state ArchivedTypes id "reading:state:ArchivedTypes" on Self : list policy register default []; + bind archivedTypes.get to state ArchivedTypes.read; + bind archiveType.call to package LanguageReaderRuntime.archiveType with {archives to state ArchivedTypes;}; + bind catalog.call to package LanguageReaderRuntime.catalog with {}; + private edge ReaderCanvas id "reading:edge:ReaderCanvas" { atom Self projection canvas id "reading:projection:ReaderCanvas:canvas" exactly-one on-delete "detach" public-traversal ; atom Canvas projection readers id "reading:projection:ReaderCanvas:readers" many-unique on-delete "detach" public-traversal; } + private state LibraryName id "reading:state:LibraryName" on Self : string policy register; + + private edge ReaderDirectory id "reading:edge:ReaderDirectory" { atom Self projection directory id "reading:projection:ReaderDirectory:directory" optional-one on-delete "detach" public-traversal ; atom AgentDirectoryObject projection readers id "reading:projection:ReaderDirectory:readers" many-unique on-delete "detach" public-traversal; } + private edge ReaderInference id "reading:edge:ReaderInference" { atom Self projection inference id "reading:projection:ReaderInference:inference" optional-one on-delete "detach" public-traversal ; atom AgentObject projection readingInferences id "reading:projection:ReaderInference:readingInferences" many-unique on-delete "detach" public-traversal; } + private edge ReaderAuthor id "reading:edge:ReaderAuthor" { atom Self projection author id "reading:projection:ReaderAuthor:author" optional-one on-delete "detach" public-traversal ; atom AgentObject projection readingAuthors id "reading:projection:ReaderAuthor:readingAuthors" many-unique on-delete "detach" public-traversal; } + private edge ReaderSubscriptions id "reading:edge:ReaderSubscriptions" { atom Self projection subscriptions id "reading:projection:ReaderSubscriptions:subscriptions" many-unique on-delete "detach" public-traversal ; interface EventSubscription projection readers id "reading:projection:ReaderSubscriptions:readers" many-unique on-delete "detach" public-traversal; } + initialize {name to state LibraryName;canvas to edge ReaderCanvas.canvas;directory to edge ReaderDirectory.directory;}; + bind name.get to state LibraryName.read;bind inference.resolve to edge ReaderInference.inference.resolve;bind author.resolve to edge ReaderAuthor.author.resolve; + bind documents.resolve to edge DocumentLibrary.documents.resolve;bind features.resolve to edge FeatureLibrary.features.resolve;bind vocabulary.resolve to edge WordLibrary.vocabulary.resolve;bind tasks.resolve to edge JobLibrary.tasks.resolve; + bind installWorkspace.call to package LanguageReaderRuntime.workspaceInstall with {canvas to edge ReaderCanvas.canvas;agent_workspace to interface AgentWorkspace from input;}; + bind root.call to package LanguageReaderRuntime.createRoot with {canvas to creation Canvas with {WebStudioCanvas from input;};agent_workspace to interface AgentWorkspace from input;library to creation ReadingLibrary with {LanguageReader from input;};reader to interface LanguageReader from input;}; + bind install.call to package LanguageReaderRuntime.install with {directory to edge ReaderDirectory.directory;inference to edge ReaderInference.inference;author to edge ReaderAuthor.author;subscriptions to edge ReaderSubscriptions.subscriptions;agents to interface AgentDirectory from input;agent to interface Agent from input;subscription to creation ReadingSubscription with {};delivery to interface EventSubscription from input;feature to creation ReadingFeatureObject with {ReadingFeature from input;};document to creation ReadingDocumentObject with {ReadingDocument from input;};home to interface LanguageReader from input;}; + bind addDocument.call to package LanguageReaderRuntime.addDocument with {home to interface LanguageReader from input;document to creation ReadingDocumentObject with {ReadingDocument from input;};}; + bind addFeature.call to package LanguageReaderRuntime.addFeature with {authoring to interface ReadingJob from input;home to interface LanguageReader from input;reader to interface ReadingReader from input;feature to creation ReadingFeatureObject with {ReadingFeature from input;};}; + bind remember.call to package LanguageReaderRuntime.remember with {home to interface LanguageReader from input;vocabulary to interface ReadingVocabulary from input;}; + bind customize.call to package LanguageReaderRuntime.customize with {feature to interface ReadingFeature from input;reader to interface ReadingReader from input;author to edge ReaderAuthor.author;agent to interface Agent from input;job to creation ReadingJobObject with {ReadingJob from input;};job_api to interface ReadingJob from input;}; + } + conform ReadingLibrary as AgentWorkspace id "reading:workspace-agent" {bind agents.resolve to edge ReaderDirectory.directory.resolve; bind install.call to interface LanguageReader.installWorkspace.call;} + conform ReadingLibrary as EventHandler id "reading:completion-handler" {bind handle.call to package LanguageReaderRuntime.completion with {request to interface ReadingRequest from input;job to interface ReadingJob from input;};} + conform ReadingDocumentObject as ReadingDocument id "reading:document" { + private edge DocumentResults id "reading:edge:DocumentResults" {atom Self projection results id "reading:projection:DocumentResults:results" many on-delete "detach" keyed "string" public-traversal;interface ReadingJob projection cachedBy id "reading:projection:DocumentResults:owners" many on-delete "detach";} + private edge DocumentAttempts id "reading:edge:DocumentAttempts" {atom Self projection attempts id "reading:projection:DocumentAttempts:attempts" many on-delete "detach" keyed "string";interface ReadingJob projection attemptedBy id "reading:projection:DocumentAttempts:owners" many on-delete "detach";} + bind results.resolve to edge DocumentResults.results.resolve; + bind recordResult.call to package LanguageReaderRuntime.recordResult with {data to state DocumentData;results to edge DocumentResults.results;job to interface ReadingJob from input;}; + private state Archived id "reading:state:DocumentArchived" on Self : bool policy register default false; + bind archived.get to state Archived.read;bind archived.set to state Archived.write; + private state Variant id "reading:state:Variant" on Self : string policy register default "{}"; + private edge DocumentReader id "reading:edge:DocumentReader" {atom Self projection reader id "reading:projection:DocumentReader:reader" optional-one on-delete "detach" public-traversal;interface ReadingReader projection documents id "reading:projection:DocumentReader:documents" many-unique on-delete "detach" public-traversal;} + private edge DocumentCanonical id "reading:edge:DocumentCanonical" {atom Self projection canonical id "reading:projection:DocumentCanonical:canonical" optional-one on-delete "detach" public-traversal;interface ReadingDocument projection variants id "reading:projection:DocumentCanonical:variants" many-unique on-delete "detach" public-traversal;} + bind reader.resolve to edge DocumentReader.reader.resolve;bind reader.connect to package LanguageReaderRuntime.attachReader with {library to edge DocumentLibrary.library;reader to edge DocumentReader.reader;target_reader to interface ReadingReader from input;};bind canonical.resolve to edge DocumentCanonical.canonical.resolve;bind adaptation.get to state Variant.read; + bind prepareVariant.call to package LanguageReaderRuntime.prepareVariant with {data to state DocumentData;adaptation to state Variant;library to edge DocumentLibrary.library;home to interface LanguageReader from input;agent to interface Agent from input;jobs to interface ReadingDocument from input;old to interface ReadingJob from input;job to creation ReadingJobObject with {ReadingJob from input;};job_api to interface ReadingJob from input;}; + bind applyVariant.call to package LanguageReaderRuntime.applyVariant with {data to state DocumentData;adaptation to state Variant;}; + private state DocumentData id "reading:state:DocumentData" on Self : record {title:string;text:string;sourceRevision:string;source:string;url:string;attribution:string;} policy register; + private edge DocumentLibrary id "reading:edge:DocumentLibrary" { atom Self projection library id "reading:projection:DocumentLibrary:library" exactly-one on-delete "detach" public-traversal ; interface LanguageReader projection documents id "reading:projection:DocumentLibrary:documents" many-unique on-delete "detach" public-traversal; } + initialize {reader to edge DocumentReader.reader;canonical to edge DocumentCanonical.canonical;adaptation to state Variant;data to state DocumentData;library to edge DocumentLibrary.library;};bind data.get to state DocumentData.read;bind library.resolve to edge DocumentLibrary.library.resolve;bind jobs.resolve to edge JobDocument.jobs.resolve;bind remove.call to lifecycle.delete; + bind plan.call to package LanguageReaderRuntime.plan with {data to state DocumentData;library to edge DocumentLibrary.library;feature to interface ReadingFeature from input;}; + bind generate.call to package LanguageReaderRuntime.generate with {results to edge DocumentResults.results;attempts to edge DocumentAttempts.attempts;data to state DocumentData;library to edge DocumentLibrary.library;jobs to interface ReadingDocument from input;feature to interface ReadingFeature from input;home to interface LanguageReader from input;agent to interface Agent from input;old to interface ReadingJob from input;job to creation ReadingJobObject with {ReadingJob from input;};job_api to interface ReadingJob from input;}; + bind rewrite.call to package LanguageReaderRuntime.rewrite with {data to state DocumentData;library to edge DocumentLibrary.library;reader to edge DocumentReader.reader;document_result to creation ReadingDocumentObject with {ReadingDocument from input;};}; + } + conform ReadingFeatureObject as ReadingFeature id "reading:feature" { + private edge FeatureAuthoring id "reading:edge:FeatureAuthoring" {atom Self projection authoring id "reading:projection:FeatureAuthoring:authoring" optional-one on-delete "detach" public-traversal;atom ReadingJobObject projection createdFeatures id "reading:projection:FeatureAuthoring:features" many-unique on-delete "detach" public-traversal;} + bind authoring.resolve to edge FeatureAuthoring.authoring.resolve;bind authoring.connect to package LanguageReaderRuntime.attachAuthoring with {authoring to edge FeatureAuthoring.authoring;library to edge FeatureLibrary.library;reader to edge FeatureReader.reader;job to interface ReadingJob from input;}; + bind setEnabled.call to package LanguageReaderRuntime.setEnabled with {data to state FeatureData;}; + private edge FeatureReader id "reading:edge:FeatureReader" {atom Self projection reader id "reading:projection:FeatureReader:reader" optional-one on-delete "detach" public-traversal;interface ReadingReader projection features id "reading:projection:FeatureReader:features" many-unique on-delete "detach" public-traversal;} + bind reader.resolve to edge FeatureReader.reader.resolve;bind reader.connect to edge FeatureReader.reader.connect; + private state FeatureData id "reading:state:FeatureData" on Self : record {name:string;processor:string;style:string;reveal:string;generation:string;scope:string;color:string;enabled:bool;configRevision:uint32;} policy register; + private edge FeatureLibrary id "reading:edge:FeatureLibrary" { atom Self projection library id "reading:projection:FeatureLibrary:library" exactly-one on-delete "detach" public-traversal ; interface LanguageReader projection features id "reading:projection:FeatureLibrary:features" many-unique on-delete "detach" public-traversal; } + initialize {authoring to edge FeatureAuthoring.authoring;reader to edge FeatureReader.reader;data to state FeatureData;library to edge FeatureLibrary.library;options to state Options;};bind data.get to state FeatureData.read;bind library.resolve to edge FeatureLibrary.library.resolve;bind remove.call to lifecycle.delete; + private state Options id "reading:state:FeatureOptions" on Self : string policy register default "{}"; + bind options.get to state Options.read; + bind configureOptions.call to package LanguageReaderRuntime.configureOptions with {data to state FeatureData;options to state Options;}; + bind processorRevision.get to package LanguageReaderRuntime.processorRevision with {data to state FeatureData;}; + bind configure.call to package LanguageReaderRuntime.configure with {data to state FeatureData;}; + } + conform ReadingVocabularyObject as ReadingVocabulary id "reading:vocabulary" { + private state VocabularyDraft id "reading:vocabulary:draft" on Self : record {word:string;} policy crdt(record {word:string;}) default {"word":""}; + bind draft.get to state VocabularyDraft.read;bind draft.edit to state VocabularyDraft.edit; + private state VocabularyName id "reading:vocabulary:name" on Self : string policy register; + private edge VocabularyLibrary id "reading:vocabulary:library:edge" {atom Self projection library id "reading:vocabulary:library:target" exactly-one on-delete "detach" public-traversal;interface LanguageReader projection vocabularies id "reading:library:vocabularies" many-unique on-delete "detach" public-traversal;} + initialize {name to state VocabularyName;library to edge VocabularyLibrary.library;};bind name.get to state VocabularyName.read; + bind name.set to package LanguageReaderRuntime.renameVocabulary with {name to state VocabularyName;};bind library.resolve to edge VocabularyLibrary.library.resolve; + bind words.resolve to edge WordVocabulary.words.resolve; + bind remember.call to package LanguageReaderRuntime.vocabularyRemember with {library to edge VocabularyLibrary.library;words to interface ReadingVocabulary from input;word_api to interface ReadingWord from input;word to creation ReadingWordObject with {ReadingWord from input;};}; + } + conform ReadingVocabularyObject as AgentDocumentation id "reading:vocabulary:guide" {bind guide.get to package LanguageReaderRuntime.guide with {};} + conform ReadingVocabularyObject as StandaloneView id "reading:vocabulary:view" {bind render to LanguageReaderPresentation.Vocabulary;} + conform ReadingWordObject as ReadingWord id "reading:word" { + private edge WordVocabulary id "reading:word:vocabulary:edge" {atom Self projection vocabulary id "reading:word:vocabulary:target" optional-one on-delete "detach" public-traversal;interface ReadingVocabulary projection words id "reading:vocabulary:words" many-unique on-delete "detach" public-traversal;} + bind vocabulary.resolve to edge WordVocabulary.vocabulary.resolve; + bind vocabulary.connect to package LanguageReaderRuntime.attachVocabulary with {library to edge WordLibrary.library;vocabulary to edge WordVocabulary.vocabulary;target to interface ReadingVocabulary from input;}; + private edge WordLibrary id "reading:edge:WordLibrary" { atom Self projection library id "reading:projection:WordLibrary:library" exactly-one on-delete "detach" public-traversal ; interface LanguageReader projection vocabulary id "reading:projection:WordLibrary:vocabulary" many-unique on-delete "detach" public-traversal; } + private state WordText id "reading:state:WordText" on Self : string policy register; + + initialize {text to state WordText;library to edge WordLibrary.library;};bind text.get to state WordText.read;bind forget.call to lifecycle.delete; + } + conform ReadingJobObject as ReadingJob id "reading:job" { + private state Configuration id "reading:state:Configuration" on Self : string policy register default ""; + private edge JobReader id "reading:edge:JobReader" {atom Self projection reader id "reading:projection:JobReader:reader" optional-one on-delete "detach" public-traversal;interface ReadingReader projection tasks id "reading:projection:JobReader:tasks" many-unique on-delete "detach" public-traversal;} + bind library.resolve to edge JobLibrary.library.resolve;bind reader.resolve to edge JobReader.reader.resolve;bind configuration.get to state Configuration.read; + private edge JobDocument id "reading:edge:JobDocument" { atom Self projection document id "reading:projection:JobDocument:document" optional-one on-delete "detach" public-traversal ; interface ReadingDocument projection jobs id "reading:projection:JobDocument:jobs" many-unique on-delete "detach" public-traversal; } + private state JobData id "reading:state:JobData" on Self : record {key:string;kind:string;featureRevision:uint32;sourceRevision:string;start:uint32;end:uint32;status:string;output:string;error:string;createdAt:string;} policy register; + private edge JobLibrary id "reading:edge:JobLibrary" { atom Self projection library id "reading:projection:JobLibrary:library" exactly-one on-delete "detach" public-traversal ; interface LanguageReader projection tasks id "reading:projection:JobLibrary:tasks" many-unique on-delete "detach" public-traversal; } + + private edge JobFeature id "reading:edge:JobFeature" { atom Self projection feature id "reading:projection:JobFeature:feature" optional-one on-delete "detach" public-traversal ; interface ReadingFeature projection jobs id "reading:projection:JobFeature:jobs" many-unique on-delete "detach" public-traversal; } + private edge JobRequest id "reading:edge:JobRequest" { atom Self projection request id "reading:projection:JobRequest:request" optional-one on-delete "detach" public-traversal ; atom AgentRequestObject projection readingJob id "reading:projection:JobRequest:readingJob" optional-one on-delete "detach" public-traversal; } + private edge JobThread id "reading:edge:JobThread" { atom Self projection thread id "reading:projection:JobThread:thread" optional-one on-delete "detach" public-traversal ; atom AgentThreadObject projection readingJobs id "reading:projection:JobThread:readingJobs" many-unique on-delete "detach" public-traversal; } + initialize {reader to edge JobReader.reader;configuration to state Configuration;data to state JobData;library to edge JobLibrary.library;document to edge JobDocument.document;feature to edge JobFeature.feature;};bind data.get to state JobData.read;bind document.resolve to edge JobDocument.document.resolve;bind feature.resolve to edge JobFeature.feature.resolve;bind request.resolve to edge JobRequest.request.resolve;bind thread.resolve to edge JobThread.thread.resolve; + bind admitted.call to package LanguageReaderRuntime.admitted with {data to state JobData;request to edge JobRequest.request;thread to edge JobThread.thread;}; + bind complete.call to package LanguageReaderRuntime.complete with {configuration to state Configuration;reader to edge JobReader.reader;data to state JobData;request to edge JobRequest.request;document to edge JobDocument.document;feature to edge JobFeature.feature;library to edge JobLibrary.library;request_api to interface AgentRequest from input;document_api to interface ReadingDocument from input;feature_api to interface ReadingFeature from input;home to interface LanguageReader from input;document_result to creation ReadingDocumentObject with {ReadingDocument from input;};}; + } + conform AgentRequestObject as ReadingRequest id "reading:request-job" {bind job.resolve to edge JobRequest.readingJob.resolve;} + conform ReadingLibrary as AgentContextSubject id "reading:library:context" {} + conform ReadingDocumentObject as AgentContextSubject id "reading:document:context" {} + conform ReadingFeatureObject as AgentContextSubject id "reading:feature:context" {} + conform ReadingLibrary as AgentDocumentation id "reading:library:guide" {bind guide.get to package LanguageReaderRuntime.guide with {};} + conform ReadingDocumentObject as AgentDocumentation id "reading:document:guide" {bind guide.get to package LanguageReaderRuntime.guide with {};} + conform ReadingFeatureObject as AgentDocumentation id "reading:feature:guide" {bind guide.get to package LanguageReaderRuntime.guide with {};} + conform ReadingLibrary as ReadingOwner id "reading:owner" {} + conform ReadingLibrary as ApplicationEntry id "reading:application" {} + conform ReadingLibrary as ReadingServices id "reading:services" { + private state SpeechSettings id "reading:speech:settings" on Self : record {key:string;voice:string;} policy register default {"key":"","voice":"JBFqnCBsd6RMkjVDRZzb"}; + bind speechStatus.call to package LanguageReaderRuntime.speechStatus with {settings to state SpeechSettings;}; + bind configureSpeech.call to package LanguageReaderRuntime.configureSpeech with {settings to state SpeechSettings;}; + bind speak.call to package LanguageReaderRuntime.speak with {settings to state SpeechSettings;}; + bind searchWikipedia.call to package LanguageReaderRuntime.searchWikipedia with {}; + bind readWikipedia.call to package LanguageReaderRuntime.readWikipedia with {}; + } + conform ReadingLibrary as WebStudioPlaceable id "reading:placeable" { + bind canPresent.call to package WebStudioCanvasRuntime.canPresent with {catalog to workspace reflection [presentations];}; + bind placements.resolve to edge PlacementSubject.placements.resolve; + } + conform ReadingLibrary as WebStudioPresentable id "reading:presentable" {bind canPresent.call to interface WebStudioPlaceable.canPresent.call;} + conform ReadingLibrary as ReactComponent id "reading:view" {bind render to LanguageReaderPresentation.Reader;} + presentation Reading id "presentation:reading:library" for LanguageReader using LanguageReaderPresentation.Reader; +} diff --git a/resources.json b/resources.json new file mode 100644 index 0000000..402d4ac --- /dev/null +++ b/resources.json @@ -0,0 +1,64 @@ +{ + "compilerRevision": "26f4492b068aec99ccdaebe58c29418ee48a5662", + "interfaces": { + "PresentationSubject": "./quixos-instance/interfaces/presentation-subject", + "PresentationState": "./quixos-instance/interfaces/presentation-state", + "PresentationMount": "./quixos-instance/interfaces/presentation-mount", + "WebStudioPresentable": "./quixos-instance/interfaces/web-studio-presentable", + "WebStudioDisplayTarget": "./quixos-instance/interfaces/web-studio-display-target", + "WebStudioDisplayDirectory": "./quixos-instance/interfaces/web-studio-display-directory", + "WebStudioSearchable": "./quixos-instance/interfaces/web-studio-searchable", + "WebStudioFactory": "./quixos-instance/interfaces/web-studio-factory", + "StandaloneView": "./quixos-instance/interfaces/react-standalone-view", + "WebStudioCanvas": "./quixos-instance/interfaces/web-studio-canvas", + "WebStudioCanvasPlacement": "./quixos-instance/interfaces/web-studio-canvas-placement", + "WebStudioPlaceable": "./quixos-instance/interfaces/web-studio-placeable", + "WebStudioCanvasFactory": "./quixos-instance/interfaces/web-studio-canvas-factory", + "ApplicationEntry": "./quixos-instance/interfaces/application-entry", + "AgentContextSubject": "./quixos-instance/interfaces/agent-context-subject", + "EventStream": "./quixos-instance/interfaces/event-stream", + "AgentWorkspace": "./quixos-instance/interfaces/agent-workspace", + "AgentDirectory": "./quixos-instance/interfaces/agent-directory", + "Agent": "./quixos-instance/interfaces/agent", + "AgentThread": "./quixos-instance/interfaces/agent-thread", + "AgentRequest": "./quixos-instance/interfaces/agent-request", + "AgentItem": "./quixos-instance/interfaces/agent-item", + "AgentQuestion": "./quixos-instance/interfaces/agent-question", + "EventHandler": "./quixos-instance/interfaces/event-handler", + "EventSubscription": "./quixos-instance/interfaces/event-subscription", + "PresentationStateValues": "./quixos-instance/interfaces/presentation-state-values", + "PresentationStates": "./quixos-instance/interfaces/presentation-states", + "PresentationStateRecord": "./quixos-instance/interfaces/presentation-state-record", + "PresentationStateFactory": "./quixos-instance/interfaces/presentation-state-factory", + "Presentation": "./quixos-instance/interfaces/presentation", + "AgentDocumentation": "./quixos-instance/interfaces/agent-documentation", + "EventStreamRecord": "./quixos-instance/interfaces/event-stream-record", + "EventSubscriptionRecord": "./quixos-instance/interfaces/event-subscription-record", + "ReadingOwner": "reading-owner", + "ReadingVocabulary": "reading-vocabulary", + "ReadingWord": "reading-word", + "ReadingFeature": "reading-feature", + "ReadingReader": "reading-reader", + "ReadingDocument": "reading-document", + "ReadingJob": "reading-job", + "ReadingRequest": "reading-request", + "LanguageReader": "language-reader", + "ReadingNavigation": "reading-navigation", + "ReactComponent": "./quixos-instance/interfaces/react-component", + "ReadingServices": "reading-services", + "GutenbergCatalog": "gutenberg-catalog" + }, + "packages": { + "WebStudioCanvasRuntime": "./quixos-instance/packages/web-studio-canvas-runtime", + "WebStudioCanvasEditor": "./quixos-instance/packages/web-studio-canvas-editor", + "WebStudioDisplayRuntime": "./quixos-instance/packages/web-studio-display-runtime", + "AgentRuntime": "./quixos-instance/packages/agent-runtime", + "AgentWorkspaceBootstrap": "./quixos-instance/packages/agent-workspace-bootstrap", + "PresentationRuntime": "./quixos-instance/packages/presentation-runtime", + "AgentPresentation": "./quixos-instance/packages/agent-presentation", + "LanguageReaderRuntime": "language-reader-runtime", + "LanguageReaderPresentation": "language-reader-presentation", + "GutenbergRuntime": "gutenberg-runtime" + }, + "resourceRoot": "examples/local-first" +} diff --git a/studio/factory-rules.qx b/studio/factory-rules.qx new file mode 100644 index 0000000..9188d1f --- /dev/null +++ b/studio/factory-rules.qx @@ -0,0 +1,15 @@ +fragment { + import interface WebStudioFactory; + import interface WebStudioCanvasFactory; + import interface WebStudioPlaceable; + import interface WebStudioCanvas; + import package WebStudioCanvasRuntime; + conform + WebStudioFactory as WebStudioCanvasFactory + id "org.quixos.web-studio:factory-create-and-place" { + bind create.call to package WebStudioCanvasRuntime.createPlaced with { + factory to interface WebStudioFactory; + canvas to interface WebStudioCanvas from input; + }; + } +} diff --git a/workspace.qx b/workspace.qx new file mode 100644 index 0000000..6f14339 --- /dev/null +++ b/workspace.qx @@ -0,0 +1,106 @@ +workspace Studio id "workspace:studio" revision "workspace:studio@1" commit "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" { + import "agents.qx"; + import "reading.qx"; + import "books.qx"; + import "presentation/react.qx"; + import "navigation.qx"; + import package AgentWorkspaceBootstrap; + import "studio/factory-rules.qx"; + import interface WebStudioPresentable; + import interface PresentationMount; + import interface WebStudioDisplayTarget; + import interface WebStudioDisplayDirectory; + import package WebStudioDisplayRuntime; + + import interface WebStudioSearchable; + import interface StandaloneView; + import interface WebStudioCanvasPlacement; + import package WebStudioCanvasEditor; + presentation CanvasEditor id "presentation:studio:canvas-editor" for WebStudioCanvas using WebStudioCanvasEditor.Editor; + presentation CanvasCard id "presentation:studio:canvas" for WebStudioCanvas using WebStudioCanvasRuntime.CanvasCard; + atom Canvas id "atom:org.quixos.web-studio:canvas"; + atom Placement id "atom:org.quixos.web-studio:canvas-placement"; + conform Canvas as WebStudioCanvas id "studio:canvas" { + private state Name id "studio:canvas:name" on Canvas : string policy register; + initialize {name to state Name;}; + bind name.get to state Name.read; + bind name.set to state Name.write; + bind create.call to package WebStudioCanvasRuntime.createCanvas with {canvas to creation Canvas with {WebStudioCanvas from input;};}; + bind root.call to package AgentWorkspaceBootstrap.createRoot with {canvas to creation Canvas with {WebStudioCanvas from input;};agentWorkspace to interface AgentWorkspace from input;}; + bind place.call to package WebStudioCanvasRuntime.place with { + subject to interface WebStudioPlaceable from input; + placement to creation Placement with {WebStudioCanvasPlacement from input;}; + }; + bind createAndPlace.call to package WebStudioCanvasRuntime.createAndPlace with { + subject to interface WebStudioPlaceable from input; + canvas to creation Canvas with {WebStudioCanvas from input;}; + placement to creation Placement with {WebStudioCanvasPlacement from input;}; + }; + bind placements.resolve to edge PlacementCanvas.placements.resolve; + } + conform Canvas as WebStudioPlaceable id "studio:canvas:placeable" { + bind canPresent.call to package WebStudioCanvasRuntime.canPresent with {catalog to workspace reflection [presentations];}; + bind placements.resolve to edge PlacementSubject.placements.resolve; + } + conform Placement as WebStudioCanvasPlacement id "studio:placement" { + private state Position id "studio:placement:position" on Placement : record {x:double;y:double;} policy register; + private state Size id "studio:placement:size" on Placement : record {width:double;height:double;} policy register; + private state Z id "studio:placement:z" on Placement : int32 policy register; + private state Presentation id "studio:placement:presentation" on Placement : string policy register; + private edge PlacementCanvas id "studio:placement:canvas" { + atom Placement projection canvas id "studio:placement:canvas:parent" exactly-one on-delete "detach" public-traversal; + interface WebStudioCanvas projection placements id "studio:canvas:placements" many-unique on-delete "cascade-other" public-traversal; + } + private edge PlacementSubject id "studio:placement:subject" { + atom Placement projection subject id "studio:placement:subject:target" exactly-one on-delete "detach" public-traversal; + interface WebStudioPlaceable projection placements id "studio:subject:placements" many-unique on-delete "cascade-other" public-traversal; + } + initialize {position to state Position;size to state Size;z to state Z;presentation to state Presentation;canvas to edge PlacementCanvas.canvas;subject to edge PlacementSubject.subject;}; + bind position.get to state Position.read; + bind position.set to state Position.write; + bind size.get to state Size.read; + bind size.set to state Size.write; + bind z.get to state Z.read; + bind z.set to state Z.write; + bind presentation.get to state Presentation.read; + bind remove.call to lifecycle.delete; + bind canvas.resolve to edge PlacementCanvas.canvas.resolve; + bind subject.resolve to edge PlacementSubject.subject.resolve; + } + + conform Canvas as StandaloneView id "studio:canvas:view" { bind render to WebStudioCanvasEditor.Editor; } + + conform Canvas as WebStudioSearchable id "studio:search:Canvas" { + bind title.get to interface WebStudioCanvas.name.get; + private state SearchText id "studio:canvas:search-text" on Canvas : string policy register default "canvas workspace"; + bind searchText.get to state SearchText.read; + } + + + atom DisplayTarget id "atom:org.quixos.web-studio:display-target"; + conform DisplayTarget as WebStudioDisplayTarget id "studio:display-target" { + private state DisplayData id "studio:display:data" on DisplayTarget : record {label:string;generation:uint32;presentation:optional;observed:optional;} policy register; + private state DisplayNonce id "studio:display:nonce" on DisplayTarget : string policy register; + private edge DisplaySubject id "studio:display:subject" { + atom DisplayTarget projection subject id "studio:display:subject:target" optional-one on-delete "detach" public-traversal; + interface WebStudioPresentable projection displays id "studio:presentable:displays" many-unique on-delete "detach" public-traversal; + } + initialize {initial to state DisplayData;nonce to state DisplayNonce;}; + bind status.get to state DisplayData.read; + bind nonce.get to state DisplayNonce.read; + bind subject.resolve to edge DisplaySubject.subject.resolve; + private edge DisplayPresentationMount id "studio:display:presentation-mount" {atom DisplayTarget projection presentationMount id "studio:display:presentation-mount:target" optional-one on-delete "detach"; interface PresentationMount projection displays id "studio:display:presentation-mount:displays" many on-delete "detach";} + bind presentationMount.resolve to edge DisplayPresentationMount.presentationMount.resolve; + bind assign.call to package WebStudioDisplayRuntime.assign with {data to state DisplayData;selected to edge DisplaySubject.subject;subject to interface WebStudioPresentable from input;mount to edge DisplayPresentationMount.presentationMount;}; + bind acknowledge.call to package WebStudioDisplayRuntime.acknowledge with {data to state DisplayData;}; + } + conform Canvas as WebStudioDisplayDirectory id "studio:display-directory:Canvas" { + private edge CanvasDisplayDirectory id "studio:display:directory:Canvas" { + atom Canvas projection targets id "studio:directory:targets:Canvas" many-unique on-delete "cascade-other" public-traversal; + interface WebStudioDisplayTarget projection directory id "studio:display:directory:parent:Canvas" optional-one on-delete "detach" public-traversal; + } + bind targets.resolve to edge CanvasDisplayDirectory.targets.resolve; + bind enroll.call to package WebStudioDisplayRuntime.enroll with {enrolled to edge CanvasDisplayDirectory.targets;existing to interface WebStudioDisplayTarget from input;target to creation DisplayTarget with {WebStudioDisplayTarget from input;};}; + } + conform Canvas as WebStudioPresentable id "studio:presentable:Canvas" {bind canPresent.call to interface WebStudioPlaceable.canPresent.call;} +}