@fungi.computer/parakeet 0.0.0-stage → 0.1.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.
Files changed (115) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +186 -2
  3. package/dist/account-commands.d.ts +102 -0
  4. package/dist/account-commands.js +239 -0
  5. package/dist/agent-head.d.ts +4 -0
  6. package/dist/agent-head.js +2 -0
  7. package/dist/client-contributions.d.ts +20 -0
  8. package/dist/client-contributions.js +41 -0
  9. package/dist/commands/advertised.d.ts +23 -0
  10. package/dist/commands/advertised.js +72 -0
  11. package/dist/commands/builtins.d.ts +14 -0
  12. package/dist/commands/builtins.js +91 -0
  13. package/dist/commands/hints.d.ts +36 -0
  14. package/dist/commands/hints.js +64 -0
  15. package/dist/commands/interactions.d.ts +55 -0
  16. package/dist/commands/interactions.js +101 -0
  17. package/dist/commands/run.d.ts +12 -0
  18. package/dist/commands/run.js +64 -0
  19. package/dist/commands/slash.d.ts +126 -0
  20. package/dist/commands/slash.js +190 -0
  21. package/dist/commands/use-slash-commands.d.ts +57 -0
  22. package/dist/commands/use-slash-commands.js +207 -0
  23. package/dist/components/AgentHead.d.ts +22 -0
  24. package/dist/components/AgentHead.js +20 -0
  25. package/dist/components/ChatComposer.d.ts +43 -0
  26. package/dist/components/ChatComposer.js +209 -0
  27. package/dist/components/ChatMessage.d.ts +8 -0
  28. package/dist/components/ChatMessage.js +16 -0
  29. package/dist/components/ClientRows.d.ts +11 -0
  30. package/dist/components/ClientRows.js +46 -0
  31. package/dist/components/CodeBlock.d.ts +11 -0
  32. package/dist/components/CodeBlock.js +38 -0
  33. package/dist/components/InteractionPanel.d.ts +15 -0
  34. package/dist/components/InteractionPanel.js +42 -0
  35. package/dist/components/MarkdownRenderer.d.ts +6 -0
  36. package/dist/components/MarkdownRenderer.js +48 -0
  37. package/dist/components/RunFailureNotice.d.ts +7 -0
  38. package/dist/components/RunFailureNotice.js +13 -0
  39. package/dist/components/ShiitakeAvatar.d.ts +21 -0
  40. package/dist/components/ShiitakeAvatar.js +22 -0
  41. package/dist/components/SlashMenu.d.ts +8 -0
  42. package/dist/components/SlashMenu.js +50 -0
  43. package/dist/components/ThinkingBlock.d.ts +3 -0
  44. package/dist/components/ThinkingBlock.js +18 -0
  45. package/dist/components/TimelineItem.d.ts +15 -0
  46. package/dist/components/TimelineItem.js +35 -0
  47. package/dist/components/ToolGroup.d.ts +12 -0
  48. package/dist/components/ToolGroup.js +90 -0
  49. package/dist/components/WaitingNotice.d.ts +7 -0
  50. package/dist/components/WaitingNotice.js +8 -0
  51. package/dist/components/avatar-presentation.d.ts +16 -0
  52. package/dist/components/avatar-presentation.js +9 -0
  53. package/dist/components/sprite-service.d.ts +2 -0
  54. package/dist/components/sprite-service.js +9 -0
  55. package/dist/conversation.d.ts +165 -0
  56. package/dist/conversation.js +762 -0
  57. package/dist/core/assistant-visibility.d.ts +3 -0
  58. package/dist/core/assistant-visibility.js +4 -0
  59. package/dist/core/author-labels.d.ts +16 -0
  60. package/dist/core/author-labels.js +16 -0
  61. package/dist/core/build-timeline.d.ts +36 -0
  62. package/dist/core/build-timeline.js +328 -0
  63. package/dist/core/client-actions.d.ts +35 -0
  64. package/dist/core/client-actions.js +128 -0
  65. package/dist/core/client-contributions.d.ts +24 -0
  66. package/dist/core/client-contributions.js +115 -0
  67. package/dist/core/client-timeline.d.ts +33 -0
  68. package/dist/core/client-timeline.js +72 -0
  69. package/dist/core/format-context.d.ts +11 -0
  70. package/dist/core/format-context.js +20 -0
  71. package/dist/core/format-tokens.d.ts +2 -0
  72. package/dist/core/format-tokens.js +6 -0
  73. package/dist/core/model-identity.d.ts +3 -0
  74. package/dist/core/model-identity.js +7 -0
  75. package/dist/core/session-projection.d.ts +11 -0
  76. package/dist/core/session-projection.js +191 -0
  77. package/dist/core/session-query.d.ts +118 -0
  78. package/dist/core/session-query.js +187 -0
  79. package/dist/core/session-view-state.d.ts +66 -0
  80. package/dist/core/session-view-state.js +114 -0
  81. package/dist/core/tool-contract.d.ts +15 -0
  82. package/dist/core/tool-contract.js +3 -0
  83. package/dist/core/tool-groups.d.ts +36 -0
  84. package/dist/core/tool-groups.js +151 -0
  85. package/dist/core/tool-view.d.ts +182 -0
  86. package/dist/core/tool-view.js +618 -0
  87. package/dist/headless.d.ts +28 -0
  88. package/dist/headless.js +24 -0
  89. package/dist/index.d.ts +9 -0
  90. package/dist/index.js +4 -0
  91. package/dist/lib/failure.d.ts +2 -0
  92. package/dist/lib/failure.js +9 -0
  93. package/dist/markdown.d.ts +3 -0
  94. package/dist/markdown.js +6 -0
  95. package/dist/model-commands.d.ts +44 -0
  96. package/dist/model-commands.js +232 -0
  97. package/dist/parakeet.d.ts +77 -0
  98. package/dist/parakeet.js +276 -0
  99. package/dist/provider-choices.d.ts +8 -0
  100. package/dist/provider-choices.js +46 -0
  101. package/dist/reload-command.d.ts +43 -0
  102. package/dist/reload-command.js +72 -0
  103. package/dist/session-commands.d.ts +53 -0
  104. package/dist/session-commands.js +259 -0
  105. package/dist/session.d.ts +24 -0
  106. package/dist/session.js +1 -0
  107. package/dist/store/types.d.ts +163 -0
  108. package/dist/store/types.js +1 -0
  109. package/dist/styles.css +19129 -0
  110. package/docs/api/README.md +15 -0
  111. package/docs/api/commands/slash.md +321 -0
  112. package/docs/api/headless.md +2510 -0
  113. package/docs/api/index.md +1249 -0
  114. package/package.json +79 -3
  115. package/src/styles.css +272 -0
