@hackbuild/agents-views 0.1.1 → 0.2.0

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/dist/vue.d.ts CHANGED
@@ -2,6 +2,8 @@ import { type PropType } from "vue";
2
2
  import { type AssociationsState } from "./associations-table.js";
3
3
  import { type DrivesBarsState } from "./drives-bars.js";
4
4
  import { type EyeWho } from "./eye-inset.js";
5
+ import { type MapState } from "./map-inset.js";
6
+ import { type PlanLogState, type StepLine } from "./plan-log.js";
5
7
  /** The behavior block, utility rows (current in pink) and drive rows. */
6
8
  export declare const DrivesBars: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
7
9
  state: {
@@ -107,3 +109,75 @@ export declare const EyeInset: import("vue").DefineComponent<import("vue").Extra
107
109
  width: number;
108
110
  height: number;
109
111
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
112
+ /** The plan log: last plan, goals, thoughts and steps. `steps: false` leaves the step log out. */
113
+ export declare const PlanLog: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
114
+ state: {
115
+ type: PropType<PlanLogState>;
116
+ required: true;
117
+ };
118
+ steps: {
119
+ type: BooleanConstructor;
120
+ default: boolean;
121
+ };
122
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
123
+ [key: string]: any;
124
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
125
+ state: {
126
+ type: PropType<PlanLogState>;
127
+ required: true;
128
+ };
129
+ steps: {
130
+ type: BooleanConstructor;
131
+ default: boolean;
132
+ };
133
+ }>> & Readonly<{}>, {
134
+ steps: boolean;
135
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
136
+ /** The step log: one rack log row per tool call. */
137
+ export declare const StepLog: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
138
+ steps: {
139
+ type: PropType<readonly StepLine[]>;
140
+ required: true;
141
+ };
142
+ empty: {
143
+ type: StringConstructor;
144
+ default: string;
145
+ };
146
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
147
+ [key: string]: any;
148
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
149
+ steps: {
150
+ type: PropType<readonly StepLine[]>;
151
+ required: true;
152
+ };
153
+ empty: {
154
+ type: StringConstructor;
155
+ default: string;
156
+ };
157
+ }>> & Readonly<{}>, {
158
+ empty: string;
159
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
160
+ /** The map card. `map` returns the map; call the exposed `frame()` to draw it (a template ref). */
161
+ export declare const MapInset: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
162
+ map: {
163
+ type: PropType<() => MapState>;
164
+ required: true;
165
+ };
166
+ size: {
167
+ type: NumberConstructor;
168
+ default: number;
169
+ };
170
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
171
+ [key: string]: any;
172
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
173
+ map: {
174
+ type: PropType<() => MapState>;
175
+ required: true;
176
+ };
177
+ size: {
178
+ type: NumberConstructor;
179
+ default: number;
180
+ };
181
+ }>> & Readonly<{}>, {
182
+ size: number;
183
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
package/dist/vue.js CHANGED
@@ -4,6 +4,8 @@ import { defineComponent, h, onBeforeUnmount, onMounted, ref, watch } from "vue"
4
4
  import { associationsTable } from "./associations-table.js";
5
5
  import { drivesBars } from "./drives-bars.js";
6
6
  import { eyeInset } from "./eye-inset.js";
7
+ import { mapInset } from "./map-inset.js";
8
+ import { planLog, stepLog } from "./plan-log.js";
7
9
  /** The behavior block, utility rows (current in pink) and drive rows. */
8
10
  export const DrivesBars = defineComponent({
9
11
  name: "DrivesBars",
@@ -80,3 +82,59 @@ export const EyeInset = defineComponent({
80
82
  return () => h("figure", { ref: root });
81
83
  },
82
84
  });
85
+ /** The plan log: last plan, goals, thoughts and steps. `steps: false` leaves the step log out. */
86
+ export const PlanLog = defineComponent({
87
+ name: "PlanLog",
88
+ props: {
89
+ state: { type: Object, required: true },
90
+ steps: { type: Boolean, default: true },
91
+ },
92
+ setup(props) {
93
+ const root = ref(null);
94
+ let view = null;
95
+ onMounted(() => {
96
+ view = planLog(root.value, { steps: props.steps });
97
+ view.update(props.state);
98
+ });
99
+ watch(() => props.state, (s) => view?.update(s));
100
+ onBeforeUnmount(() => view?.dispose());
101
+ return () => h("div", { ref: root });
102
+ },
103
+ });
104
+ /** The step log: one rack log row per tool call. */
105
+ export const StepLog = defineComponent({
106
+ name: "StepLog",
107
+ props: {
108
+ steps: { type: Array, required: true },
109
+ empty: { type: String, default: "no steps yet." },
110
+ },
111
+ setup(props) {
112
+ const root = ref(null);
113
+ let view = null;
114
+ onMounted(() => {
115
+ view = stepLog(root.value, { empty: props.empty });
116
+ view.update(props.steps);
117
+ });
118
+ watch(() => props.steps, (s) => view?.update(s));
119
+ onBeforeUnmount(() => view?.dispose());
120
+ return () => h("div", { ref: root });
121
+ },
122
+ });
123
+ /** The map card. `map` returns the map; call the exposed `frame()` to draw it (a template ref). */
124
+ export const MapInset = defineComponent({
125
+ name: "MapInset",
126
+ props: {
127
+ map: { type: Function, required: true },
128
+ size: { type: Number, default: 160 },
129
+ },
130
+ setup(props, { expose }) {
131
+ const root = ref(null);
132
+ let view = null;
133
+ onMounted(() => {
134
+ view = mapInset(root.value, { map: () => props.map(), size: props.size });
135
+ });
136
+ onBeforeUnmount(() => view?.dispose());
137
+ expose({ frame: () => view?.frame() });
138
+ return () => h("figure", { ref: root });
139
+ },
140
+ });
@@ -0,0 +1,36 @@
1
+ // Types of src/yard/scope.js, which tools/gen-yard.mjs assembles from packages/agents-views/yard.
2
+
3
+ /** What the yard's scope reads from its host; built by mountYard. */
4
+ export interface YardEnv {
5
+ rapier: unknown;
6
+ suiteUrl: string;
7
+ params: string;
8
+ canReseed: boolean;
9
+ setup: boolean;
10
+ hub: string;
11
+ voice: string;
12
+ byId(id: string): HTMLElement | null;
13
+ qsa(sel: string): HTMLElement[];
14
+ docOn(type: string, fn: (e: Event) => void, opts?: AddEventListenerOptions | boolean): void;
15
+ on(type: string, fn: (e: Event) => void, opts?: AddEventListenerOptions | boolean): void;
16
+ setTimeout(fn: () => void, ms?: number): number;
17
+ setInterval(fn: () => void, ms?: number): number;
18
+ ResizeObserver: typeof ResizeObserver;
19
+ stream(s: MediaStream): MediaStream;
20
+ dog(): Promise<ArrayBuffer>;
21
+ human(): Promise<ArrayBuffer | null>;
22
+ anims(): Promise<unknown>;
23
+ reseed(params: string): void;
24
+ dispose(fn: () => void): void;
25
+ ready(handle: unknown): void;
26
+ fail(err: unknown): void;
27
+ }
28
+
29
+ /** The yard's stylesheet, every selector scoped to .hb-yard and .hb-yard-bar. */
30
+ export const YARD_CSS: string;
31
+ /** The stage and rack, the setup panel, the drawer and the command palette. */
32
+ export const YARD_HTML: string;
33
+ /** The readout chips, the setup button and the command button. */
34
+ export const YARD_BAR_HTML: string;
35
+ /** Runs the yard's scope over markup already in place. */
36
+ export function runYard(env: YardEnv): void;