Dashboard › opencode › Distillation
bebb7ee5-2d19-4eef-8d3a-6ac890a9cbc2["lore_tm_v1_VZNSVTalfRNElGfdXH26b7v_Ov5_m-QjVhs0L_hItHA","lore_tm_v1_MmDn8eX0iFlF1mXRwpD_txaeYfNBB94QuQI_wLAe_kk","lore_tm_v1_GVYqghgsncEszhC8PSSFUwdfTuw4SrMSZ7Olf4EmVYM","lore_tm_v1_0FfN6XCXxPycZ_ksAqHAtY8hl9YyZUqzRGdIxGLT29I"]
packages/core/src/session/runner/to-llm-message.ts:257-258 converts a "synthetic" session message into exactly one Message.make({ id: message.id, role: "user", content: message.text }); unlike adjacent "user" and "skill" cases, it does not forward message.metadata.packages/core/src/session/runner/to-llm-message.ts:264-265 excludes shell messages from model context when message.metadata?.background === true; non-background shell messages become user-role messages containing the command and message.output?.output ?? "", with metadata preserved.packages/core/src/util/wildcard.ts exports namespace Wildcard from "./wildcard.js" and implements match(input: string, pattern: string): normalizes \ to /, regex-escapes [.+^${}()|[\]\\], converts * to .* and ? to ., rewrites a trailing " .*" to "( .*)?", anchors with ^...$, and uses regex flags "si" on Windows or "s" otherwise.resource: string / related shell command resource handling found exactly 6 matches: packages/core/src/shell/scan.ts:15; and packages/core/src/shell/parse.ts:18,195,196,200,260.packages/core/src/shell/parse.ts:173-205 selects the PowerShell or Bash parser via ShellSelect.ps(shell), fails with "Failed to parse shell command" when parsing returns no tree, walks descendants of type "command", sends commands in CWD through directoryArgs(...), and otherwise records resource as the trimmed redirected statement or command text and save as `${prefix(tokens).join(" ")} *`. The syntax tree is released with tree.delete().packages/core/src/shell/parse.ts:207-215 dynamically imports ./scan.js; import failure becomes new Error(\Portable shell scanner failed to load: ${cause}`, { cause }), and an opaque scan result fails with new Error(`Portable shell scanner cannot analyze command: ${result.reason}`)`.scanPortable() in packages/core/src/shell/parse.ts:217-243 skips items where item.declaration is true, truncates rawWords at redirectWordCount when defined, and for PowerShell skips statement-head words matching /^foreach(?:-|$)/i. Commands in CWD are processed through directoryArgs(...); PowerShell parameters matching /^(-(?:literalpath|path)):(.*)$/i are split into command_parameter and word parts.packages/core/src/shell/parse.ts:244-262 computes selected = prefix(words.slice(0, PREFIX_LENGTH)) and conventional = \${selected.join(" ")} `. It retains the conventional form for non-PowerShell commands, missing word-end offsets, or when Wildcard.match(item.resource, conventional)succeeds; otherwise it preserves the original PowerShell source boundary and separator before appending. Each output command keeps resource: item.resourceand the resultingsave`.