@@ -0,0 +1,182 @@
1
+ import type { ToolItem } from "../store/types.js";
2
+ /** Shared tool status meaning, used by the browser and native presentations. */
3
+ export declare function toolStatusTone(status: ToolItem["status"]): "error" | "success" | "info" | "neutral";
4
+ /**
5
+ * Closed presentation vocabulary for one tool call. It is chosen from the typed
6
+ * tool name, never inferred from arguments or result text.
7
+ */
8
+ export type ToolKind = "code" | "command" | "edit" | "other" | "read" | "search";
9
+ /** Shared artwork identity for browser and native tool rows. */
10
+ export declare const toolKindSigils: {
11
+ /** Artwork for code execution. */
12
+ readonly code: "computer";
13
+ /** Artwork for shell commands. */
14
+ readonly command: "run";
15
+ /** Artwork for file edits. */
16
+ readonly edit: "write";
17
+ /** Artwork for other tool calls. */
18
+ readonly other: "working";
19
+ /** Artwork for file reads. */
20
+ readonly read: "read";
21
+ /** Artwork for search results. */
22
+ readonly search: "search";
23
+ };
24
+ /** One changed or context line of a diff hunk. */
25
+ export type ToolDiffLine = Readonly<{
26
+ /** Line role. */
27
+ kind: "add" | "context" | "remove";
28
+ /** Line text without its diff marker. */
29
+ text: string;
30
+ }>;
31
+ /** One hunk: a jsdiff hunk, or one `@@` block of a Codex patch. */
32
+ export type ToolDiffHunk = Readonly<{
33
+ /** `-a,b +c,d` for computed hunks; the `@@` context for patch hunks. */
34
+ header?: string | undefined;
35
+ /** Hunk lines in order. */
36
+ lines: readonly ToolDiffLine[];
37
+ }>;
38
+ /** The hunks for one file. */
39
+ export type ToolDiffFile = Readonly<{
40
+ /** File operation. */
41
+ operation: "add" | "delete" | "update";
42
+ /** File path, when known. */
43
+ path?: string | undefined;
44
+ /** Destination of a move. */
45
+ moveTo?: string | undefined;
46
+ /** Hunks in file order. */
47
+ hunks: readonly ToolDiffHunk[];
48
+ /**
49
+ * The same hunks as one unified patch, formatted by jsdiff, for renderers
50
+ * that draw unified diffs (OpenTUI's diff view).
51
+ */
52
+ unified: string;
53
+ /**
54
+ * Whether hunk line numbers are real. Codex patch hunks carry no numbers,
55
+ * so their unified form numbers each hunk from 1 and renderers hide them.
56
+ */
57
+ lineNumbers: boolean;
58
+ }>;
59
+ /**
60
+ * One display row of a diff, flattened once here so every renderer draws the
61
+ * same rows. File rows appear only when a call touches several files.
62
+ */
63
+ export type ToolDiffRow = Readonly<{
64
+ /** Row role. */
65
+ kind: "add" | "context" | "file" | "hunk" | "remove";
66
+ /** Row text without a marker. */
67
+ text: string;
68
+ }>;
69
+ /** One file excerpt line; the number is present only when it is known. */
70
+ export type ToolExcerptLine = Readonly<{
71
+ /** One-based line number in the file. */
72
+ number?: number | undefined;
73
+ /** Line text. */
74
+ text: string;
75
+ }>;
76
+ /** One search hit. */
77
+ export type ToolMatch = Readonly<{
78
+ /** `path:line` of the hit. */
79
+ location: string;
80
+ /** Matched line text. */
81
+ text: string;
82
+ }>;
83
+ /** One line of command output, marked by the stream that produced it. */
84
+ export type ToolOutputLine = Readonly<{
85
+ /** Producing stream. */
86
+ stream: "stderr" | "stdout";
87
+ /** Line text without ANSI sequences. */
88
+ text: string;
89
+ }>;
90
+ /**
91
+ * One typed section of an expanded call body. Sections hold complete bounded
92
+ * content; renderers show `preview` items and offer the rest.
93
+ */
94
+ export type ToolCallSection = Readonly<{
95
+ /** File excerpt. */
96
+ kind: "excerpt";
97
+ /** Excerpt lines, in file order. */
98
+ lines: readonly ToolExcerptLine[];
99
+ /** Items shown before "more". */
100
+ preview: number;
101
+ } | {
102
+ /** Search hits. */
103
+ kind: "matches";
104
+ /** Hits, in result order. */
105
+ matches: readonly ToolMatch[];
106
+ /** Items shown before "more". */
107
+ preview: number;
108
+ } | {
109
+ /** Edit diff: structured files and their flattened display rows. */
110
+ kind: "diff";
111
+ /** Structured hunks per file. */
112
+ files: readonly ToolDiffFile[];
113
+ /** Flattened display rows for every file. */
114
+ lines: readonly ToolDiffRow[];
115
+ /** Items shown before "more". */
116
+ preview: number;
117
+ } | {
118
+ /** The command line, drawn as `$ <command>`. */
119
+ kind: "command";
120
+ /** Text lines. */
121
+ lines: readonly string[];
122
+ /** Items shown before "more". */
123
+ preview: number;
124
+ } | {
125
+ /** Script source. */
126
+ kind: "script";
127
+ /** Text lines. */
128
+ lines: readonly string[];
129
+ /** Items shown before "more". */
130
+ preview: number;
131
+ } | {
132
+ /** Command output with stderr lines marked. */
133
+ kind: "output";
134
+ /** Output lines, stdout before stderr. */
135
+ lines: readonly ToolOutputLine[];
136
+ /** Items shown before "more". */
137
+ preview: number;
138
+ } | {
139
+ /** Plain or JSON text with a human label, e.g. `Arguments`. */
140
+ kind: "text";
141
+ /** Human label, e.g. `Arguments`. */
142
+ label?: string | undefined;
143
+ /** Highlighting hint. */
144
+ language?: "json" | undefined;
145
+ /** Text lines. */
146
+ lines: readonly string[];
147
+ /** Items shown before "more". */
148
+ preview: number;
149
+ }>;
150
+ /** Renderer-neutral presentation of one tool call and its joined result. */
151
+ export type ToolCallView = Readonly<{
152
+ /** Tool-call identity. */
153
+ id: string;
154
+ /** Typed tool kind. */
155
+ kind: ToolKind;
156
+ /** Pi tool name. */
157
+ name: string;
158
+ /** Past-tense verb for the finished call, e.g. `Read`. */
159
+ verb: string;
160
+ /** Present-tense verb for the running call, e.g. `Reading`. */
161
+ activeVerb: string;
162
+ /** Short one-line target: a path, command, pattern, or first code line. */
163
+ label: string;
164
+ /** Distinct file paths this call reads or edits, when known. */
165
+ paths: readonly string[];
166
+ /** Call activity. */
167
+ status: ToolItem["status"];
168
+ /** Milliseconds from the call to its result, when both are known. */
169
+ durationMs?: number | undefined;
170
+ /** A non-zero process exit code, for a header chip. */
171
+ exitCode?: number | undefined;
172
+ /** The failure message, shown before the body, for failed calls. */
173
+ error?: string | undefined;
174
+ /** Expanded body sections, in display order. */
175
+ sections: readonly ToolCallSection[];
176
+ }>;
177
+ /** Items shown before "more" for excerpts, matches, and output. */
178
+ export declare const toolPreviewLineLimit = 12;
179
+ /** Build the renderer-neutral view of one call. */
180
+ export declare function toolCallView(item: ToolItem): ToolCallView;
181
+ /** Compact duration: `340ms`, `1.2s`, `2m 5s`. */
182
+ export declare function formatToolDuration(milliseconds: number): string;