@gui-chat-plugin/go 0.1.1 → 0.4.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.
@@ -0,0 +1,367 @@
1
+ //#region src/core/definition.ts
2
+ var e = "playGo", t = {
3
+ type: "function",
4
+ name: e,
5
+ description: "Play the game of Go (Baduk/Weiqi) with the user on a 9x9 board. You can start a new game, make moves, or pass turns. The game ends after two consecutive passes.",
6
+ parameters: {
7
+ type: "object",
8
+ properties: {
9
+ action: {
10
+ type: "string",
11
+ enum: [
12
+ "new_game",
13
+ "move",
14
+ "pass"
15
+ ],
16
+ description: "The action to perform: start a new game, make a move, or pass the turn"
17
+ },
18
+ col: {
19
+ type: "number",
20
+ description: "Column position for the move (0-8, required for 'move' action). The user will tell you the column by specifying A to J (skipping I)",
21
+ minimum: 0,
22
+ maximum: 8
23
+ },
24
+ row: {
25
+ type: "number",
26
+ description: "Row position for the move (0-8, required for 'move' action). The user will tell you the row by specifying 1 to 9",
27
+ minimum: 0,
28
+ maximum: 8
29
+ },
30
+ board: {
31
+ type: "array",
32
+ description: "Current 9x9 board state (required for 'move' and 'pass' actions)",
33
+ items: {
34
+ type: "array",
35
+ items: {
36
+ type: "string",
37
+ enum: [
38
+ ".",
39
+ "B",
40
+ "W"
41
+ ]
42
+ }
43
+ }
44
+ },
45
+ currentSide: {
46
+ type: "string",
47
+ enum: ["B", "W"],
48
+ description: "Current player's side (required for 'move' and 'pass' actions)"
49
+ },
50
+ playerNames: {
51
+ type: "object",
52
+ description: "Player assignments (required for 'move' and 'pass' actions)",
53
+ properties: {
54
+ B: {
55
+ type: "string",
56
+ enum: ["user", "computer"]
57
+ },
58
+ W: {
59
+ type: "string",
60
+ enum: ["user", "computer"]
61
+ }
62
+ },
63
+ required: ["B", "W"]
64
+ },
65
+ capturedStones: {
66
+ type: "object",
67
+ description: "Count of captured stones for each player (required for 'move' and 'pass' actions)",
68
+ properties: {
69
+ B: {
70
+ type: "number",
71
+ description: "Number of stones captured by Black"
72
+ },
73
+ W: {
74
+ type: "number",
75
+ description: "Number of stones captured by White"
76
+ }
77
+ },
78
+ required: ["B", "W"]
79
+ },
80
+ consecutivePasses: {
81
+ type: "number",
82
+ description: "Number of consecutive passes (required for 'pass' action, 0-2)",
83
+ minimum: 0,
84
+ maximum: 2
85
+ },
86
+ firstPlayer: {
87
+ type: "string",
88
+ enum: ["user", "computer"],
89
+ description: "Optional: Which player should play as Black (goes first) for 'new_game' action. If not specified, will be chosen randomly."
90
+ }
91
+ },
92
+ required: ["action"],
93
+ additionalProperties: !1
94
+ }
95
+ }, n = "You can play Go (Baduk/Weiqi) with users on a 9x9 board. When a user wants to play:\n1. Start a new game with the \"new_game\" action\n2. For moves, the user specifies column (A-J, skipping I) and row (1-9)\n3. Use the \"move\" action with the current board state\n4. The game ends after two consecutive passes", r = 9, i = [
96
+ [-1, 0],
97
+ [1, 0],
98
+ [0, -1],
99
+ [0, 1]
100
+ ];
101
+ function a() {
102
+ let e = [];
103
+ for (let t = 0; t < r; t++) e[t] = Array(r).fill(".");
104
+ return e;
105
+ }
106
+ function o(e) {
107
+ return e.map((e) => [...e]);
108
+ }
109
+ function s(e, t) {
110
+ return e >= 0 && e < r && t >= 0 && t < r;
111
+ }
112
+ function c(e) {
113
+ return e === "B" ? "W" : "B";
114
+ }
115
+ function l(e, t, n, r) {
116
+ let a = e[t][n];
117
+ if (a === ".") return [];
118
+ let o = [], c = [{
119
+ row: t,
120
+ col: n
121
+ }];
122
+ for (; c.length > 0;) {
123
+ let t = c.pop(), n = t.row, l = t.col;
124
+ if (!(!s(n, l) || r[n][l] || e[n][l] !== a)) {
125
+ r[n][l] = !0, o.push({
126
+ row: n,
127
+ col: l
128
+ });
129
+ for (let [e, t] of i) c.push({
130
+ row: n + e,
131
+ col: l + t
132
+ });
133
+ }
134
+ }
135
+ return o;
136
+ }
137
+ function u(e, t) {
138
+ for (let { row: n, col: r } of t) for (let [t, a] of i) {
139
+ let i = n + t, o = r + a;
140
+ if (s(i, o) && e[i][o] === ".") return !0;
141
+ }
142
+ return !1;
143
+ }
144
+ function d(e, t) {
145
+ let n = o(e), i = Array(r).fill(null).map(() => Array(r).fill(!1)), a = 0;
146
+ for (let e = 0; e < r; e++) for (let o = 0; o < r; o++) if (n[e][o] === t && !i[e][o]) {
147
+ let t = l(n, e, o, i);
148
+ if (!u(n, t)) for (let { row: e, col: r } of t) n[e][r] = ".", a++;
149
+ }
150
+ return {
151
+ board: n,
152
+ capturedCount: a
153
+ };
154
+ }
155
+ function f(e, t, n, i) {
156
+ if (e[t][n] !== ".") return !1;
157
+ let a = o(e);
158
+ a[t][n] = i;
159
+ let { board: s } = d(a, c(i));
160
+ return u(s, l(s, t, n, Array(r).fill(null).map(() => Array(r).fill(!1))));
161
+ }
162
+ function p(e, t, n, r) {
163
+ let i = o(e);
164
+ i[t][n] = r;
165
+ let { board: a, capturedCount: s } = d(i, c(r));
166
+ return {
167
+ newBoard: a,
168
+ capturedCount: s
169
+ };
170
+ }
171
+ function m(e) {
172
+ let t = 0, n = 0, i = 0;
173
+ for (let a = 0; a < r; a++) for (let o = 0; o < r; o++) {
174
+ let r = e[a][o];
175
+ r === "B" ? t++ : r === "W" ? n++ : i++;
176
+ }
177
+ return {
178
+ B: t,
179
+ W: n,
180
+ empty: i
181
+ };
182
+ }
183
+ function h(e) {
184
+ let t = Array(r).fill(null).map(() => Array(r).fill(!1)), n = 0, a = 0;
185
+ for (let o = 0; o < r; o++) for (let c = 0; c < r; c++) if (e[o][c] === "." && !t[o][c]) {
186
+ let r = [], l = [{
187
+ row: o,
188
+ col: c
189
+ }], u = /* @__PURE__ */ new Set();
190
+ for (; l.length > 0;) {
191
+ let n = l.pop(), a = n.row, o = n.col;
192
+ if (!(!s(a, o) || t[a][o])) if (e[a][o] === ".") {
193
+ t[a][o] = !0, r.push({
194
+ row: a,
195
+ col: o
196
+ });
197
+ for (let [e, t] of i) l.push({
198
+ row: a + e,
199
+ col: o + t
200
+ });
201
+ } else u.add(e[a][o]);
202
+ }
203
+ if (u.size === 1) {
204
+ let e = Array.from(u)[0];
205
+ e === "B" ? n += r.length : e === "W" && (a += r.length);
206
+ }
207
+ }
208
+ return {
209
+ B: n,
210
+ W: a
211
+ };
212
+ }
213
+ function g(e, t) {
214
+ let n = m(e), r = h(e), i = n.B + r.B + t.W, a = n.W + r.W + t.B;
215
+ return i > a ? "B" : a > i ? "W" : "draw";
216
+ }
217
+ function _(e) {
218
+ if (e.action === "new_game") {
219
+ let { playerNames: t } = e, n = a();
220
+ return {
221
+ board: n,
222
+ currentSide: "B",
223
+ playerNames: t,
224
+ capturedStones: {
225
+ B: 0,
226
+ W: 0
227
+ },
228
+ counts: m(n),
229
+ isTerminal: !1,
230
+ winner: null,
231
+ consecutivePasses: 0,
232
+ lastAction: { type: "new_game" }
233
+ };
234
+ }
235
+ if (e.action === "pass") {
236
+ let { board: t, currentSide: n, playerNames: r, capturedStones: i, consecutivePasses: a } = e, o = c(n), s = m(t), l = a + 1, u = l >= 2;
237
+ return {
238
+ board: t,
239
+ currentSide: o,
240
+ playerNames: r,
241
+ capturedStones: i,
242
+ counts: s,
243
+ isTerminal: u,
244
+ winner: u ? g(t, i) : null,
245
+ consecutivePasses: l,
246
+ lastAction: { type: "pass" }
247
+ };
248
+ }
249
+ let { row: t, col: n, board: r, currentSide: i, playerNames: o, capturedStones: s } = e;
250
+ if (!f(r, t, n, i)) return {
251
+ board: r,
252
+ currentSide: i,
253
+ playerNames: o,
254
+ capturedStones: s,
255
+ counts: m(r),
256
+ isTerminal: !1,
257
+ winner: null,
258
+ consecutivePasses: 0,
259
+ lastAction: { type: "pass" },
260
+ error: `Invalid move: (${t}, ${n}) is not a legal move for ${i}. The position must be empty and the move must not be suicide.`
261
+ };
262
+ let { newBoard: l, capturedCount: u } = p(r, t, n, i), d = c(i), h = m(l), _ = { ...s };
263
+ return u > 0 && (_[i] += u), {
264
+ board: l,
265
+ currentSide: d,
266
+ playerNames: o,
267
+ capturedStones: _,
268
+ counts: h,
269
+ isTerminal: !1,
270
+ winner: null,
271
+ consecutivePasses: 0,
272
+ lastAction: {
273
+ type: "move",
274
+ row: t,
275
+ col: n,
276
+ captured: u
277
+ }
278
+ };
279
+ }
280
+ //#endregion
281
+ //#region src/core/plugin.ts
282
+ var v = async (e, t) => {
283
+ try {
284
+ let e;
285
+ if (t.action === "new_game") {
286
+ let n;
287
+ n = t.firstPlayer ? t.firstPlayer : Math.random() < .5 ? "computer" : "user", e = {
288
+ action: "new_game",
289
+ playerNames: {
290
+ B: n,
291
+ W: n === "user" ? "computer" : "user"
292
+ }
293
+ };
294
+ } else if (t.action === "move") {
295
+ if (typeof t.row != "number" || typeof t.col != "number" || !t.board || !t.currentSide || !t.playerNames || !t.capturedStones) throw Error("Move action requires row, col, board, currentSide, playerNames, and capturedStones parameters");
296
+ e = {
297
+ action: "move",
298
+ row: t.row,
299
+ col: t.col,
300
+ board: t.board,
301
+ currentSide: t.currentSide,
302
+ playerNames: t.playerNames,
303
+ capturedStones: t.capturedStones
304
+ };
305
+ } else if (t.action === "pass") {
306
+ if (!t.board || !t.currentSide || !t.playerNames || !t.capturedStones || typeof t.consecutivePasses != "number") throw Error("Pass action requires board, currentSide, playerNames, capturedStones, and consecutivePasses parameters");
307
+ e = {
308
+ action: "pass",
309
+ board: t.board,
310
+ currentSide: t.currentSide,
311
+ playerNames: t.playerNames,
312
+ capturedStones: t.capturedStones,
313
+ consecutivePasses: t.consecutivePasses
314
+ };
315
+ } else throw Error(`Unknown action: ${t.action}`);
316
+ let n = _(e);
317
+ if (n.error) {
318
+ let e = n.playerNames[n.currentSide] === "computer" ? "Invalid move attempted. You must make a valid move. Choose an empty intersection where placing a stone would not result in immediate capture (suicide rule)." : "Invalid move attempted. Tell the user they must make a valid move. The position must be empty and the move must not be suicide. The user will tell you the move by specifying column (A to J, skipping I) and row (1 to 9).";
319
+ return {
320
+ message: n.error,
321
+ jsonData: n,
322
+ instructions: e,
323
+ updating: !0
324
+ };
325
+ }
326
+ let r = "";
327
+ if (n.lastAction.type === "new_game") r = "Started a new Go game on a 9x9 board! Black (●) goes first.";
328
+ else if (n.lastAction.type === "move") {
329
+ let e = n.lastAction.captured > 0 ? ` and captured ${n.lastAction.captured} stone${n.lastAction.captured > 1 ? "s" : ""}` : "";
330
+ r = `Played at (${n.lastAction.row}, ${n.lastAction.col})${e}.`;
331
+ } else n.lastAction.type === "pass" && (r = "Passed the turn.", n.consecutivePasses === 1 && (r += " One more pass will end the game."));
332
+ n.isTerminal && (n.winner === "draw" ? r += " Game over - it's a draw!" : n.winner && (r += ` Game over - ${n.winner === "B" ? "Black" : "White"} wins!`));
333
+ let i = n.playerNames[n.currentSide] === "computer", a = n.isTerminal ? "The game is over. Announce the game result with final scores." : i ? "The game state has been updated. It is your turn (you = AI assistant, computer). Make your move or pass." : "The game state has been updated. Tell the user to make a move or pass. Do not describe the state of the game. The user is able to see it. The user will tell you the move by specifying column (A to J, skipping I) and row (1 to 9).";
334
+ return {
335
+ message: r,
336
+ jsonData: n,
337
+ instructions: a,
338
+ instructionsRequired: n.isTerminal || i,
339
+ updating: t.action !== "new_game"
340
+ };
341
+ } catch (e) {
342
+ return console.error("ERR: exception\n Go game error", e), {
343
+ message: `Go game error: ${e instanceof Error ? e.message : "Unknown error"}`,
344
+ instructions: "Acknowledge that there was an error with the Go game and suggest trying again."
345
+ };
346
+ }
347
+ }, y = {
348
+ toolDefinition: t,
349
+ execute: v,
350
+ generatingMessage: "Processing Go move...",
351
+ isEnabled: () => !0,
352
+ systemPrompt: n
353
+ }, b = [{
354
+ name: "New Game (User First)",
355
+ args: {
356
+ action: "new_game",
357
+ firstPlayer: "user"
358
+ }
359
+ }, {
360
+ name: "New Game (Computer First)",
361
+ args: {
362
+ action: "new_game",
363
+ firstPlayer: "computer"
364
+ }
365
+ }];
366
+ //#endregion
367
+ export { n as a, _ as i, v as n, t as o, y as r, e as s, b as t };
package/dist/style.css CHANGED
@@ -1 +1,3 @@
1
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-900:oklch(41.4% .112 45.904);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-700:oklch(45.7% .24 277.023);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-4{top:calc(var(--spacing)*4)}.right-4{right:calc(var(--spacing)*4)}.-bottom-6{bottom:calc(var(--spacing)*-6)}.bottom-4{bottom:calc(var(--spacing)*4)}.-left-6{left:calc(var(--spacing)*-6)}.left-1\/2{left:50%}.left-4{left:calc(var(--spacing)*4)}.mx-auto{margin-inline:auto}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.contents{display:contents}.flex{display:flex}.grid{display:grid}.inline-block{display:inline-block}.h-0\.5{height:calc(var(--spacing)*.5)}.h-1{height:calc(var(--spacing)*1)}.h-2{height:calc(var(--spacing)*2)}.h-2\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-\[600px\]{height:600px}.h-full{height:100%}.h-px{height:1px}.w-0\.5{width:calc(var(--spacing)*.5)}.w-1{width:calc(var(--spacing)*1)}.w-2{width:calc(var(--spacing)*2)}.w-2\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-full{width:100%}.w-px{width:1px}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[200px\]{max-width:200px}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.grid-cols-9{grid-template-columns:repeat(9,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-around{justify-content:space-around}.justify-center{justify-content:center}.gap-0{gap:calc(var(--spacing)*0)}.gap-2{gap:calc(var(--spacing)*2)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-amber-900{border-color:var(--color-amber-900)}.border-gray-300{border-color:var(--color-gray-300)}.border-gray-600{border-color:var(--color-gray-600)}.border-gray-700{border-color:var(--color-gray-700)}.border-indigo-200{border-color:var(--color-indigo-200)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-100{background-color:var(--color-amber-100)}.bg-black{background-color:var(--color-black)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-800{background-color:var(--color-gray-800)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-white{background-color:var(--color-white)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-8{padding:calc(var(--spacing)*8)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-2{padding-block:calc(var(--spacing)*2)}.text-center{text-align:center}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-gray-200{color:var(--color-gray-200)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-indigo-700{color:var(--color-indigo-700)}.text-white{color:var(--color-white)}.opacity-50{opacity:.5}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media(hover:hover){.hover\:bg-indigo-200:hover{background-color:var(--color-indigo-200)}}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}
1
+ /*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */
2
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-900:oklch(41.4% .112 45.904);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-700:oklch(45.7% .24 277.023);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-1\/2{top:50%}.top-4{top:calc(var(--spacing) * 4)}.right-4{right:calc(var(--spacing) * 4)}.-bottom-6{bottom:calc(var(--spacing) * -6)}.bottom-4{bottom:calc(var(--spacing) * 4)}.-left-6{left:calc(var(--spacing) * -6)}.left-1\/2{left:50%}.left-4{left:calc(var(--spacing) * 4)}.mx-auto{margin-inline:auto}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.contents{display:contents}.flex{display:flex}.grid{display:grid}.inline-block{display:inline-block}.h-0\.5{height:calc(var(--spacing) * .5)}.h-1{height:calc(var(--spacing) * 1)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-\[600px\]{height:600px}.h-full{height:100%}.h-px{height:1px}.w-0\.5{width:calc(var(--spacing) * .5)}.w-1{width:calc(var(--spacing) * 1)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-full{width:100%}.w-px{width:1px}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[200px\]{max-width:200px}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.grid-cols-9{grid-template-columns:repeat(9,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-around{justify-content:space-around}.justify-center{justify-content:center}.gap-0{gap:calc(var(--spacing) * 0)}.gap-2{gap:calc(var(--spacing) * 2)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-amber-900{border-color:var(--color-amber-900)}.border-gray-300{border-color:var(--color-gray-300)}.border-gray-600{border-color:var(--color-gray-600)}.border-gray-700{border-color:var(--color-gray-700)}.border-indigo-200{border-color:var(--color-indigo-200)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-100{background-color:var(--color-amber-100)}.bg-black{background-color:var(--color-black)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-800{background-color:var(--color-gray-800)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-white{background-color:var(--color-white)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-8{padding:calc(var(--spacing) * 8)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-2{padding-block:calc(var(--spacing) * 2)}.text-center{text-align:center}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-gray-200{color:var(--color-gray-200)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-indigo-700{color:var(--color-indigo-700)}.text-white{color:var(--color-white)}.opacity-50{opacity:.5}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}@media (hover:hover){.hover\:bg-indigo-200:hover{background-color:var(--color-indigo-200)}}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}
3
+ /*$vite$:1*/
package/dist/vue.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("./index.cjs"),e=require("vue"),E={class:"w-full h-full flex flex-col items-center justify-center p-4"},N={key:0,class:"flex flex-col items-center"},x={class:"text-white text-lg font-bold mb-2 text-center"},w={class:"text-white text-sm mb-4 text-center"},C={class:"relative p-4 bg-amber-100 rounded-lg border-2 border-amber-900"},V={class:"grid gap-0",style:{gridTemplateColumns:"repeat(9, 1fr)",width:"432px",height:"432px"}},S=["onClick","onMouseenter","onMouseleave"],D={class:"absolute inset-0 pointer-events-none"},$={key:0,class:"absolute left-1/2 top-1/2 w-0.5 bg-black",style:{height:"48px",transform:"translateX(-50%)"}},j={key:1,class:"absolute left-1/2 top-1/2 h-0.5 bg-black",style:{width:"48px",transform:"translateY(-50%)"}},T={key:0,class:"absolute inset-0 flex items-center justify-center pointer-events-none"},M={key:1,class:"absolute inset-0 flex items-center justify-center pointer-events-none"},O={key:2,class:"absolute inset-0 flex items-center justify-center pointer-events-none"},P={class:"absolute -bottom-6 left-4 right-4 flex justify-around"},F={class:"absolute -left-6 top-4 bottom-4 flex flex-col justify-around"},h=e.defineComponent({__name:"View",props:{selectedResult:{},sendTextMessage:{type:Function}},setup(a){const p=a,o=e.ref(null),v=e.ref(null),r=["A","B","C","D","E","F","G","H","J"];e.watch(()=>p.selectedResult,n=>{n?.toolName==="playGo"&&n.jsonData&&(o.value=n.jsonData)},{immediate:!0});const k=e.computed(()=>{if(!o.value?.playerNames)return"";const n=o.value.playerNames[o.value.currentSide];return n.charAt(0).toUpperCase()+n.slice(1)}),f=e.computed(()=>o.value?o.value.currentSide==="B"?"Black":"White":""),c=e.computed(()=>o.value?.playerNames&&o.value.playerNames[o.value.currentSide]==="computer"),u=e.computed(()=>{if(!o.value?.board)return[];const n=[];for(let l=0;l<9;l++)for(let t=0;t<9;t++){const s=o.value.board[l][t];n.push({row:l,col:t,piece:s!=="."?s:null})}return n});function m(n,l){return[[2,2],[2,6],[4,4],[6,2],[6,6]].some(([s,d])=>s===n&&d===l)}function _(n){const l="relative w-12 h-12",t=!n.piece&&!c.value&&!o.value?.isTerminal?"cursor-pointer":"cursor-default";return`${l} ${t}`}function g(n){if(!o.value||o.value.isTerminal||c.value)return;const l=u.value[n];if(l.piece)return;const t=r[l.col],s=l.row+1,d={row:l.row,col:l.col,currentState:o.value};p.sendTextMessage(`I want to play at ${t}${s}, which is column=${l.col}, row=${l.row}`,{data:d})}function y(n,l){!o.value||o.value.isTerminal||c.value||u.value[n].piece||(v.value=l?n:null)}return(n,l)=>(e.openBlock(),e.createElementBlock("div",E,[o.value?(e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("div",x," Current Turn: "+e.toDisplayString(k.value)+" ("+e.toDisplayString(f.value)+") ",1),e.createElementVNode("div",w," Captured - Black: "+e.toDisplayString(o.value.capturedStones.B)+", White: "+e.toDisplayString(o.value.capturedStones.W),1),e.createElementVNode("div",C,[e.createElementVNode("div",V,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(t,s)=>(e.openBlock(),e.createElementBlock("div",{key:s,class:e.normalizeClass(_(t)),onClick:d=>g(s),onMouseenter:d=>y(s,!0),onMouseleave:d=>y(s,!1)},[e.createElementVNode("div",D,[t.row<8?(e.openBlock(),e.createElementBlock("div",$)):e.createCommentVNode("",!0),t.col<8?(e.openBlock(),e.createElementBlock("div",j)):e.createCommentVNode("",!0)]),m(t.row,t.col)?(e.openBlock(),e.createElementBlock("div",T,[...l[0]||(l[0]=[e.createElementVNode("div",{class:"w-2 h-2 bg-black rounded-full"},null,-1)])])):e.createCommentVNode("",!0),t.piece?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",{class:e.normalizeClass(["w-10 h-10 rounded-full border-2",t.piece==="B"?"bg-black border-gray-700":"bg-white border-gray-300"])},null,2)])):!c.value&&v.value===s?(e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("div",{class:e.normalizeClass(["w-10 h-10 rounded-full opacity-50",o.value.currentSide==="B"?"bg-black":"bg-white"])},null,2)])):e.createCommentVNode("",!0)],42,S))),128))]),e.createElementVNode("div",P,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,t=>e.createElementVNode("div",{key:t,class:"text-xs font-bold text-white w-12 text-center"},e.toDisplayString(t),1)),64))]),e.createElementVNode("div",F,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(9,t=>e.createElementVNode("div",{key:t,class:"text-xs font-bold text-white h-12 flex items-center justify-center"},e.toDisplayString(t),1)),64))])])])):e.createCommentVNode("",!0)]))}}),L={class:"p-3 bg-amber-50 rounded"},W={key:0,class:"space-y-1"},G={class:"flex justify-center"},z={class:"inline-block relative",style:{"background-color":"#d4a574",padding:"4px"}},A={class:"grid grid-cols-9",style:{gap:"0px"}},Y={key:0,class:"absolute left-1/2 top-1/2 w-px bg-black",style:{height:"12px",transform:"translateX(-50%)"}},R={key:1,class:"absolute left-1/2 top-1/2 h-px bg-black",style:{width:"12px",transform:"translateY(-50%)"}},q={key:2,class:"absolute w-1 h-1 bg-black rounded-full",style:{"z-index":"1"}},H={key:3,class:"w-2.5 h-2.5 bg-black rounded-full relative",style:{"z-index":"2"}},I={key:4,class:"w-2.5 h-2.5 bg-white rounded-full border border-gray-300 relative",style:{"z-index":"2"}},U={class:"text-xs text-center space-y-1"},X={key:0,class:"text-gray-600"},J={key:1,class:"font-medium"},K={class:"text-gray-500 text-xs"},b=e.defineComponent({__name:"Preview",props:{result:{}},setup(a){function p(r,k){return[[2,2],[2,6],[4,4],[6,2],[6,6]].some(([c,u])=>c===r&&u===k)}function o(r){return r.isTerminal?r.winner==="draw"?"Draw!":r.winner==="B"?"⚫ Black Wins!":r.winner==="W"?"⚪ White Wins!":"Game Over":""}function v(r){return r.charAt(0).toUpperCase()+r.slice(1)}return(r,k)=>(e.openBlock(),e.createElementBlock("div",L,[a.result.jsonData?(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("div",G,[e.createElementVNode("div",z,[e.createElementVNode("div",A,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.result.jsonData.board,(f,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f,(u,m)=>(e.openBlock(),e.createElementBlock("div",{key:`${c}-${m}`,class:"w-3 h-3 flex items-center justify-center relative"},[Number(c)<8?(e.openBlock(),e.createElementBlock("div",Y)):e.createCommentVNode("",!0),Number(m)<8?(e.openBlock(),e.createElementBlock("div",R)):e.createCommentVNode("",!0),p(Number(c),Number(m))?(e.openBlock(),e.createElementBlock("div",q)):e.createCommentVNode("",!0),u==="B"?(e.openBlock(),e.createElementBlock("div",H)):u==="W"?(e.openBlock(),e.createElementBlock("div",I)):e.createCommentVNode("",!0)]))),128))],64))),128))])])]),e.createElementVNode("div",U,[a.result.jsonData.isTerminal?(e.openBlock(),e.createElementBlock("div",J,e.toDisplayString(o(a.result.jsonData)),1)):(e.openBlock(),e.createElementBlock("div",X,e.toDisplayString(a.result.jsonData.currentSide==="B"?"⚫":"⚪")+" "+e.toDisplayString(v(a.result.jsonData.playerNames[a.result.jsonData.currentSide]))+" to play ",1)),e.createElementVNode("div",K," Captured: ⚫"+e.toDisplayString(a.result.jsonData.capturedStones.B)+" ⚪"+e.toDisplayString(a.result.jsonData.capturedStones.W),1)])])):e.createCommentVNode("",!0)]))}}),B={...i.pluginCore,viewComponent:h,previewComponent:b,samples:i.samples},Q={plugin:B};exports.SYSTEM_PROMPT=i.SYSTEM_PROMPT;exports.TOOL_DEFINITION=i.TOOL_DEFINITION;exports.TOOL_NAME=i.TOOL_NAME;exports.executeGo=i.executeGo;exports.playGo=i.playGo;exports.pluginCore=i.pluginCore;exports.samples=i.samples;exports.Preview=b;exports.View=h;exports.default=Q;exports.plugin=B;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./samples--VS-ghv5.cjs`);let t=require(`vue`);var n={class:`w-full h-full flex flex-col items-center justify-center p-4`},r={key:0,class:`flex flex-col items-center`},i={class:`text-white text-lg font-bold mb-2 text-center`},a={class:`text-white text-sm mb-4 text-center`},o={class:`relative p-4 bg-amber-100 rounded-lg border-2 border-amber-900`},s={class:`grid gap-0`,style:{gridTemplateColumns:`repeat(9, 1fr)`,width:`432px`,height:`432px`}},c=[`onClick`,`onMouseenter`,`onMouseleave`],l={class:`absolute inset-0 pointer-events-none`},u={key:0,class:`absolute left-1/2 top-1/2 w-0.5 bg-black`,style:{height:`48px`,transform:`translateX(-50%)`}},d={key:1,class:`absolute left-1/2 top-1/2 h-0.5 bg-black`,style:{width:`48px`,transform:`translateY(-50%)`}},f={key:0,class:`absolute inset-0 flex items-center justify-center pointer-events-none`},p={key:1,class:`absolute inset-0 flex items-center justify-center pointer-events-none`},m={key:2,class:`absolute inset-0 flex items-center justify-center pointer-events-none`},h={class:`absolute -bottom-6 left-4 right-4 flex justify-around`},g={class:`absolute -left-6 top-4 bottom-4 flex flex-col justify-around`},_=(0,t.defineComponent)({__name:`View`,props:{selectedResult:{},sendTextMessage:{type:Function}},setup(e){let _=e,v=(0,t.ref)(null),y=(0,t.ref)(null),b=[`A`,`B`,`C`,`D`,`E`,`F`,`G`,`H`,`J`];(0,t.watch)(()=>_.selectedResult,e=>{e?.toolName===`playGo`&&e.jsonData&&(v.value=e.jsonData)},{immediate:!0});let x=(0,t.computed)(()=>{if(!v.value?.playerNames)return``;let e=v.value.playerNames[v.value.currentSide];return e.charAt(0).toUpperCase()+e.slice(1)}),S=(0,t.computed)(()=>v.value?v.value.currentSide===`B`?`Black`:`White`:``),C=(0,t.computed)(()=>v.value?.playerNames&&v.value.playerNames[v.value.currentSide]===`computer`),w=(0,t.computed)(()=>{if(!v.value?.board)return[];let e=[];for(let t=0;t<9;t++)for(let n=0;n<9;n++){let r=v.value.board[t][n];e.push({row:t,col:n,piece:r===`.`?null:r})}return e});function T(e,t){return[[2,2],[2,6],[4,4],[6,2],[6,6]].some(([n,r])=>n===e&&r===t)}function E(e){return`relative w-12 h-12 ${!e.piece&&!C.value&&!v.value?.isTerminal?`cursor-pointer`:`cursor-default`}`}function D(e){if(!v.value||v.value.isTerminal||C.value)return;let t=w.value[e];if(t.piece)return;let n=b[t.col],r=t.row+1,i={row:t.row,col:t.col,currentState:v.value};_.sendTextMessage(`I want to play at ${n}${r}, which is column=${t.col}, row=${t.row}`,{data:i})}function O(e,t){!v.value||v.value.isTerminal||C.value||w.value[e].piece||(y.value=t?e:null)}return(e,_)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,n,[v.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,r,[(0,t.createElementVNode)(`div`,i,` Current Turn: `+(0,t.toDisplayString)(x.value)+` (`+(0,t.toDisplayString)(S.value)+`) `,1),(0,t.createElementVNode)(`div`,a,` Captured - Black: `+(0,t.toDisplayString)(v.value.capturedStones.B)+`, White: `+(0,t.toDisplayString)(v.value.capturedStones.W),1),(0,t.createElementVNode)(`div`,o,[(0,t.createElementVNode)(`div`,s,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(w.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,class:(0,t.normalizeClass)(E(e)),onClick:e=>D(n),onMouseenter:e=>O(n,!0),onMouseleave:e=>O(n,!1)},[(0,t.createElementVNode)(`div`,l,[e.row<8?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,u)):(0,t.createCommentVNode)(``,!0),e.col<8?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,d)):(0,t.createCommentVNode)(``,!0)]),T(e.row,e.col)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,f,[..._[0]||=[(0,t.createElementVNode)(`div`,{class:`w-2 h-2 bg-black rounded-full`},null,-1)]])):(0,t.createCommentVNode)(``,!0),e.piece?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,p,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`w-10 h-10 rounded-full border-2`,e.piece===`B`?`bg-black border-gray-700`:`bg-white border-gray-300`])},null,2)])):!C.value&&y.value===n?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,m,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`w-10 h-10 rounded-full opacity-50`,v.value.currentSide===`B`?`bg-black`:`bg-white`])},null,2)])):(0,t.createCommentVNode)(``,!0)],42,c))),128))]),(0,t.createElementVNode)(`div`,h,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(b,e=>(0,t.createElementVNode)(`div`,{key:e,class:`text-xs font-bold text-white w-12 text-center`},(0,t.toDisplayString)(e),1)),64))]),(0,t.createElementVNode)(`div`,g,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(9,e=>(0,t.createElementVNode)(`div`,{key:e,class:`text-xs font-bold text-white h-12 flex items-center justify-center`},(0,t.toDisplayString)(e),1)),64))])])])):(0,t.createCommentVNode)(``,!0)]))}}),v={class:`p-3 bg-amber-50 rounded`},y={key:0,class:`space-y-1`},b={class:`flex justify-center`},x={class:`inline-block relative`,style:{"background-color":`#d4a574`,padding:`4px`}},S={class:`grid grid-cols-9`,style:{gap:`0px`}},C={key:0,class:`absolute left-1/2 top-1/2 w-px bg-black`,style:{height:`12px`,transform:`translateX(-50%)`}},w={key:1,class:`absolute left-1/2 top-1/2 h-px bg-black`,style:{width:`12px`,transform:`translateY(-50%)`}},T={key:2,class:`absolute w-1 h-1 bg-black rounded-full`,style:{"z-index":`1`}},E={key:3,class:`w-2.5 h-2.5 bg-black rounded-full relative`,style:{"z-index":`2`}},D={key:4,class:`w-2.5 h-2.5 bg-white rounded-full border border-gray-300 relative`,style:{"z-index":`2`}},O={class:`text-xs text-center space-y-1`},k={key:0,class:`text-gray-600`},A={key:1,class:`font-medium`},j={class:`text-gray-500 text-xs`},M=(0,t.defineComponent)({__name:`Preview`,props:{result:{}},setup(e){function n(e,t){return[[2,2],[2,6],[4,4],[6,2],[6,6]].some(([n,r])=>n===e&&r===t)}function r(e){return e.isTerminal?e.winner===`draw`?`Draw!`:e.winner===`B`?`⚫ Black Wins!`:e.winner===`W`?`⚪ White Wins!`:`Game Over`:``}function i(e){return e.charAt(0).toUpperCase()+e.slice(1)}return(a,o)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,v,[e.result.jsonData?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,y,[(0,t.createElementVNode)(`div`,b,[(0,t.createElementVNode)(`div`,x,[(0,t.createElementVNode)(`div`,S,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.result.jsonData.board,(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:r},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e,(e,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:`${r}-${i}`,class:`w-3 h-3 flex items-center justify-center relative`},[Number(r)<8?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,C)):(0,t.createCommentVNode)(``,!0),Number(i)<8?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,w)):(0,t.createCommentVNode)(``,!0),n(Number(r),Number(i))?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,T)):(0,t.createCommentVNode)(``,!0),e===`B`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,E)):e===`W`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,D)):(0,t.createCommentVNode)(``,!0)]))),128))],64))),128))])])]),(0,t.createElementVNode)(`div`,O,[e.result.jsonData.isTerminal?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,A,(0,t.toDisplayString)(r(e.result.jsonData)),1)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,k,(0,t.toDisplayString)(e.result.jsonData.currentSide===`B`?`⚫`:`⚪`)+` `+(0,t.toDisplayString)(i(e.result.jsonData.playerNames[e.result.jsonData.currentSide]))+` to play `,1)),(0,t.createElementVNode)(`div`,j,` Captured: ⚫`+(0,t.toDisplayString)(e.result.jsonData.capturedStones.B)+` ⚪`+(0,t.toDisplayString)(e.result.jsonData.capturedStones.W),1)])])):(0,t.createCommentVNode)(``,!0)]))}}),N={...e.r,viewComponent:_,previewComponent:M,samples:e.t},P={plugin:N};exports.Preview=M,exports.SYSTEM_PROMPT=e.a,exports.TOOL_DEFINITION=e.o,exports.TOOL_NAME=e.s,exports.View=_,exports.default=P,exports.executeGo=e.n,exports.playGo=e.i,exports.plugin=N,exports.pluginCore=e.r,exports.samples=e.t;