Merge pull request 'node-display-session defined whole, with the verb open (design 08 sign-in-page)' (#22) from feat/sign-in-page into main
This commit was merged in pull request #22.
This commit is contained in:
@@ -0,0 +1,222 @@
|
||||
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
|
||||
|
||||
// Package nodedisplaysession is the contract of the seat "node-display-session", defined whole (seats/node-display-session/seat.json): no description.
|
||||
package nodedisplaysession
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// Seat is the seat's name.
|
||||
const Seat = "node-display-session"
|
||||
|
||||
// Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780):
|
||||
// a reader of a value of another form says "form N, this reader knows M".
|
||||
const Form = 1
|
||||
|
||||
// The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition
|
||||
// whose fields changed while its forms did not (design 47 H2 §780).
|
||||
const (
|
||||
generatedForms = "1"
|
||||
generatedFieldsDigest = "OpenAnswer=d2624fe0a7ba ReloadAnswer=a2050f1eb89b ReloadAnswerErrorsItem=0c1f092453e4 ReloadAnswerI3Item=d390c52f9468 WindowsAnswer=4422cf7500d3 WindowsAnswerWindowsItem=9ee49a74179d WorkspacesAnswer=ce08241865bf WorkspacesAnswerWorkspacesItem=b99be52dcc65"
|
||||
)
|
||||
|
||||
const (
|
||||
VerbReload = "reload"
|
||||
VerbWorkspaces = "workspaces"
|
||||
VerbWindows = "windows"
|
||||
VerbOpen = "open"
|
||||
)
|
||||
|
||||
// Verbs is every verb the seat serves, in its definition's order: a new copy each call.
|
||||
func Verbs() []string {
|
||||
return []string{VerbReload, VerbWorkspaces, VerbWindows, VerbOpen}
|
||||
}
|
||||
|
||||
// VerbDescription is a verb's description as the seat's definition says it, "" for a verb the seat does not serve or
|
||||
// does not describe (design 47 H2 H-A-449).
|
||||
func VerbDescription(verb string) string {
|
||||
switch verb {
|
||||
case VerbReload:
|
||||
return "Reload the session's configuration in place, keeping its windows."
|
||||
case VerbWorkspaces:
|
||||
return "The session's workspaces: each one's name, output, and whether it is visible or focused."
|
||||
case VerbWindows:
|
||||
return "The session's windows: each one's title, class, workspace and whether it has focus; narrowed to one workspace when named."
|
||||
case VerbOpen:
|
||||
return "Open an http or https address in the person's default browser, for any caller over the bus (ADR 0687 §4, ADR 0689 §3): any holder of the display session (i3 or sway) serves it the same way. A holder percent-encodes every character outside RFC 3986's unreserved set (letters, digits, -, ., _, ~) and the separators a URL needs (: / ? # [ ] @ & = + %) as the bytes of its UTF-8 form, and passes the address as one argument: nothing is refused for a character, and no shell reads it. Refused, naming the reason: a scheme other than http or https (named), no scheme (a file path), no host, an address over 2048 bytes once encoded, no graphical session running, no default program for the scheme, or the opener ending with a failure (its status named)."
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// ReloadInput is what reload takes.
|
||||
type ReloadInput struct {
|
||||
// reload even if the configuration on disk has errors (optional)
|
||||
Force bool `json:"force,omitempty"`
|
||||
}
|
||||
|
||||
// ReloadAnswerErrorsItem is a type of the contract.
|
||||
type ReloadAnswerErrorsItem struct {
|
||||
// the file holding the error (optional)
|
||||
File string `json:"file,omitempty"`
|
||||
// the line holding the error (optional)
|
||||
Line float64 `json:"line,omitempty"`
|
||||
Text string `json:"text"`
|
||||
}
|
||||
|
||||
// ReloadAnswerI3Item is a type of the contract.
|
||||
type ReloadAnswerI3Item struct {
|
||||
// why it failed (optional)
|
||||
Error string `json:"error,omitempty"`
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
// ReloadAnswer is what reload answers.
|
||||
type ReloadAnswer struct {
|
||||
// the configuration's errors on disk, found by the check that ran first
|
||||
Errors []ReloadAnswerErrorsItem `json:"errors"`
|
||||
// is the form of what this value carries, left out while it is 1 (design 47 H2 §780).
|
||||
Form int64 `json:"form,omitempty"`
|
||||
// the outcome of each command the reload ran, given only once it ran (optional)
|
||||
I3 []ReloadAnswerI3Item `json:"i3,omitempty"`
|
||||
// whether the reload ran
|
||||
Reloaded bool `json:"reloaded"`
|
||||
// the configuration watcher's status, given only once the reload ran (optional)
|
||||
Watcher map[string]any `json:"watcher,omitempty"`
|
||||
// why it did not reload, given only when it did not (optional)
|
||||
Why string `json:"why,omitempty"`
|
||||
}
|
||||
|
||||
// WorkspacesInput is what workspaces takes.
|
||||
type WorkspacesInput struct {
|
||||
}
|
||||
|
||||
// WorkspacesAnswerWorkspacesItem is a type of the contract.
|
||||
type WorkspacesAnswerWorkspacesItem struct {
|
||||
Focused bool `json:"focused"`
|
||||
Name string `json:"name"`
|
||||
Num float64 `json:"num"`
|
||||
Output string `json:"output"`
|
||||
Urgent bool `json:"urgent"`
|
||||
Visible bool `json:"visible"`
|
||||
}
|
||||
|
||||
// WorkspacesAnswer is what workspaces answers.
|
||||
type WorkspacesAnswer struct {
|
||||
// is the form of what this value carries, left out while it is 1 (design 47 H2 §780).
|
||||
Form int64 `json:"form,omitempty"`
|
||||
Workspaces []WorkspacesAnswerWorkspacesItem `json:"workspaces"`
|
||||
}
|
||||
|
||||
// WindowsInput is what windows takes.
|
||||
type WindowsInput struct {
|
||||
// one workspace (optional)
|
||||
Workspace string `json:"workspace,omitempty"`
|
||||
}
|
||||
|
||||
// WindowsAnswerWindowsItem is a type of the contract.
|
||||
type WindowsAnswerWindowsItem struct {
|
||||
// optional
|
||||
Class string `json:"class,omitempty"`
|
||||
ConID float64 `json:"con_id"`
|
||||
// optional
|
||||
Floating bool `json:"floating,omitempty"`
|
||||
// optional
|
||||
Focused bool `json:"focused,omitempty"`
|
||||
// optional
|
||||
Fullscreen bool `json:"fullscreen,omitempty"`
|
||||
// optional
|
||||
Instance string `json:"instance,omitempty"`
|
||||
// optional
|
||||
Marks []string `json:"marks,omitempty"`
|
||||
Output string `json:"output"`
|
||||
// optional
|
||||
Role string `json:"role,omitempty"`
|
||||
// optional
|
||||
Scratchpad bool `json:"scratchpad,omitempty"`
|
||||
Title string `json:"title"`
|
||||
// optional
|
||||
Urgent bool `json:"urgent,omitempty"`
|
||||
Window string `json:"window"`
|
||||
Workspace string `json:"workspace"`
|
||||
}
|
||||
|
||||
// WindowsAnswer is what windows answers.
|
||||
type WindowsAnswer struct {
|
||||
// is the form of what this value carries, left out while it is 1 (design 47 H2 §780).
|
||||
Form int64 `json:"form,omitempty"`
|
||||
Windows []WindowsAnswerWindowsItem `json:"windows"`
|
||||
}
|
||||
|
||||
// OpenInput is what open takes.
|
||||
type OpenInput struct {
|
||||
// the http or https address to open
|
||||
Address string `json:"address"`
|
||||
}
|
||||
|
||||
// OpenAnswer is what open answers.
|
||||
type OpenAnswer struct {
|
||||
// the address as handed on, encoded
|
||||
Address string `json:"address"`
|
||||
// the first word of that entry's command; given only once the opener started (optional)
|
||||
Command string `json:"command,omitempty"`
|
||||
// is the form of what this value carries, left out while it is 1 (design 47 H2 §780).
|
||||
Form int64 `json:"form,omitempty"`
|
||||
// the desktop entry that opened it, as browser.desktop; given only once the opener started (optional)
|
||||
Program string `json:"program,omitempty"`
|
||||
// opened when the opener ended well within its bound, opening when it still ran at its bound
|
||||
Started string `json:"started"`
|
||||
}
|
||||
|
||||
// The values of OpenAnswer's started.
|
||||
const (
|
||||
OpenAnswerStartedOpened = "opened"
|
||||
OpenAnswerStartedOpening = "opening"
|
||||
)
|
||||
|
||||
// DecodeReloadAnswer reads a ReloadAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780).
|
||||
func DecodeReloadAnswer(raw []byte) (ReloadAnswer, int, error) {
|
||||
var v ReloadAnswer
|
||||
if err := json.Unmarshal(raw, &v); err != nil {
|
||||
return v, 0, err
|
||||
}
|
||||
return v, formRead(raw), nil
|
||||
}
|
||||
|
||||
// DecodeWorkspacesAnswer reads a WorkspacesAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780).
|
||||
func DecodeWorkspacesAnswer(raw []byte) (WorkspacesAnswer, int, error) {
|
||||
var v WorkspacesAnswer
|
||||
if err := json.Unmarshal(raw, &v); err != nil {
|
||||
return v, 0, err
|
||||
}
|
||||
return v, formRead(raw), nil
|
||||
}
|
||||
|
||||
// DecodeWindowsAnswer reads a WindowsAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780).
|
||||
func DecodeWindowsAnswer(raw []byte) (WindowsAnswer, int, error) {
|
||||
var v WindowsAnswer
|
||||
if err := json.Unmarshal(raw, &v); err != nil {
|
||||
return v, 0, err
|
||||
}
|
||||
return v, formRead(raw), nil
|
||||
}
|
||||
|
||||
// DecodeOpenAnswer reads a OpenAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780).
|
||||
func DecodeOpenAnswer(raw []byte) (OpenAnswer, int, error) {
|
||||
var v OpenAnswer
|
||||
if err := json.Unmarshal(raw, &v); err != nil {
|
||||
return v, 0, err
|
||||
}
|
||||
return v, formRead(raw), nil
|
||||
}
|
||||
|
||||
// formRead is the form a value says on the wire: 1 when it says none, or is no object.
|
||||
func formRead(raw []byte) int {
|
||||
var f struct {
|
||||
Form int `json:"form"`
|
||||
}
|
||||
if json.Unmarshal(raw, &f) != nil || f.Form < 1 {
|
||||
return 1
|
||||
}
|
||||
return f.Form
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
|
||||
|
||||
package nodedisplaysession
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// TestFixtures reads every fixture of seats/node-display-session/fixtures: each decodes into its type, a field the type does not
|
||||
// know is dropped (ADR 0608 §6), and it reads back as its wire says; each subject named is the contract's.
|
||||
func TestFixtures(t *testing.T) {
|
||||
cases := []struct {
|
||||
name, subject, given, wire string
|
||||
decode func([]byte) (any, error)
|
||||
subjectIs *regexp.Regexp
|
||||
}{
|
||||
{name: "open takes an address", subject: "", given: "{\"address\":\"https://example.invalid/sign-in\"}", wire: "{\"address\":\"https://example.invalid/sign-in\"}",
|
||||
decode: func(b []byte) (any, error) { var v OpenInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
|
||||
{name: "open answers a page that opened", subject: "", given: "{\"address\":\"https://example.invalid/sign-in\",\"command\":\"browser\",\"program\":\"browser.desktop\",\"started\":\"opened\"}", wire: "{\"address\":\"https://example.invalid/sign-in\",\"command\":\"browser\",\"program\":\"browser.desktop\",\"started\":\"opened\"}",
|
||||
decode: func(b []byte) (any, error) { var v OpenAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
|
||||
{name: "open answers a page still opening", subject: "", given: "{\"address\":\"https://example.invalid/sign-in\",\"started\":\"opening\"}", wire: "{\"address\":\"https://example.invalid/sign-in\",\"started\":\"opening\"}",
|
||||
decode: func(b []byte) (any, error) { var v OpenAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
|
||||
{name: "reload answers a reload that ran", subject: "", given: "{\"errors\":[],\"i3\":[{\"success\":true}],\"reloaded\":true,\"watcher\":{\"files_watched\":3,\"reloads\":1,\"since\":\"2026-11-24T12:00:00Z\"}}", wire: "{\"errors\":[],\"i3\":[{\"success\":true}],\"reloaded\":true,\"watcher\":{\"files_watched\":3,\"reloads\":1,\"since\":\"2026-11-24T12:00:00Z\"}}",
|
||||
decode: func(b []byte) (any, error) { var v ReloadAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
|
||||
{name: "reload answers a reload refused for the configuration's errors on disk", subject: "", given: "{\"errors\":[{\"file\":\"config\",\"line\":3,\"text\":\"bad syntax\"}],\"reloaded\":false,\"why\":\"the configuration on disk has errors; fix them, or force\"}", wire: "{\"errors\":[{\"file\":\"config\",\"line\":3,\"text\":\"bad syntax\"}],\"reloaded\":false,\"why\":\"the configuration on disk has errors; fix them, or force\"}",
|
||||
decode: func(b []byte) (any, error) { var v ReloadAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
|
||||
{name: "workspaces answers the session's workspaces", subject: "", given: "{\"workspaces\":[{\"focused\":true,\"name\":\"1\",\"num\":1,\"output\":\"eDP-1\",\"urgent\":false,\"visible\":true}]}", wire: "{\"workspaces\":[{\"focused\":true,\"name\":\"1\",\"num\":1,\"output\":\"eDP-1\",\"urgent\":false,\"visible\":true}]}",
|
||||
decode: func(b []byte) (any, error) { var v WorkspacesAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
|
||||
{name: "windows answers the session's windows", subject: "", given: "{\"windows\":[{\"con_id\":1,\"output\":\"eDP-1\",\"title\":\"a terminal\",\"window\":\"0x1\",\"workspace\":\"1\"}]}", wire: "{\"windows\":[{\"con_id\":1,\"output\":\"eDP-1\",\"title\":\"a terminal\",\"window\":\"0x1\",\"workspace\":\"1\"}]}",
|
||||
decode: func(b []byte) (any, error) { var v WindowsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
|
||||
}
|
||||
for _, c := range cases {
|
||||
v, err := c.decode([]byte(c.given))
|
||||
if err != nil {
|
||||
t.Errorf("%s: does not decode: %v", c.name, err)
|
||||
continue
|
||||
}
|
||||
back, err := json.Marshal(v)
|
||||
if err != nil {
|
||||
t.Errorf("%s: does not encode: %v", c.name, err)
|
||||
continue
|
||||
}
|
||||
var got, want any
|
||||
if err := json.Unmarshal(back, &got); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := json.Unmarshal([]byte(c.wire), &want); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !reflect.DeepEqual(got, want) {
|
||||
t.Errorf("%s: reads back as %s, want %s", c.name, back, c.wire)
|
||||
}
|
||||
if c.subjectIs != nil && !c.subjectIs.MatchString(c.subject) {
|
||||
t.Errorf("%s: subject %q is not the contract's %s", c.name, c.subject, c.subjectIs)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
module git.novox.be/novox/mesh-contracts/go/seats/nodedisplaysession
|
||||
|
||||
go 1.26.0
|
||||
+18
@@ -48,6 +48,15 @@
|
||||
],
|
||||
"generated-from": "."
|
||||
},
|
||||
{
|
||||
"name": "go-nodedisplaysession",
|
||||
"kind": "package",
|
||||
"language": "go",
|
||||
"paths": [
|
||||
"go/seats/nodedisplaysession"
|
||||
],
|
||||
"generated-from": "."
|
||||
},
|
||||
{
|
||||
"name": "ts-meshbroker",
|
||||
"kind": "package",
|
||||
@@ -84,6 +93,15 @@
|
||||
],
|
||||
"generated-from": "."
|
||||
},
|
||||
{
|
||||
"name": "ts-nodedisplaysession",
|
||||
"kind": "package",
|
||||
"language": "typescript",
|
||||
"paths": [
|
||||
"ts/seats/nodedisplaysession"
|
||||
],
|
||||
"generated-from": "."
|
||||
},
|
||||
{
|
||||
"name": "go-meshmoduleassigner",
|
||||
"kind": "package",
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
[
|
||||
{
|
||||
"name": "open takes an address",
|
||||
"of": "verb:open.input",
|
||||
"given": {
|
||||
"address": "https://example.invalid/sign-in"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "open answers a page that opened",
|
||||
"of": "verb:open.answer",
|
||||
"given": {
|
||||
"address": "https://example.invalid/sign-in",
|
||||
"program": "browser.desktop",
|
||||
"command": "browser",
|
||||
"started": "opened"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "open answers a page still opening",
|
||||
"of": "verb:open.answer",
|
||||
"given": {
|
||||
"address": "https://example.invalid/sign-in",
|
||||
"started": "opening"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "reload answers a reload that ran",
|
||||
"of": "verb:reload.answer",
|
||||
"given": {
|
||||
"reloaded": true,
|
||||
"i3": [
|
||||
{
|
||||
"success": true
|
||||
}
|
||||
],
|
||||
"errors": [],
|
||||
"watcher": {
|
||||
"since": "2026-11-24T12:00:00Z",
|
||||
"files_watched": 3,
|
||||
"reloads": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "reload answers a reload refused for the configuration's errors on disk",
|
||||
"of": "verb:reload.answer",
|
||||
"given": {
|
||||
"reloaded": false,
|
||||
"errors": [
|
||||
{
|
||||
"file": "config",
|
||||
"line": 3,
|
||||
"text": "bad syntax"
|
||||
}
|
||||
],
|
||||
"why": "the configuration on disk has errors; fix them, or force"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "workspaces answers the session's workspaces",
|
||||
"of": "verb:workspaces.answer",
|
||||
"given": {
|
||||
"workspaces": [
|
||||
{
|
||||
"num": 1,
|
||||
"name": "1",
|
||||
"output": "eDP-1",
|
||||
"visible": true,
|
||||
"focused": true,
|
||||
"urgent": false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "windows answers the session's windows",
|
||||
"of": "verb:windows.answer",
|
||||
"given": {
|
||||
"windows": [
|
||||
{
|
||||
"con_id": 1,
|
||||
"window": "0x1",
|
||||
"title": "a terminal",
|
||||
"workspace": "1",
|
||||
"output": "eDP-1"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -2,15 +2,83 @@
|
||||
"format": 1,
|
||||
"seat": "node-display-session",
|
||||
"scope": "node",
|
||||
"grain": "seat-list",
|
||||
"grain": "whole",
|
||||
"domain": "Core",
|
||||
"decision": "novox/hq ADR 0208",
|
||||
"decision": "novox/hq ADR 0208, ADR 0687",
|
||||
"verbs": [
|
||||
{
|
||||
"name": "reload",
|
||||
"description": "Reload the session's configuration in place, keeping its windows.",
|
||||
"input": {
|
||||
"properties": {},
|
||||
"properties": {
|
||||
"force": {
|
||||
"description": "reload even if the configuration on disk has errors (optional)",
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"answer": {
|
||||
"properties": {
|
||||
"reloaded": {
|
||||
"description": "whether the reload ran",
|
||||
"type": "boolean"
|
||||
},
|
||||
"i3": {
|
||||
"description": "the outcome of each command the reload ran, given only once it ran (optional)",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"success": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"error": {
|
||||
"description": "why it failed (optional)",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"success"
|
||||
]
|
||||
}
|
||||
},
|
||||
"errors": {
|
||||
"description": "the configuration's errors on disk, found by the check that ran first",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "the file holding the error (optional)",
|
||||
"type": "string"
|
||||
},
|
||||
"line": {
|
||||
"description": "the line holding the error (optional)",
|
||||
"type": "number"
|
||||
},
|
||||
"text": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"text"
|
||||
]
|
||||
}
|
||||
},
|
||||
"watcher": {
|
||||
"description": "the configuration watcher's status, given only once the reload ran (optional)",
|
||||
"type": "object"
|
||||
},
|
||||
"why": {
|
||||
"description": "why it did not reload, given only when it did not (optional)",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"reloaded",
|
||||
"errors"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
@@ -20,6 +88,48 @@
|
||||
"input": {
|
||||
"properties": {},
|
||||
"type": "object"
|
||||
},
|
||||
"answer": {
|
||||
"properties": {
|
||||
"workspaces": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"num": {
|
||||
"type": "number"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"output": {
|
||||
"type": "string"
|
||||
},
|
||||
"visible": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"focused": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"urgent": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"num",
|
||||
"name",
|
||||
"output",
|
||||
"visible",
|
||||
"focused",
|
||||
"urgent"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"workspaces"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -33,7 +143,130 @@
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"answer": {
|
||||
"properties": {
|
||||
"windows": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"con_id": {
|
||||
"type": "number"
|
||||
},
|
||||
"window": {
|
||||
"type": "string"
|
||||
},
|
||||
"class": {
|
||||
"description": "optional",
|
||||
"type": "string"
|
||||
},
|
||||
"instance": {
|
||||
"description": "optional",
|
||||
"type": "string"
|
||||
},
|
||||
"role": {
|
||||
"description": "optional",
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"workspace": {
|
||||
"type": "string"
|
||||
},
|
||||
"output": {
|
||||
"type": "string"
|
||||
},
|
||||
"focused": {
|
||||
"description": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
"urgent": {
|
||||
"description": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
"floating": {
|
||||
"description": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
"fullscreen": {
|
||||
"description": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
"scratchpad": {
|
||||
"description": "optional",
|
||||
"type": "boolean"
|
||||
},
|
||||
"marks": {
|
||||
"description": "optional",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"con_id",
|
||||
"window",
|
||||
"title",
|
||||
"workspace",
|
||||
"output"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"windows"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "open",
|
||||
"description": "Open an http or https address in the person's default browser, for any caller over the bus (ADR 0687 §4, ADR 0689 §3): any holder of the display session (i3 or sway) serves it the same way. A holder percent-encodes every character outside RFC 3986's unreserved set (letters, digits, -, ., _, ~) and the separators a URL needs (: / ? # [ ] @ & = + %) as the bytes of its UTF-8 form, and passes the address as one argument: nothing is refused for a character, and no shell reads it. Refused, naming the reason: a scheme other than http or https (named), no scheme (a file path), no host, an address over 2048 bytes once encoded, no graphical session running, no default program for the scheme, or the opener ending with a failure (its status named).",
|
||||
"input": {
|
||||
"properties": {
|
||||
"address": {
|
||||
"description": "the http or https address to open",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"address"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"answer": {
|
||||
"properties": {
|
||||
"address": {
|
||||
"description": "the address as handed on, encoded",
|
||||
"type": "string"
|
||||
},
|
||||
"program": {
|
||||
"description": "the desktop entry that opened it, as browser.desktop; given only once the opener started (optional)",
|
||||
"type": "string"
|
||||
},
|
||||
"command": {
|
||||
"description": "the first word of that entry's command; given only once the opener started (optional)",
|
||||
"type": "string"
|
||||
},
|
||||
"started": {
|
||||
"description": "opened when the opener ended well within its bound, opening when it still ran at its bound",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"opened",
|
||||
"opening"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"address",
|
||||
"started"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"class": "act"
|
||||
}
|
||||
],
|
||||
"receives": [
|
||||
|
||||
+128
@@ -0,0 +1,128 @@
|
||||
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
|
||||
|
||||
// The contract of the seat "node-display-session", defined whole (seats/node-display-session/seat.json): no description.
|
||||
|
||||
export declare const seat: "node-display-session";
|
||||
|
||||
export declare const verbs: {
|
||||
readonly reload: "reload";
|
||||
readonly workspaces: "workspaces";
|
||||
readonly windows: "windows";
|
||||
readonly open: "open";
|
||||
};
|
||||
|
||||
/** is what reload takes. */
|
||||
export interface ReloadInput {
|
||||
/** reload even if the configuration on disk has errors (optional) */
|
||||
"force"?: boolean;
|
||||
}
|
||||
|
||||
export interface ReloadAnswerErrorsItem {
|
||||
/** the file holding the error (optional) */
|
||||
"file"?: string;
|
||||
/** the line holding the error (optional) */
|
||||
"line"?: number;
|
||||
"text": string;
|
||||
}
|
||||
|
||||
export interface ReloadAnswerI3Item {
|
||||
/** why it failed (optional) */
|
||||
"error"?: string;
|
||||
"success": boolean;
|
||||
}
|
||||
|
||||
/** is what reload answers. */
|
||||
export interface ReloadAnswer {
|
||||
/** the configuration's errors on disk, found by the check that ran first */
|
||||
"errors": ReloadAnswerErrorsItem[];
|
||||
/** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */
|
||||
"form"?: number;
|
||||
/** the outcome of each command the reload ran, given only once it ran (optional) */
|
||||
"i3"?: ReloadAnswerI3Item[];
|
||||
/** whether the reload ran */
|
||||
"reloaded": boolean;
|
||||
/** the configuration watcher's status, given only once the reload ran (optional) */
|
||||
"watcher"?: Record<string, unknown>;
|
||||
/** why it did not reload, given only when it did not (optional) */
|
||||
"why"?: string;
|
||||
}
|
||||
|
||||
/** is what workspaces takes. */
|
||||
export interface WorkspacesInput {
|
||||
}
|
||||
|
||||
export interface WorkspacesAnswerWorkspacesItem {
|
||||
"focused": boolean;
|
||||
"name": string;
|
||||
"num": number;
|
||||
"output": string;
|
||||
"urgent": boolean;
|
||||
"visible": boolean;
|
||||
}
|
||||
|
||||
/** is what workspaces answers. */
|
||||
export interface WorkspacesAnswer {
|
||||
/** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */
|
||||
"form"?: number;
|
||||
"workspaces": WorkspacesAnswerWorkspacesItem[];
|
||||
}
|
||||
|
||||
/** is what windows takes. */
|
||||
export interface WindowsInput {
|
||||
/** one workspace (optional) */
|
||||
"workspace"?: string;
|
||||
}
|
||||
|
||||
export interface WindowsAnswerWindowsItem {
|
||||
/** optional */
|
||||
"class"?: string;
|
||||
"con_id": number;
|
||||
/** optional */
|
||||
"floating"?: boolean;
|
||||
/** optional */
|
||||
"focused"?: boolean;
|
||||
/** optional */
|
||||
"fullscreen"?: boolean;
|
||||
/** optional */
|
||||
"instance"?: string;
|
||||
/** optional */
|
||||
"marks"?: string[];
|
||||
"output": string;
|
||||
/** optional */
|
||||
"role"?: string;
|
||||
/** optional */
|
||||
"scratchpad"?: boolean;
|
||||
"title": string;
|
||||
/** optional */
|
||||
"urgent"?: boolean;
|
||||
"window": string;
|
||||
"workspace": string;
|
||||
}
|
||||
|
||||
/** is what windows answers. */
|
||||
export interface WindowsAnswer {
|
||||
/** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */
|
||||
"form"?: number;
|
||||
"windows": WindowsAnswerWindowsItem[];
|
||||
}
|
||||
|
||||
/** is what open takes. */
|
||||
export interface OpenInput {
|
||||
/** the http or https address to open */
|
||||
"address": string;
|
||||
}
|
||||
|
||||
/** is what open answers. */
|
||||
export interface OpenAnswer {
|
||||
/** the address as handed on, encoded */
|
||||
"address": string;
|
||||
/** the first word of that entry's command; given only once the opener started (optional) */
|
||||
"command"?: string;
|
||||
/** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */
|
||||
"form"?: number;
|
||||
/** the desktop entry that opened it, as browser.desktop; given only once the opener started (optional) */
|
||||
"program"?: string;
|
||||
/** opened when the opener ended well within its bound, opening when it still ran at its bound */
|
||||
"started": "opened" | "opening";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
|
||||
|
||||
// The contract of the seat "node-display-session", defined whole (seats/node-display-session/seat.json): no description.
|
||||
|
||||
export const seat = "node-display-session";
|
||||
|
||||
export const verbs = {
|
||||
reload: "reload",
|
||||
workspaces: "workspaces",
|
||||
windows: "windows",
|
||||
open: "open",
|
||||
};
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"lockfileVersion": 3,
|
||||
"name": "@novox/mesh-contracts-node-display-session",
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@novox/mesh-contracts-node-display-session",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
},
|
||||
"requires": true,
|
||||
"version": "0.1.0"
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"description": "The contract of the seat node-display-session, generated from its definition.",
|
||||
"exports": {
|
||||
".": {
|
||||
"default": "./index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts",
|
||||
"parts"
|
||||
],
|
||||
"name": "@novox/mesh-contracts-node-display-session",
|
||||
"type": "module",
|
||||
"types": "./index.d.ts",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
Reference in New Issue
Block a user