@standardagents/code 0.14.1-issue.653.6647dc-linux-x64-gnu → 0.14.1-issue.658.a1599e-darwin-arm64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Standard Code Daemon.app/Contents/CodeResources +0 -0
- package/Standard Code Daemon.app/Contents/Helpers/tmux +0 -0
- package/Standard Code Daemon.app/Contents/Info.plist +42 -0
- package/Standard Code Daemon.app/Contents/MacOS/standardd +4 -0
- package/{lib/standard-plugin-runner/index.mjs → Standard Code Daemon.app/Contents/Resources/plugin-runner/index.mjs } +62 -30
- package/{lib/standard-plugin-runner/runtime.json → Standard Code Daemon.app/Contents/Resources/plugin-runner/runtime.json } +1 -1
- package/{lib/standard-plugin-runner/sdk.mjs → Standard Code Daemon.app/Contents/Resources/plugin-runner/sdk.mjs } +141 -77
- package/{lib/standard-plugin-runner/worker.mjs → Standard Code Daemon.app/Contents/Resources/plugin-runner/worker.mjs } +188 -86
- package/Standard Code Daemon.app/Contents/Resources/tmux/TMUX-ARTIFACT-MANIFEST.sha256 +6 -0
- package/Standard Code Daemon.app/Contents/Resources/tmux/TMUX-ARTIFACT-METADATA.txt +23 -0
- package/Standard Code Daemon.app/Contents/Resources/tmux/TMUX-BUILD-TOOLS.txt +11 -0
- package/Standard Code Daemon.app/Contents/Resources/tmux/TMUX-OTOOL-L.txt +4 -0
- package/Standard Code Daemon.app/Contents/Resources/tmux/TMUX-SIGNED-RUNTIME.sha256 +1 -0
- package/Standard Code Daemon.app/Contents/Resources/tmux/licenses/libevent.txt +99 -0
- package/Standard Code Daemon.app/Contents/Resources/tmux/licenses/tmux.txt +13 -0
- package/Standard Code Daemon.app/Contents/_CodeSignature/CodeResources +269 -0
- package/Standard Code.app/Contents/CodeResources +0 -0
- package/Standard Code.app/Contents/Info.plist +42 -0
- package/Standard Code.app/Contents/MacOS/standard +0 -0
- package/Standard Code.app/Contents/_CodeSignature/CodeResources +115 -0
- package/licenses/THIRD-PARTY.txt +0 -33
- package/manifest.json +1 -1
- package/manifest.sig +1 -1
- package/package.json +6 -9
- package/bin/standard +0 -4
- package/bin/standardd +0 -4
- package/bin/tmux +0 -0
- /package/{lib/standard-plugin-runner → Standard Code Daemon.app/Contents/Resources/plugin-runner}/THIRD-PARTY.txt +0 -0
- /package/{lib/standard-plugin-runner → Standard Code Daemon.app/Contents/Resources/plugin-runner}/loader.mjs +0 -0
|
@@ -29,7 +29,22 @@ var SURFACE_KINDS = Object.freeze([
|
|
|
29
29
|
"key",
|
|
30
30
|
"link"
|
|
31
31
|
]);
|
|
32
|
-
var PRESENTATIONS = Object.freeze(["popover", "column", "pane"]);
|
|
32
|
+
var PRESENTATIONS = Object.freeze(["popover", "column", "pane", "stage"]);
|
|
33
|
+
var MUX_EXPRESSIONS = Object.freeze([
|
|
34
|
+
"neutral",
|
|
35
|
+
"blink",
|
|
36
|
+
"happy",
|
|
37
|
+
"happy-smile",
|
|
38
|
+
"sad",
|
|
39
|
+
"grin",
|
|
40
|
+
"surprise",
|
|
41
|
+
"sleepy",
|
|
42
|
+
"angry",
|
|
43
|
+
"focus",
|
|
44
|
+
"question",
|
|
45
|
+
"exclaim",
|
|
46
|
+
"cross"
|
|
47
|
+
]);
|
|
33
48
|
var ANCHORS = Object.freeze([
|
|
34
49
|
"plugins",
|
|
35
50
|
"machine.before",
|
|
@@ -58,6 +73,7 @@ var LIMITS = Object.freeze({
|
|
|
58
73
|
canvasColumns: 512,
|
|
59
74
|
canvasRows: 256,
|
|
60
75
|
canvasHoverBytes: 512,
|
|
76
|
+
canvasShapes: 256,
|
|
61
77
|
stateKeys: 256,
|
|
62
78
|
stateValueBytes: 64 * 1024
|
|
63
79
|
});
|
|
@@ -71,13 +87,13 @@ var PluginError = class extends Error {
|
|
|
71
87
|
function ensure(condition, code, message) {
|
|
72
88
|
if (!condition) throw new PluginError(code, message);
|
|
73
89
|
}
|
|
74
|
-
function object(
|
|
75
|
-
return
|
|
90
|
+
function object(value2) {
|
|
91
|
+
return value2 !== null && typeof value2 === "object" && !Array.isArray(value2);
|
|
76
92
|
}
|
|
77
|
-
function identifier(
|
|
78
|
-
return typeof
|
|
93
|
+
function identifier(value2) {
|
|
94
|
+
return typeof value2 === "string" && /^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$/.test(value2);
|
|
79
95
|
}
|
|
80
|
-
function jsonBytes(
|
|
96
|
+
function jsonBytes(value2, limit = LIMITS.frameBytes) {
|
|
81
97
|
const seen = /* @__PURE__ */ new Set();
|
|
82
98
|
function visit(item, depth) {
|
|
83
99
|
ensure(depth <= 32, "invalid_payload", "JSON nesting exceeds 32 levels");
|
|
@@ -93,21 +109,21 @@ function jsonBytes(value, limit = LIMITS.frameBytes) {
|
|
|
93
109
|
for (const child of Object.values(item)) visit(child, depth + 1);
|
|
94
110
|
seen.delete(item);
|
|
95
111
|
}
|
|
96
|
-
visit(
|
|
97
|
-
const text2 = JSON.stringify(
|
|
112
|
+
visit(value2, 0);
|
|
113
|
+
const text2 = JSON.stringify(value2);
|
|
98
114
|
ensure(Buffer.byteLength(text2) <= limit, "payload_too_large", `Payload exceeds ${limit} bytes`);
|
|
99
115
|
return text2;
|
|
100
116
|
}
|
|
101
|
-
function freeze(
|
|
102
|
-
if (
|
|
103
|
-
Object.values(
|
|
104
|
-
Object.freeze(
|
|
117
|
+
function freeze(value2) {
|
|
118
|
+
if (value2 && typeof value2 === "object") {
|
|
119
|
+
Object.values(value2).forEach(freeze);
|
|
120
|
+
Object.freeze(value2);
|
|
105
121
|
}
|
|
106
|
-
return
|
|
122
|
+
return value2;
|
|
107
123
|
}
|
|
108
|
-
function validateManifest(
|
|
109
|
-
ensure(object(
|
|
110
|
-
jsonBytes(
|
|
124
|
+
function validateManifest(value2) {
|
|
125
|
+
ensure(object(value2), "invalid_manifest", "package.json must contain a standardPlugin object");
|
|
126
|
+
jsonBytes(value2, LIMITS.manifestBytes);
|
|
111
127
|
const allowed = [
|
|
112
128
|
"apiVersion",
|
|
113
129
|
"id",
|
|
@@ -121,8 +137,8 @@ function validateManifest(value) {
|
|
|
121
137
|
"configSchema",
|
|
122
138
|
"hookTimeoutMs"
|
|
123
139
|
];
|
|
124
|
-
ensure(Object.keys(
|
|
125
|
-
const manifest = structuredClone({ singleton: false, order: 0, capabilities: [], contributions: [], hookTimeoutMs: 5e3, ...
|
|
140
|
+
ensure(Object.keys(value2).every((key) => allowed.includes(key)), "invalid_manifest", "Unknown manifest field");
|
|
141
|
+
const manifest = structuredClone({ singleton: false, order: 0, capabilities: [], contributions: [], hookTimeoutMs: 5e3, ...value2 });
|
|
126
142
|
ensure(manifest.apiVersion === 1, "incompatible_version", "Plugin requires a different SDK API version");
|
|
127
143
|
ensure(identifier(manifest.id), "invalid_manifest", "Plugin id must be a stable identifier");
|
|
128
144
|
ensure(
|
|
@@ -192,6 +208,11 @@ function validateManifest(value) {
|
|
|
192
208
|
"Only panels, cards, and commands declare a presentation"
|
|
193
209
|
);
|
|
194
210
|
ensure(declaration.kind !== "card" || declaration.anchor === "plugins", "invalid_manifest", "Cards use the plugins anchor");
|
|
211
|
+
ensure(
|
|
212
|
+
declaration.presentation !== "stage" || declaration.kind !== "panel" || declaration.anchor === "account",
|
|
213
|
+
"invalid_manifest",
|
|
214
|
+
"Stage panels use the account anchor"
|
|
215
|
+
);
|
|
195
216
|
}
|
|
196
217
|
for (const declaration of manifest.contributions) {
|
|
197
218
|
ensure(
|
|
@@ -346,11 +367,11 @@ var RpcPeer = class {
|
|
|
346
367
|
const id = `${this.idPrefix}-${++this.nextId}`;
|
|
347
368
|
return new Promise((resolve2, reject) => {
|
|
348
369
|
let timer;
|
|
349
|
-
const finish = (error,
|
|
370
|
+
const finish = (error, value2) => {
|
|
350
371
|
if (!this.pending.delete(id)) return;
|
|
351
372
|
this.clock.clearTimeout(timer);
|
|
352
373
|
signal?.removeEventListener("abort", cancel);
|
|
353
|
-
error ? reject(error) : resolve2(
|
|
374
|
+
error ? reject(error) : resolve2(value2);
|
|
354
375
|
};
|
|
355
376
|
const cancelWith = (code) => {
|
|
356
377
|
finish(new PluginError(code, code === "timeout" ? "Request deadline elapsed" : "Request was cancelled"));
|
|
@@ -420,8 +441,8 @@ var RpcPeer = class {
|
|
|
420
441
|
ensure(!controller.signal.aborted, "cancelled", "Request was cancelled");
|
|
421
442
|
ensure(typeof this.onRequest === "function", "unsupported_operation", "No request handler");
|
|
422
443
|
return this.onRequest(frame.operation, { signal: controller.signal, timeoutMs: frame.timeoutMs });
|
|
423
|
-
}).then((
|
|
424
|
-
if (!controller.signal.aborted) respond({ ok: true, value:
|
|
444
|
+
}).then((value2) => {
|
|
445
|
+
if (!controller.signal.aborted) respond({ ok: true, value: value2 ?? null });
|
|
425
446
|
}, (error) => {
|
|
426
447
|
if (!controller.signal.aborted) respond({ ok: false, error: wireError(error) });
|
|
427
448
|
}).finally(() => {
|
|
@@ -457,68 +478,78 @@ var VIEW_LIMITS = Object.freeze({
|
|
|
457
478
|
});
|
|
458
479
|
var TONES = Object.freeze(["ok", "info", "warn", "error", "muted", "accent", "pending", "bright"]);
|
|
459
480
|
var WEIGHTS = ["normal", "bold", "dim"];
|
|
481
|
+
var TIME_STYLES = ["duration", "relative"];
|
|
460
482
|
var ALIGNS = ["start", "center", "end"];
|
|
461
483
|
var FORBIDDEN = /[\u0000-\u001f\u007f-\u009f\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/;
|
|
462
484
|
var invalid = (message) => ensure(false, "invalid_payload", message);
|
|
463
|
-
function text(
|
|
464
|
-
if (typeof
|
|
465
|
-
ensure(!FORBIDDEN.test(
|
|
485
|
+
function text(value2, field) {
|
|
486
|
+
if (typeof value2 !== "string") invalid(`Plugin view ${field} must be a string`);
|
|
487
|
+
ensure(!FORBIDDEN.test(value2), "invalid_payload", "Plugin view text contains a control or bidirectional character");
|
|
466
488
|
}
|
|
467
|
-
function optionalText(
|
|
468
|
-
if (
|
|
489
|
+
function optionalText(value2, field) {
|
|
490
|
+
if (value2 !== void 0) text(value2, field);
|
|
469
491
|
}
|
|
470
|
-
function choice(
|
|
471
|
-
ensure(
|
|
492
|
+
function choice(value2, choices, field) {
|
|
493
|
+
ensure(value2 === void 0 || choices.includes(value2), "invalid_payload", `Invalid plugin view ${field}`);
|
|
472
494
|
}
|
|
473
|
-
function tone(
|
|
474
|
-
choice(
|
|
495
|
+
function tone(value2) {
|
|
496
|
+
choice(value2, TONES, "tone");
|
|
475
497
|
}
|
|
476
|
-
function integer(
|
|
477
|
-
ensure(
|
|
498
|
+
function integer(value2, max, field) {
|
|
499
|
+
ensure(value2 === void 0 || Number.isInteger(value2) && value2 >= 0 && value2 <= max, "invalid_payload", `Invalid plugin view ${field}`);
|
|
478
500
|
}
|
|
479
|
-
function flag(
|
|
480
|
-
ensure(
|
|
501
|
+
function flag(value2, field) {
|
|
502
|
+
ensure(value2 === void 0 || typeof value2 === "boolean", "invalid_payload", `Invalid plugin view ${field}`);
|
|
481
503
|
}
|
|
482
|
-
function number(
|
|
483
|
-
ensure(typeof
|
|
504
|
+
function number(value2) {
|
|
505
|
+
ensure(typeof value2 === "number" && Number.isFinite(value2), "invalid_payload", "Plugin view number is not finite");
|
|
484
506
|
}
|
|
485
|
-
function list(
|
|
486
|
-
if (optional &&
|
|
487
|
-
ensure(Array.isArray(
|
|
488
|
-
return
|
|
507
|
+
function list(value2, field, optional = false) {
|
|
508
|
+
if (optional && value2 === void 0) return [];
|
|
509
|
+
ensure(Array.isArray(value2), "invalid_payload", `Plugin view ${field} must be an array`);
|
|
510
|
+
return value2;
|
|
489
511
|
}
|
|
490
|
-
function entries(
|
|
491
|
-
for (const item of list(
|
|
512
|
+
function entries(value2, field, optional, check) {
|
|
513
|
+
for (const item of list(value2, field, optional)) {
|
|
492
514
|
ensure(object(item), "invalid_payload", `Plugin view ${field} must contain objects`);
|
|
493
515
|
check(item);
|
|
494
516
|
}
|
|
495
517
|
}
|
|
496
|
-
function bounded(
|
|
497
|
-
const values = list(
|
|
518
|
+
function bounded(value2, field, limit, optional = false) {
|
|
519
|
+
const values = list(value2, field, optional);
|
|
498
520
|
ensure(values.length <= limit, "invalid_payload", `Plugin view ${field} has more than ${limit} entries`);
|
|
499
521
|
return values;
|
|
500
522
|
}
|
|
501
|
-
function boundedEntries(
|
|
502
|
-
entries(bounded(
|
|
523
|
+
function boundedEntries(value2, field, check) {
|
|
524
|
+
entries(bounded(value2, field, VIEW_LIMITS.items), field, false, check);
|
|
503
525
|
}
|
|
504
|
-
function spans(
|
|
505
|
-
entries(
|
|
526
|
+
function spans(value2, optional) {
|
|
527
|
+
entries(value2, "spans", optional, (span) => {
|
|
506
528
|
text(span.text, "span text");
|
|
507
529
|
tone(span.tone);
|
|
508
530
|
choice(span.weight, WEIGHTS, "weight");
|
|
509
531
|
flag(span.mono, "mono");
|
|
532
|
+
if (span.time !== void 0) {
|
|
533
|
+
ensure(
|
|
534
|
+
object(span.time) && Number.isSafeInteger(span.time.at) && span.time.at >= 0,
|
|
535
|
+
"invalid_payload",
|
|
536
|
+
"Plugin view time must be epoch milliseconds"
|
|
537
|
+
);
|
|
538
|
+
choice(span.time.style, TIME_STYLES, "time style");
|
|
539
|
+
ensure(span.time.style !== void 0, "invalid_payload", "Invalid plugin view time style");
|
|
540
|
+
}
|
|
510
541
|
});
|
|
511
542
|
}
|
|
512
|
-
function action(
|
|
513
|
-
if (optional &&
|
|
514
|
-
ensure(object(
|
|
515
|
-
text(
|
|
516
|
-
optionalText(
|
|
517
|
-
optionalText(
|
|
518
|
-
if (
|
|
519
|
-
ensure(object(
|
|
520
|
-
text(
|
|
521
|
-
text(
|
|
543
|
+
function action(value2, optional = true) {
|
|
544
|
+
if (optional && value2 === void 0) return;
|
|
545
|
+
ensure(object(value2), "invalid_payload", "Plugin view action must be an object");
|
|
546
|
+
text(value2.actionId, "action id");
|
|
547
|
+
optionalText(value2.value, "action value");
|
|
548
|
+
optionalText(value2.opens, "action opens");
|
|
549
|
+
if (value2.agentPicker !== void 0) {
|
|
550
|
+
ensure(object(value2.agentPicker), "invalid_payload", "Agent picker needs a project and machine");
|
|
551
|
+
text(value2.agentPicker.machineId, "agent picker machine");
|
|
552
|
+
text(value2.agentPicker.projectId, "agent picker project");
|
|
522
553
|
}
|
|
523
554
|
}
|
|
524
555
|
function meter(item) {
|
|
@@ -582,6 +613,7 @@ var NODES = {
|
|
|
582
613
|
stat(node2) {
|
|
583
614
|
text(node2.label, "label");
|
|
584
615
|
text(node2.value, "value");
|
|
616
|
+
spans(node2.valueSpans, true);
|
|
585
617
|
tone(node2.tone);
|
|
586
618
|
optionalText(node2.hint, "hint");
|
|
587
619
|
},
|
|
@@ -589,6 +621,7 @@ var NODES = {
|
|
|
589
621
|
boundedEntries(node2.items, "items", (item) => {
|
|
590
622
|
text(item.label, "label");
|
|
591
623
|
text(item.value, "value");
|
|
624
|
+
spans(item.valueSpans, true);
|
|
592
625
|
flag(item.mono, "mono");
|
|
593
626
|
flag(item.copy, "copy");
|
|
594
627
|
});
|
|
@@ -721,14 +754,25 @@ function validateView(root, { kind, manifest } = {}) {
|
|
|
721
754
|
ensure(cardLines(root) <= VIEW_LIMITS.cardLines, "payload_too_large", "A card view is taller than 6 lines");
|
|
722
755
|
}
|
|
723
756
|
}
|
|
724
|
-
function compact(
|
|
725
|
-
return Object.fromEntries(Object.entries(
|
|
757
|
+
function compact(value2) {
|
|
758
|
+
return Object.fromEntries(Object.entries(value2).filter(([, item]) => item !== void 0));
|
|
726
759
|
}
|
|
727
760
|
var node = (type, fields) => compact({ type, ...fields });
|
|
761
|
+
var clockTime = (at) => `${new Date(at).toISOString().slice(11, 16)} UTC`;
|
|
762
|
+
var timeSpan = (style, at, { text: fallback, tone: tone2, weight, mono } = {}) => compact({
|
|
763
|
+
text: fallback ?? (style === "duration" ? `since ${clockTime(at)}` : clockTime(at)),
|
|
764
|
+
tone: tone2,
|
|
765
|
+
weight,
|
|
766
|
+
mono,
|
|
767
|
+
time: { at: Math.max(0, Math.floor(at)), style }
|
|
768
|
+
});
|
|
769
|
+
var value = (content) => Array.isArray(content) ? { value: content.map((span) => span.text).join(""), valueSpans: content.map(compact) } : { value: content };
|
|
728
770
|
var ui = Object.freeze({
|
|
729
771
|
view: (root, { title } = {}) => compact({ kind: "view", root, title }),
|
|
730
|
-
action: (actionId, { value, opens, agentPicker } = {}) => compact({ actionId, value, opens, agentPicker }),
|
|
731
|
-
span: (
|
|
772
|
+
action: (actionId, { value: value2, opens, agentPicker } = {}) => compact({ actionId, value: value2, opens, agentPicker }),
|
|
773
|
+
span: (content, { tone: tone2, weight, mono, time } = {}) => compact({ text: content, tone: tone2, weight, mono, time }),
|
|
774
|
+
elapsed: (since, options) => timeSpan("duration", since, options),
|
|
775
|
+
relativeTime: (at, options) => timeSpan("relative", at, options),
|
|
732
776
|
stack: (items, { gap } = {}) => node("stack", { gap, children: items }),
|
|
733
777
|
row: (items, { align } = {}) => node("row", { children: items, align }),
|
|
734
778
|
divider: (label) => node("divider", { label }),
|
|
@@ -736,18 +780,18 @@ var ui = Object.freeze({
|
|
|
736
780
|
text: (content, { tone: tone2, weight, mono } = {}) => node("text", { ...Array.isArray(content) ? { spans: content.map(compact) } : { text: content }, tone: tone2, weight, mono }),
|
|
737
781
|
badge: (label, tone2) => node("badge", { label, tone: tone2 }),
|
|
738
782
|
dot: (tone2) => node("dot", { tone: tone2 }),
|
|
739
|
-
progress: (
|
|
783
|
+
progress: (value2, max, { tone: tone2, label } = {}) => node("progress", { value: value2, max, tone: tone2, label }),
|
|
740
784
|
segments: (items) => node("segments", { items: items.map(compact) }),
|
|
741
785
|
card: (items, { title, tone: tone2, tags, action: action2, externalAction, footer } = {}) => node("card", { title, tone: tone2, tags, action: action2, externalAction, footer, children: items }),
|
|
742
|
-
stat: (label,
|
|
743
|
-
kv: (items) => node("kv", { items: items.map(compact) }),
|
|
786
|
+
stat: (label, content, { tone: tone2, hint } = {}) => node("stat", { label, ...value(content), tone: tone2, hint }),
|
|
787
|
+
kv: (items) => node("kv", { items: items.map((item) => compact({ ...item, ...value(item.value) })) }),
|
|
744
788
|
tabs: (id, items, { filters, action: action2 } = {}) => node("tabs", { id, items: items.map(compact), filters, action: action2 }),
|
|
745
789
|
select: (id, label, options, { filters, action: action2 } = {}) => node("select", { id, label, options: options.map(compact), filters, action: action2 }),
|
|
746
790
|
table: (id, columns, rows = []) => node("table", { id, columns: columns.map(compact), rows: rows.map(compact) }),
|
|
747
791
|
log: (lines) => node("log", { lines }),
|
|
748
792
|
/** `action` is an action object or an action id. */
|
|
749
793
|
button: (label, action2) => node("button", { label, action: typeof action2 === "string" ? { actionId: action2 } : action2 }),
|
|
750
|
-
input: (id,
|
|
794
|
+
input: (id, value2, action2, { placeholder, maxLength } = {}) => node("input", { id, value: value2, placeholder, maxLength, action: typeof action2 === "string" ? { actionId: action2 } : action2 })
|
|
751
795
|
});
|
|
752
796
|
|
|
753
797
|
// ../plugin-sdk/src/row-layout.mjs
|
|
@@ -781,30 +825,30 @@ function validateRowLayout(layout) {
|
|
|
781
825
|
var always = Object.freeze({ kind: "always" });
|
|
782
826
|
var menuPositions = ["top", "after-open", "before-danger", "bottom"];
|
|
783
827
|
var entityKinds = ["account", "machine", "project", "pane", "section"];
|
|
784
|
-
function boundedText(
|
|
785
|
-
ensure(typeof
|
|
786
|
-
return
|
|
828
|
+
function boundedText(value2, label, limit = 512) {
|
|
829
|
+
ensure(typeof value2 === "string" && value2.trim().length > 0 && value2.length <= limit && !/[\u0000-\u001f\u007f]/.test(value2), "invalid_payload", `Invalid ${label}`);
|
|
830
|
+
return value2;
|
|
787
831
|
}
|
|
788
832
|
var HOVER_FORBIDDEN = /[\u0000-\u001f\u007f-\u009f\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/;
|
|
789
|
-
function validatePassiveText(
|
|
790
|
-
if (typeof
|
|
833
|
+
function validatePassiveText(value2, limit = LIMITS.canvasHoverBytes, label = "canvas hover") {
|
|
834
|
+
if (typeof value2 === "string") {
|
|
791
835
|
ensure(
|
|
792
|
-
|
|
836
|
+
value2.trim().length > 0 && !HOVER_FORBIDDEN.test(value2),
|
|
793
837
|
"invalid_payload",
|
|
794
838
|
`Invalid ${label} text`
|
|
795
839
|
);
|
|
796
840
|
ensure(
|
|
797
|
-
Buffer.byteLength(
|
|
841
|
+
Buffer.byteLength(value2) <= limit,
|
|
798
842
|
"payload_too_large",
|
|
799
843
|
`${label} text exceeds ${limit} bytes`
|
|
800
844
|
);
|
|
801
845
|
return;
|
|
802
846
|
}
|
|
803
|
-
ensure(Array.isArray(
|
|
804
|
-
ensure(
|
|
805
|
-
ensure(
|
|
847
|
+
ensure(Array.isArray(value2), "invalid_payload", `Invalid ${label} spans`);
|
|
848
|
+
ensure(value2.length > 0, "invalid_payload", `${label} spans must contain text`);
|
|
849
|
+
ensure(value2.length <= 32, "payload_too_large", `${label} spans exceed 32 spans`);
|
|
806
850
|
let text2 = "";
|
|
807
|
-
for (const span of
|
|
851
|
+
for (const span of value2) {
|
|
808
852
|
ensure(object(span), "invalid_payload", `Invalid ${label} span`);
|
|
809
853
|
ensure(
|
|
810
854
|
typeof span.text === "string" && !HOVER_FORBIDDEN.test(span.text),
|
|
@@ -920,6 +964,59 @@ function validateContent(content, declaration, manifest) {
|
|
|
920
964
|
if (hover !== void 0) validatePassiveText(hover);
|
|
921
965
|
}
|
|
922
966
|
}
|
|
967
|
+
function validateMux(mux) {
|
|
968
|
+
if (mux === null) return null;
|
|
969
|
+
ensure(
|
|
970
|
+
object(mux) && Object.keys(mux).every((key) => ["column", "row", "look", "expression", "motion"].includes(key)),
|
|
971
|
+
"invalid_payload",
|
|
972
|
+
"Invalid canvas mux"
|
|
973
|
+
);
|
|
974
|
+
const coordinate = (value2, limit) => Number.isFinite(value2) && value2 >= -64 && value2 <= limit + 64;
|
|
975
|
+
ensure(
|
|
976
|
+
coordinate(mux.column, LIMITS.canvasColumns) && coordinate(mux.row, LIMITS.canvasRows * 2),
|
|
977
|
+
"invalid_payload",
|
|
978
|
+
"Canvas mux column and row must be finite and near the canvas"
|
|
979
|
+
);
|
|
980
|
+
const look = mux.look ?? { x: 0, y: 0 };
|
|
981
|
+
ensure(object(look) && Object.keys(look).every((key) => ["x", "y"].includes(key)) && [look.x ?? 0, look.y ?? 0].every((value2) => [-1, 0, 1].includes(value2)), "invalid_payload", "Canvas mux look uses -1, 0, or 1");
|
|
982
|
+
ensure(mux.expression === void 0 || MUX_EXPRESSIONS.includes(mux.expression), "invalid_payload", "Unknown canvas mux expression");
|
|
983
|
+
ensure(mux.motion === void 0 || ["fly", "track"].includes(mux.motion), "invalid_payload", "Canvas mux motion is fly or track");
|
|
984
|
+
return {
|
|
985
|
+
column: mux.column,
|
|
986
|
+
row: mux.row,
|
|
987
|
+
look: { x: look.x ?? 0, y: look.y ?? 0 },
|
|
988
|
+
expression: mux.expression ?? "neutral",
|
|
989
|
+
motion: mux.motion ?? "fly"
|
|
990
|
+
};
|
|
991
|
+
}
|
|
992
|
+
function validateShapes(shapes) {
|
|
993
|
+
if (shapes === null) return null;
|
|
994
|
+
ensure(
|
|
995
|
+
Array.isArray(shapes) && shapes.length <= LIMITS.canvasShapes,
|
|
996
|
+
"invalid_payload",
|
|
997
|
+
`Canvas shapes are an array of at most ${LIMITS.canvasShapes}`
|
|
998
|
+
);
|
|
999
|
+
const near = (value2, limit) => Number.isFinite(value2) && value2 >= -64 && value2 <= limit + 64;
|
|
1000
|
+
const size = (value2, limit) => Number.isFinite(value2) && value2 > 0 && value2 <= limit * 2;
|
|
1001
|
+
return shapes.map((shape) => {
|
|
1002
|
+
ensure(
|
|
1003
|
+
object(shape) && shape.kind === "rect" && Object.keys(shape).every((field) => ["kind", "x", "y", "width", "height", "color", "vx", "vy"].includes(field)) && [shape.vx ?? 0, shape.vy ?? 0].every((speed) => Number.isFinite(speed) && Math.abs(speed) <= 1e3) && near(shape.x, LIMITS.canvasColumns) && near(shape.y, LIMITS.canvasRows) && size(shape.width, LIMITS.canvasColumns) && size(shape.height, LIMITS.canvasRows),
|
|
1004
|
+
"invalid_payload",
|
|
1005
|
+
"A canvas shape is a finite rect near the canvas"
|
|
1006
|
+
);
|
|
1007
|
+
let color;
|
|
1008
|
+
if (Number.isInteger(shape.color) && shape.color >= 0 && shape.color <= 255) color = { index: shape.color };
|
|
1009
|
+
else if (typeof shape.color === "string" && /^#[0-9a-fA-F]{6}$/.test(shape.color)) {
|
|
1010
|
+
const value2 = Number.parseInt(shape.color.slice(1), 16);
|
|
1011
|
+
color = { rgb: [value2 >> 16, value2 >> 8 & 255, value2 & 255] };
|
|
1012
|
+
}
|
|
1013
|
+
ensure(color, "invalid_payload", "A canvas shape color is an index 0-255 or #RRGGBB");
|
|
1014
|
+
const rect = { kind: "rect", x: shape.x, y: shape.y, width: shape.width, height: shape.height, color };
|
|
1015
|
+
if (shape.vx) rect.vx = shape.vx;
|
|
1016
|
+
if (shape.vy) rect.vy = shape.vy;
|
|
1017
|
+
return rect;
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
923
1020
|
function createRuntime({ manifest: input, producer, send, clock = realClock, onError = () => {
|
|
924
1021
|
}, instanceId = "0" }) {
|
|
925
1022
|
const manifest = validateManifest(input);
|
|
@@ -1035,7 +1132,7 @@ function createRuntime({ manifest: input, producer, send, clock = realClock, onE
|
|
|
1035
1132
|
"Report publisher exists or capacity is full"
|
|
1036
1133
|
);
|
|
1037
1134
|
let disposed = false;
|
|
1038
|
-
const sendReport = (
|
|
1135
|
+
const sendReport = (value2, schemaVersion) => {
|
|
1039
1136
|
active();
|
|
1040
1137
|
ensure(!disposed, "disposed", "Report publisher is disposed");
|
|
1041
1138
|
ensure(
|
|
@@ -1043,19 +1140,19 @@ function createRuntime({ manifest: input, producer, send, clock = realClock, onE
|
|
|
1043
1140
|
"invalid_payload",
|
|
1044
1141
|
"Invalid report schema version"
|
|
1045
1142
|
);
|
|
1046
|
-
if (
|
|
1143
|
+
if (value2 !== null) jsonBytes(value2);
|
|
1047
1144
|
peer.transmit(peer.frame("report", {
|
|
1048
1145
|
name,
|
|
1049
1146
|
entity: owner,
|
|
1050
1147
|
sequence: String(++sequence),
|
|
1051
1148
|
schemaVersion,
|
|
1052
|
-
value
|
|
1149
|
+
value: value2
|
|
1053
1150
|
}));
|
|
1054
1151
|
};
|
|
1055
1152
|
const publisher = {
|
|
1056
|
-
replace: (
|
|
1057
|
-
ensure(
|
|
1058
|
-
sendReport(
|
|
1153
|
+
replace: (value2, schemaVersion = 1) => {
|
|
1154
|
+
ensure(value2 !== null && value2 !== void 0, "invalid_payload", "Report value is required");
|
|
1155
|
+
sendReport(value2, schemaVersion);
|
|
1059
1156
|
},
|
|
1060
1157
|
clear: () => sendReport(null, 1),
|
|
1061
1158
|
dispose() {
|
|
@@ -1312,7 +1409,12 @@ function createRuntime({ manifest: input, producer, send, clock = realClock, onE
|
|
|
1312
1409
|
}
|
|
1313
1410
|
return {
|
|
1314
1411
|
...publisher,
|
|
1315
|
-
write: (ansi,
|
|
1412
|
+
write: (ansi, { mux, shapes, ...options } = {}) => {
|
|
1413
|
+
const args = { key, ansi };
|
|
1414
|
+
if (mux !== void 0) args.mux = validateMux(mux);
|
|
1415
|
+
if (shapes !== void 0) args.shapes = validateShapes(shapes);
|
|
1416
|
+
return request("canvas.write", args, options);
|
|
1417
|
+
},
|
|
1316
1418
|
focus: (capture, options) => request("canvas.focus", { key, capture }, options)
|
|
1317
1419
|
};
|
|
1318
1420
|
},
|
|
@@ -1341,7 +1443,7 @@ function createRuntime({ manifest: input, producer, send, clock = realClock, onE
|
|
|
1341
1443
|
config: Object.freeze({ get: (options) => request("config.get", {}, options) }),
|
|
1342
1444
|
state: Object.freeze({
|
|
1343
1445
|
get: (key, options) => request("state.get", { key }, options),
|
|
1344
|
-
set: (key,
|
|
1446
|
+
set: (key, value2, options) => request("state.set", { key, value: value2 }, options),
|
|
1345
1447
|
keys: (options) => request("state.keys", {}, options)
|
|
1346
1448
|
}),
|
|
1347
1449
|
context: Object.freeze({ get: (options) => request("context.get", {}, options) }),
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
2f085ac2595609e6f27bf455670fa82970f966547c9bfaa595dd2adb2355b26d TMUX-ARTIFACT-METADATA.txt
|
|
2
|
+
d7a3388a2b6deaf41b28bfd6c952ae086c5d01fe68526f3be86553c727fab8d9 TMUX-BUILD-TOOLS.txt
|
|
3
|
+
0d8aed2221c91178434a92607e2f324018370048c048e9de1b28b576be30d855 TMUX-OTOOL-L.txt
|
|
4
|
+
b632af894bba85cba0f93d6c54d508325c462af2c697405971bc57db87f31e22 bin/tmux
|
|
5
|
+
ff02effc9b331edcdac387d198691bfa3e575e7d244ad10cb826aa51ef085670 licenses/libevent.txt
|
|
6
|
+
2116115d46eeb1e736acfa562eed14fe6c34760794bc5b484642fe694adde0fd licenses/tmux.txt
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
artifact_format=standard-tmux-artifact-v1
|
|
2
|
+
platform=darwin
|
|
3
|
+
architecture=arm64
|
|
4
|
+
deployment_target=13.0
|
|
5
|
+
tmux_version=3.7
|
|
6
|
+
tmux_url=https://github.com/tmux/tmux/releases/download/3.7/tmux-3.7.tar.gz
|
|
7
|
+
tmux_sha256=2344f191501b8a73eb71dd6c5fd5dcf8c765f5066f34ab46f04b3013dc7bc1a5
|
|
8
|
+
tmux_archive_bytes=788832
|
|
9
|
+
libevent_version=2.1.12-stable
|
|
10
|
+
libevent_url=https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz
|
|
11
|
+
libevent_sha256=92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb
|
|
12
|
+
libevent_archive_bytes=1100847
|
|
13
|
+
libevent_pipe2=disabled
|
|
14
|
+
source_date_epoch=1779667200
|
|
15
|
+
toolchain_binding=TMUX-BUILD-TOOLS.txt
|
|
16
|
+
utf8proc=disabled
|
|
17
|
+
signed=false
|
|
18
|
+
binary_sha256=b632af894bba85cba0f93d6c54d508325c462af2c697405971bc57db87f31e22
|
|
19
|
+
build_tools_sha256=d7a3388a2b6deaf41b28bfd6c952ae086c5d01fe68526f3be86553c727fab8d9
|
|
20
|
+
build_recipe_sha256=0e26c3f0820c17ebf6acf1ce0ad71615a229565713c63a6f361d1c108abfbcb5
|
|
21
|
+
cache_key=02cce4d7d881c502bc0ef79115deeeae04a63ea0f3e636a6fd0e756b2eb745a1
|
|
22
|
+
dynamic_dependencies=apple-system-only
|
|
23
|
+
release_signing=developer-id-during-bundle-assembly
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
build_tools_format=standard-tmux-build-tools-v1
|
|
2
|
+
host_platform=Darwin
|
|
3
|
+
host_architecture=arm64
|
|
4
|
+
macos_product_version=27.2
|
|
5
|
+
macos_build_version=26B5086k
|
|
6
|
+
sdk_version=27.0
|
|
7
|
+
cc_version=Apple clang version 21.0.0 (clang-2100.3.27.1)
|
|
8
|
+
make_version=GNU Make 3.81
|
|
9
|
+
tar_version=bsdtar 3.5.3 - libarchive 3.7.4 zlib/1.2.12 liblzma/5.4.3 bz2lib/1.0.8
|
|
10
|
+
deployment_target=13.0
|
|
11
|
+
source_date_epoch=1779667200
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2875498eaff99cdb5b422198ff74befc39381bdd869e8e0210a097f0dc61027c
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
Libevent is available for use under the following license, commonly known
|
|
2
|
+
as the 3-clause (or "modified") BSD license:
|
|
3
|
+
|
|
4
|
+
==============================
|
|
5
|
+
Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
|
|
6
|
+
Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
|
|
7
|
+
|
|
8
|
+
Redistribution and use in source and binary forms, with or without
|
|
9
|
+
modification, are permitted provided that the following conditions
|
|
10
|
+
are met:
|
|
11
|
+
1. Redistributions of source code must retain the above copyright
|
|
12
|
+
notice, this list of conditions and the following disclaimer.
|
|
13
|
+
2. Redistributions in binary form must reproduce the above copyright
|
|
14
|
+
notice, this list of conditions and the following disclaimer in the
|
|
15
|
+
documentation and/or other materials provided with the distribution.
|
|
16
|
+
3. The name of the author may not be used to endorse or promote products
|
|
17
|
+
derived from this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
20
|
+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
21
|
+
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
22
|
+
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
23
|
+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
24
|
+
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
25
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
26
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
27
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
28
|
+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
29
|
+
==============================
|
|
30
|
+
|
|
31
|
+
Portions of Libevent are based on works by others, also made available by
|
|
32
|
+
them under the three-clause BSD license above. The copyright notices are
|
|
33
|
+
available in the corresponding source files; the license is as above. Here's
|
|
34
|
+
a list:
|
|
35
|
+
|
|
36
|
+
log.c:
|
|
37
|
+
Copyright (c) 2000 Dug Song <dugsong@monkey.org>
|
|
38
|
+
Copyright (c) 1993 The Regents of the University of California.
|
|
39
|
+
|
|
40
|
+
strlcpy.c:
|
|
41
|
+
Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
|
|
42
|
+
|
|
43
|
+
win32select.c:
|
|
44
|
+
Copyright (c) 2003 Michael A. Davis <mike@datanerds.net>
|
|
45
|
+
|
|
46
|
+
evport.c:
|
|
47
|
+
Copyright (c) 2007 Sun Microsystems
|
|
48
|
+
|
|
49
|
+
ht-internal.h:
|
|
50
|
+
Copyright (c) 2002 Christopher Clark
|
|
51
|
+
|
|
52
|
+
minheap-internal.h:
|
|
53
|
+
Copyright (c) 2006 Maxim Yegorushkin <maxim.yegorushkin@gmail.com>
|
|
54
|
+
|
|
55
|
+
==============================
|
|
56
|
+
|
|
57
|
+
The arc4module is available under the following, sometimes called the
|
|
58
|
+
"OpenBSD" license:
|
|
59
|
+
|
|
60
|
+
Copyright (c) 1996, David Mazieres <dm@uun.org>
|
|
61
|
+
Copyright (c) 2008, Damien Miller <djm@openbsd.org>
|
|
62
|
+
|
|
63
|
+
Permission to use, copy, modify, and distribute this software for any
|
|
64
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
65
|
+
copyright notice and this permission notice appear in all copies.
|
|
66
|
+
|
|
67
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
68
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
69
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
70
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
71
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
72
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
73
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
74
|
+
|
|
75
|
+
==============================
|
|
76
|
+
|
|
77
|
+
The Windows timer code is based on code from libutp, which is
|
|
78
|
+
distributed under this license, sometimes called the "MIT" license.
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
Copyright (c) 2010 BitTorrent, Inc.
|
|
82
|
+
|
|
83
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
84
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
85
|
+
in the Software without restriction, including without limitation the rights
|
|
86
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
87
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
88
|
+
furnished to do so, subject to the following conditions:
|
|
89
|
+
|
|
90
|
+
The above copyright notice and this permission notice shall be included in
|
|
91
|
+
all copies or substantial portions of the Software.
|
|
92
|
+
|
|
93
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
94
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
95
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
96
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
97
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
98
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
99
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright (c) Various Authors
|
|
2
|
+
|
|
3
|
+
Permission to use, copy, modify, and distribute this software for any
|
|
4
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
5
|
+
copyright notice and this permission notice appear in all copies.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
8
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
9
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
10
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
11
|
+
WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
|
12
|
+
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
|
13
|
+
OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|