pi-usereq 0.49.0 → 0.51.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/README.md +1 -1
- package/package.json +5 -1
- package/scripts/lib/extension-debug-harness.ts +443 -0
- package/scripts/lib/recording-extension-api.ts +855 -0
- package/scripts/lib/sdk-smoke.ts +503 -0
- package/src/core/extension-status.ts +13 -4
- package/src/index.ts +105 -71
- package/.g.conf +0 -16
- package/.github/workflows/release-npm.yml +0 -134
- package/.gitignore +0 -274
- package/CHANGELOG.md +0 -706
- package/TODO.md +0 -20
- package/docs/pi.dev/agent-document-manifest.json +0 -6399
- package/docs/pi.dev/coding-agent-docs/compaction.md +0 -394
- package/docs/pi.dev/coding-agent-docs/custom-provider.md +0 -637
- package/docs/pi.dev/coding-agent-docs/development.md +0 -71
- package/docs/pi.dev/coding-agent-docs/extensions.md +0 -2536
- package/docs/pi.dev/coding-agent-docs/images/doom-extension.png +0 -0
- package/docs/pi.dev/coding-agent-docs/images/exy.png +0 -0
- package/docs/pi.dev/coding-agent-docs/images/interactive-mode.png +0 -0
- package/docs/pi.dev/coding-agent-docs/images/tree-view.png +0 -0
- package/docs/pi.dev/coding-agent-docs/json.md +0 -82
- package/docs/pi.dev/coding-agent-docs/keybindings.md +0 -197
- package/docs/pi.dev/coding-agent-docs/models.md +0 -395
- package/docs/pi.dev/coding-agent-docs/packages.md +0 -218
- package/docs/pi.dev/coding-agent-docs/prompt-templates.md +0 -88
- package/docs/pi.dev/coding-agent-docs/providers.md +0 -196
- package/docs/pi.dev/coding-agent-docs/rpc.md +0 -1407
- package/docs/pi.dev/coding-agent-docs/sdk.md +0 -1149
- package/docs/pi.dev/coding-agent-docs/session.md +0 -412
- package/docs/pi.dev/coding-agent-docs/settings.md +0 -248
- package/docs/pi.dev/coding-agent-docs/shell-aliases.md +0 -13
- package/docs/pi.dev/coding-agent-docs/skills.md +0 -232
- package/docs/pi.dev/coding-agent-docs/terminal-setup.md +0 -106
- package/docs/pi.dev/coding-agent-docs/termux.md +0 -127
- package/docs/pi.dev/coding-agent-docs/themes.md +0 -295
- package/docs/pi.dev/coding-agent-docs/tmux.md +0 -61
- package/docs/pi.dev/coding-agent-docs/tree.md +0 -233
- package/docs/pi.dev/coding-agent-docs/tui.md +0 -918
- package/docs/pi.dev/coding-agent-docs/windows.md +0 -17
- package/docs/pi.dev/mom-docs/artifacts-server.md +0 -475
- package/docs/pi.dev/mom-docs/events.md +0 -307
- package/docs/pi.dev/mom-docs/new.md +0 -970
- package/docs/pi.dev/mom-docs/sandbox.md +0 -153
- package/docs/pi.dev/mom-docs/slack-bot-minimal-guide.md +0 -399
- package/docs/pi.dev/mom-docs/v86.md +0 -319
- package/docs/pi.dev/pods-docs/gml-4.5.md +0 -189
- package/docs/pi.dev/pods-docs/gpt-oss.md +0 -233
- package/docs/pi.dev/pods-docs/implementation-plan.md +0 -183
- package/docs/pi.dev/pods-docs/kimi-k2.md +0 -197
- package/docs/pi.dev/pods-docs/models.md +0 -116
- package/docs/pi.dev/pods-docs/plan.md +0 -166
- package/docs/pi.dev/pods-docs/qwen3-coder.md +0 -132
- package/images/flowchart-bw.png +0 -0
- package/images/flowchart-bw.svg +0 -102
- package/images/flowchart.md +0 -100
- package/images/flowchart.png +0 -0
- package/images/flowchart.svg +0 -3
- package/pi-usereq/docs/REFERENCES.md +0 -5713
- package/pi-usereq/docs/REQUIREMENTS.md +0 -781
- package/pi-usereq/docs/WORKFLOW.md +0 -1341
- package/pi.dev-src/pi-mono/agent/src/agent-loop.ts +0 -683
- package/pi.dev-src/pi-mono/agent/src/agent.ts +0 -543
- package/pi.dev-src/pi-mono/agent/src/index.ts +0 -8
- package/pi.dev-src/pi-mono/agent/src/proxy.ts +0 -367
- package/pi.dev-src/pi-mono/agent/src/types.ts +0 -364
- package/pi.dev-src/pi-mono/agent/test/agent-loop.test.ts +0 -1181
- package/pi.dev-src/pi-mono/agent/test/agent.test.ts +0 -463
- package/pi.dev-src/pi-mono/agent/test/e2e.test.ts +0 -404
- package/pi.dev-src/pi-mono/agent/test/utils/calculate.ts +0 -32
- package/pi.dev-src/pi-mono/agent/test/utils/get-current-time.ts +0 -46
- package/pi.dev-src/pi-mono/agent/vitest.config.ts +0 -9
- package/pi.dev-src/pi-mono/ai/bedrock-provider.d.ts +0 -1
- package/pi.dev-src/pi-mono/ai/bedrock-provider.js +0 -1
- package/pi.dev-src/pi-mono/ai/scripts/generate-models.ts +0 -1635
- package/pi.dev-src/pi-mono/ai/scripts/generate-test-image.ts +0 -34
- package/pi.dev-src/pi-mono/ai/src/api-registry.ts +0 -98
- package/pi.dev-src/pi-mono/ai/src/bedrock-provider.ts +0 -6
- package/pi.dev-src/pi-mono/ai/src/cli.ts +0 -133
- package/pi.dev-src/pi-mono/ai/src/env-api-keys.ts +0 -134
- package/pi.dev-src/pi-mono/ai/src/index.ts +0 -35
- package/pi.dev-src/pi-mono/ai/src/models.generated.ts +0 -14928
- package/pi.dev-src/pi-mono/ai/src/models.ts +0 -82
- package/pi.dev-src/pi-mono/ai/src/oauth.ts +0 -1
- package/pi.dev-src/pi-mono/ai/src/providers/amazon-bedrock.ts +0 -929
- package/pi.dev-src/pi-mono/ai/src/providers/anthropic.ts +0 -1125
- package/pi.dev-src/pi-mono/ai/src/providers/azure-openai-responses.ts +0 -253
- package/pi.dev-src/pi-mono/ai/src/providers/faux.ts +0 -499
- package/pi.dev-src/pi-mono/ai/src/providers/github-copilot-headers.ts +0 -37
- package/pi.dev-src/pi-mono/ai/src/providers/google-gemini-cli.ts +0 -996
- package/pi.dev-src/pi-mono/ai/src/providers/google-shared.ts +0 -354
- package/pi.dev-src/pi-mono/ai/src/providers/google-vertex.ts +0 -543
- package/pi.dev-src/pi-mono/ai/src/providers/google.ts +0 -500
- package/pi.dev-src/pi-mono/ai/src/providers/mistral.ts +0 -629
- package/pi.dev-src/pi-mono/ai/src/providers/openai-codex-responses.ts +0 -984
- package/pi.dev-src/pi-mono/ai/src/providers/openai-completions.ts +0 -1063
- package/pi.dev-src/pi-mono/ai/src/providers/openai-responses-shared.ts +0 -539
- package/pi.dev-src/pi-mono/ai/src/providers/openai-responses.ts +0 -264
- package/pi.dev-src/pi-mono/ai/src/providers/register-builtins.ts +0 -433
- package/pi.dev-src/pi-mono/ai/src/providers/simple-options.ts +0 -47
- package/pi.dev-src/pi-mono/ai/src/providers/transform-messages.ts +0 -220
- package/pi.dev-src/pi-mono/ai/src/stream.ts +0 -59
- package/pi.dev-src/pi-mono/ai/src/types.ts +0 -417
- package/pi.dev-src/pi-mono/ai/src/utils/event-stream.ts +0 -87
- package/pi.dev-src/pi-mono/ai/src/utils/hash.ts +0 -13
- package/pi.dev-src/pi-mono/ai/src/utils/headers.ts +0 -7
- package/pi.dev-src/pi-mono/ai/src/utils/json-parse.ts +0 -124
- package/pi.dev-src/pi-mono/ai/src/utils/overflow.ts +0 -138
- package/pi.dev-src/pi-mono/ai/src/utils/sanitize-unicode.ts +0 -25
- package/pi.dev-src/pi-mono/ai/src/utils/typebox-helpers.ts +0 -24
- package/pi.dev-src/pi-mono/ai/src/utils/validation.ts +0 -324
- package/pi.dev-src/pi-mono/ai/test/abort.test.ts +0 -260
- package/pi.dev-src/pi-mono/ai/test/anthropic-oauth.test.ts +0 -99
- package/pi.dev-src/pi-mono/ai/test/anthropic-opus-4-7-smoke.test.ts +0 -72
- package/pi.dev-src/pi-mono/ai/test/anthropic-sse-parsing.test.ts +0 -113
- package/pi.dev-src/pi-mono/ai/test/anthropic-thinking-disable.test.ts +0 -152
- package/pi.dev-src/pi-mono/ai/test/anthropic-tool-name-normalization.test.ts +0 -205
- package/pi.dev-src/pi-mono/ai/test/azure-utils.ts +0 -28
- package/pi.dev-src/pi-mono/ai/test/bedrock-endpoint-resolution.test.ts +0 -131
- package/pi.dev-src/pi-mono/ai/test/bedrock-models.test.ts +0 -66
- package/pi.dev-src/pi-mono/ai/test/bedrock-thinking-payload.test.ts +0 -107
- package/pi.dev-src/pi-mono/ai/test/bedrock-utils.ts +0 -18
- package/pi.dev-src/pi-mono/ai/test/cache-retention.test.ts +0 -335
- package/pi.dev-src/pi-mono/ai/test/context-overflow.test.ts +0 -714
- package/pi.dev-src/pi-mono/ai/test/cross-provider-handoff.test.ts +0 -458
- package/pi.dev-src/pi-mono/ai/test/data/red-circle.png +0 -0
- package/pi.dev-src/pi-mono/ai/test/empty.test.ts +0 -742
- package/pi.dev-src/pi-mono/ai/test/faux-provider.test.ts +0 -597
- package/pi.dev-src/pi-mono/ai/test/fireworks-models.test.ts +0 -49
- package/pi.dev-src/pi-mono/ai/test/github-copilot-anthropic.test.ts +0 -108
- package/pi.dev-src/pi-mono/ai/test/github-copilot-oauth.test.ts +0 -196
- package/pi.dev-src/pi-mono/ai/test/google-gemini-cli-claude-thinking-header.test.ts +0 -103
- package/pi.dev-src/pi-mono/ai/test/google-gemini-cli-empty-stream.test.ts +0 -108
- package/pi.dev-src/pi-mono/ai/test/google-gemini-cli-retry-delay.test.ts +0 -53
- package/pi.dev-src/pi-mono/ai/test/google-shared-convert-tools.test.ts +0 -187
- package/pi.dev-src/pi-mono/ai/test/google-shared-gemini3-unsigned-tool-call.test.ts +0 -172
- package/pi.dev-src/pi-mono/ai/test/google-shared-image-tool-result-routing.test.ts +0 -124
- package/pi.dev-src/pi-mono/ai/test/google-thinking-disable.test.ts +0 -183
- package/pi.dev-src/pi-mono/ai/test/google-thinking-signature.test.ts +0 -38
- package/pi.dev-src/pi-mono/ai/test/google-tool-call-missing-args.test.ts +0 -105
- package/pi.dev-src/pi-mono/ai/test/google-vertex-api-key-resolution.test.ts +0 -144
- package/pi.dev-src/pi-mono/ai/test/image-tool-result.test.ts +0 -481
- package/pi.dev-src/pi-mono/ai/test/interleaved-thinking.test.ts +0 -145
- package/pi.dev-src/pi-mono/ai/test/lazy-module-load.test.ts +0 -102
- package/pi.dev-src/pi-mono/ai/test/mistral-reasoning-mode.test.ts +0 -66
- package/pi.dev-src/pi-mono/ai/test/mistral-tool-schema.test.ts +0 -61
- package/pi.dev-src/pi-mono/ai/test/oauth.ts +0 -89
- package/pi.dev-src/pi-mono/ai/test/openai-codex-cache-affinity-e2e.test.ts +0 -36
- package/pi.dev-src/pi-mono/ai/test/openai-codex-stream.test.ts +0 -686
- package/pi.dev-src/pi-mono/ai/test/openai-completions-cache-control-format.test.ts +0 -189
- package/pi.dev-src/pi-mono/ai/test/openai-completions-prompt-cache.test.ts +0 -198
- package/pi.dev-src/pi-mono/ai/test/openai-completions-thinking-as-text.test.ts +0 -214
- package/pi.dev-src/pi-mono/ai/test/openai-completions-tool-choice.test.ts +0 -560
- package/pi.dev-src/pi-mono/ai/test/openai-completions-tool-result-images.test.ts +0 -101
- package/pi.dev-src/pi-mono/ai/test/openai-responses-cache-affinity-e2e.test.ts +0 -32
- package/pi.dev-src/pi-mono/ai/test/openai-responses-copilot-provider.test.ts +0 -128
- package/pi.dev-src/pi-mono/ai/test/openai-responses-foreign-toolcall-id.test.ts +0 -66
- package/pi.dev-src/pi-mono/ai/test/openai-responses-partial-json-cleanup.test.ts +0 -101
- package/pi.dev-src/pi-mono/ai/test/openai-responses-reasoning-replay-e2e.test.ts +0 -292
- package/pi.dev-src/pi-mono/ai/test/openai-responses-tool-result-images.test.ts +0 -200
- package/pi.dev-src/pi-mono/ai/test/openrouter-cache-write-repro.test.ts +0 -78
- package/pi.dev-src/pi-mono/ai/test/overflow.test.ts +0 -64
- package/pi.dev-src/pi-mono/ai/test/responseid.test.ts +0 -145
- package/pi.dev-src/pi-mono/ai/test/stream.test.ts +0 -1405
- package/pi.dev-src/pi-mono/ai/test/supports-xhigh.test.ts +0 -34
- package/pi.dev-src/pi-mono/ai/test/tokens.test.ts +0 -304
- package/pi.dev-src/pi-mono/ai/test/tool-call-id-normalization.test.ts +0 -291
- package/pi.dev-src/pi-mono/ai/test/tool-call-without-result.test.ts +0 -313
- package/pi.dev-src/pi-mono/ai/test/total-tokens.test.ts +0 -695
- package/pi.dev-src/pi-mono/ai/test/transform-messages-copilot-openai-to-anthropic.test.ts +0 -191
- package/pi.dev-src/pi-mono/ai/test/unicode-surrogate.test.ts +0 -754
- package/pi.dev-src/pi-mono/ai/test/validation.test.ts +0 -116
- package/pi.dev-src/pi-mono/ai/test/xhigh.test.ts +0 -71
- package/pi.dev-src/pi-mono/ai/test/zen.test.ts +0 -25
- package/pi.dev-src/pi-mono/ai/vitest.config.ts +0 -9
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/antigravity-image-gen.ts +0 -418
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/auto-commit-on-exit.ts +0 -49
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/bash-spawn-hook.ts +0 -30
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/bookmark.ts +0 -50
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/built-in-tool-renderer.ts +0 -249
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/claude-rules.ts +0 -86
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/commands.ts +0 -72
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/confirm-destructive.ts +0 -59
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/custom-compaction.ts +0 -127
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/custom-footer.ts +0 -64
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/custom-header.ts +0 -73
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/custom-provider-anthropic/index.ts +0 -604
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/custom-provider-anthropic/package-lock.json +0 -24
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/custom-provider-gitlab-duo/index.ts +0 -349
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/custom-provider-gitlab-duo/test.ts +0 -82
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/custom-provider-qwen-cli/index.ts +0 -345
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/dirty-repo-guard.ts +0 -56
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/doom-overlay/doom/build.sh +0 -152
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +0 -72
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/doom-overlay/doom-component.ts +0 -132
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/doom-overlay/doom-engine.ts +0 -173
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/doom-overlay/doom-keys.ts +0 -104
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/doom-overlay/index.ts +0 -74
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/doom-overlay/wad-finder.ts +0 -51
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/dynamic-resources/SKILL.md +0 -8
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/dynamic-resources/dynamic.json +0 -79
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/dynamic-resources/dynamic.md +0 -5
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/dynamic-resources/index.ts +0 -15
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/dynamic-tools.ts +0 -74
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/event-bus.ts +0 -43
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/file-trigger.ts +0 -41
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/git-checkpoint.ts +0 -53
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/github-issue-autocomplete.ts +0 -185
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/handoff.ts +0 -153
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/hello.ts +0 -26
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/hidden-thinking-label.ts +0 -53
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/inline-bash.ts +0 -94
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/input-transform.ts +0 -43
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/interactive-shell.ts +0 -196
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/mac-system-theme.ts +0 -47
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/message-renderer.ts +0 -59
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/minimal-mode.ts +0 -426
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/modal-editor.ts +0 -85
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/model-status.ts +0 -31
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/notify.ts +0 -55
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/overlay-qa-tests.ts +0 -1348
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/overlay-test.ts +0 -150
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/permission-gate.ts +0 -34
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/pirate.ts +0 -47
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/plan-mode/index.ts +0 -340
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/plan-mode/utils.ts +0 -168
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/preset.ts +0 -430
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/prompt-customizer.ts +0 -97
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/protected-paths.ts +0 -30
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/provider-payload.ts +0 -18
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/qna.ts +0 -122
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/question.ts +0 -264
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/questionnaire.ts +0 -427
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/rainbow-editor.ts +0 -88
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/reload-runtime.ts +0 -37
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/rpc-demo.ts +0 -118
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/sandbox/index.ts +0 -321
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/sandbox/package-lock.json +0 -92
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/send-user-message.ts +0 -97
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/session-name.ts +0 -27
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/shutdown-command.ts +0 -63
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/snake.ts +0 -343
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/space-invaders.ts +0 -560
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/ssh.ts +0 -220
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/status-line.ts +0 -32
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/structured-output.ts +0 -65
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/subagent/agents/planner.md +0 -37
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/subagent/agents/reviewer.md +0 -35
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/subagent/agents/scout.md +0 -50
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/subagent/agents/worker.md +0 -24
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/subagent/agents.ts +0 -126
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/subagent/index.ts +0 -987
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/subagent/prompts/implement-and-review.md +0 -10
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/subagent/prompts/implement.md +0 -10
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/subagent/prompts/scout-and-plan.md +0 -9
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/summarize.ts +0 -206
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/system-prompt-header.ts +0 -17
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/tic-tac-toe.ts +0 -1008
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/timed-confirm.ts +0 -70
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/titlebar-spinner.ts +0 -58
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/todo.ts +0 -297
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/tool-override.ts +0 -144
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/tools.ts +0 -141
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/trigger-compact.ts +0 -50
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/truncated-tool.ts +0 -195
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/widget-placement.ts +0 -9
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/with-deps/index.ts +0 -32
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/with-deps/package-lock.json +0 -31
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/working-indicator.ts +0 -123
- package/pi.dev-src/pi-mono/coding-agent/examples/extensions/working-message-test.ts +0 -25
- package/pi.dev-src/pi-mono/coding-agent/examples/rpc-extension-ui.ts +0 -632
- package/pi.dev-src/pi-mono/coding-agent/examples/sdk/01-minimal.ts +0 -22
- package/pi.dev-src/pi-mono/coding-agent/examples/sdk/02-custom-model.ts +0 -49
- package/pi.dev-src/pi-mono/coding-agent/examples/sdk/03-custom-prompt.ts +0 -62
- package/pi.dev-src/pi-mono/coding-agent/examples/sdk/04-skills.ts +0 -55
- package/pi.dev-src/pi-mono/coding-agent/examples/sdk/05-tools.ts +0 -44
- package/pi.dev-src/pi-mono/coding-agent/examples/sdk/06-extensions.ts +0 -90
- package/pi.dev-src/pi-mono/coding-agent/examples/sdk/07-context-files.ts +0 -42
- package/pi.dev-src/pi-mono/coding-agent/examples/sdk/08-prompt-templates.ts +0 -51
- package/pi.dev-src/pi-mono/coding-agent/examples/sdk/09-api-keys-and-oauth.ts +0 -48
- package/pi.dev-src/pi-mono/coding-agent/examples/sdk/10-settings.ts +0 -53
- package/pi.dev-src/pi-mono/coding-agent/examples/sdk/11-sessions.ts +0 -48
- package/pi.dev-src/pi-mono/coding-agent/examples/sdk/12-full-control.ts +0 -73
- package/pi.dev-src/pi-mono/coding-agent/examples/sdk/13-session-runtime.ts +0 -67
- package/pi.dev-src/pi-mono/coding-agent/scripts/migrate-sessions.sh +0 -93
- package/pi.dev-src/pi-mono/coding-agent/src/bun/cli.ts +0 -6
- package/pi.dev-src/pi-mono/coding-agent/src/bun/register-bedrock.ts +0 -4
- package/pi.dev-src/pi-mono/coding-agent/src/cli/args.ts +0 -335
- package/pi.dev-src/pi-mono/coding-agent/src/cli/config-selector.ts +0 -52
- package/pi.dev-src/pi-mono/coding-agent/src/cli/file-processor.ts +0 -100
- package/pi.dev-src/pi-mono/coding-agent/src/cli/initial-message.ts +0 -43
- package/pi.dev-src/pi-mono/coding-agent/src/cli/list-models.ts +0 -110
- package/pi.dev-src/pi-mono/coding-agent/src/cli/session-picker.ts +0 -52
- package/pi.dev-src/pi-mono/coding-agent/src/cli.ts +0 -17
- package/pi.dev-src/pi-mono/coding-agent/src/config.ts +0 -261
- package/pi.dev-src/pi-mono/coding-agent/src/core/agent-session-runtime.ts +0 -394
- package/pi.dev-src/pi-mono/coding-agent/src/core/agent-session-services.ts +0 -196
- package/pi.dev-src/pi-mono/coding-agent/src/core/agent-session.ts +0 -3096
- package/pi.dev-src/pi-mono/coding-agent/src/core/auth-storage.ts +0 -493
- package/pi.dev-src/pi-mono/coding-agent/src/core/bash-executor.ts +0 -154
- package/pi.dev-src/pi-mono/coding-agent/src/core/compaction/branch-summarization.ts +0 -355
- package/pi.dev-src/pi-mono/coding-agent/src/core/compaction/compaction.ts +0 -839
- package/pi.dev-src/pi-mono/coding-agent/src/core/compaction/index.ts +0 -7
- package/pi.dev-src/pi-mono/coding-agent/src/core/compaction/utils.ts +0 -170
- package/pi.dev-src/pi-mono/coding-agent/src/core/defaults.ts +0 -3
- package/pi.dev-src/pi-mono/coding-agent/src/core/diagnostics.ts +0 -15
- package/pi.dev-src/pi-mono/coding-agent/src/core/event-bus.ts +0 -33
- package/pi.dev-src/pi-mono/coding-agent/src/core/exec.ts +0 -107
- package/pi.dev-src/pi-mono/coding-agent/src/core/export-html/ansi-to-html.ts +0 -258
- package/pi.dev-src/pi-mono/coding-agent/src/core/export-html/index.ts +0 -314
- package/pi.dev-src/pi-mono/coding-agent/src/core/export-html/template.css +0 -1017
- package/pi.dev-src/pi-mono/coding-agent/src/core/export-html/template.html +0 -55
- package/pi.dev-src/pi-mono/coding-agent/src/core/export-html/template.js +0 -1770
- package/pi.dev-src/pi-mono/coding-agent/src/core/export-html/tool-renderer.ts +0 -158
- package/pi.dev-src/pi-mono/coding-agent/src/core/export-html/vendor/highlight.min.js +0 -1213
- package/pi.dev-src/pi-mono/coding-agent/src/core/export-html/vendor/marked.min.js +0 -6
- package/pi.dev-src/pi-mono/coding-agent/src/core/extensions/index.ts +0 -171
- package/pi.dev-src/pi-mono/coding-agent/src/core/extensions/loader.ts +0 -606
- package/pi.dev-src/pi-mono/coding-agent/src/core/extensions/runner.ts +0 -1019
- package/pi.dev-src/pi-mono/coding-agent/src/core/extensions/types.ts +0 -1542
- package/pi.dev-src/pi-mono/coding-agent/src/core/extensions/wrapper.ts +0 -30
- package/pi.dev-src/pi-mono/coding-agent/src/core/footer-data-provider.ts +0 -354
- package/pi.dev-src/pi-mono/coding-agent/src/core/index.ts +0 -77
- package/pi.dev-src/pi-mono/coding-agent/src/core/keybindings.ts +0 -370
- package/pi.dev-src/pi-mono/coding-agent/src/core/messages.ts +0 -195
- package/pi.dev-src/pi-mono/coding-agent/src/core/model-registry.ts +0 -858
- package/pi.dev-src/pi-mono/coding-agent/src/core/model-resolver.ts +0 -629
- package/pi.dev-src/pi-mono/coding-agent/src/core/output-guard.ts +0 -74
- package/pi.dev-src/pi-mono/coding-agent/src/core/package-manager.ts +0 -2408
- package/pi.dev-src/pi-mono/coding-agent/src/core/prompt-templates.ts +0 -296
- package/pi.dev-src/pi-mono/coding-agent/src/core/resolve-config-value.ts +0 -142
- package/pi.dev-src/pi-mono/coding-agent/src/core/resource-loader.ts +0 -917
- package/pi.dev-src/pi-mono/coding-agent/src/core/sdk.ts +0 -380
- package/pi.dev-src/pi-mono/coding-agent/src/core/session-cwd.ts +0 -59
- package/pi.dev-src/pi-mono/coding-agent/src/core/session-manager.ts +0 -1425
- package/pi.dev-src/pi-mono/coding-agent/src/core/settings-manager.ts +0 -999
- package/pi.dev-src/pi-mono/coding-agent/src/core/skills.ts +0 -508
- package/pi.dev-src/pi-mono/coding-agent/src/core/slash-commands.ts +0 -39
- package/pi.dev-src/pi-mono/coding-agent/src/core/source-info.ts +0 -40
- package/pi.dev-src/pi-mono/coding-agent/src/core/system-prompt.ts +0 -172
- package/pi.dev-src/pi-mono/coding-agent/src/core/telemetry.ts +0 -13
- package/pi.dev-src/pi-mono/coding-agent/src/core/timings.ts +0 -31
- package/pi.dev-src/pi-mono/coding-agent/src/core/tools/bash.ts +0 -448
- package/pi.dev-src/pi-mono/coding-agent/src/core/tools/edit-diff.ts +0 -445
- package/pi.dev-src/pi-mono/coding-agent/src/core/tools/edit.ts +0 -487
- package/pi.dev-src/pi-mono/coding-agent/src/core/tools/file-mutation-queue.ts +0 -39
- package/pi.dev-src/pi-mono/coding-agent/src/core/tools/find.ts +0 -370
- package/pi.dev-src/pi-mono/coding-agent/src/core/tools/grep.ts +0 -384
- package/pi.dev-src/pi-mono/coding-agent/src/core/tools/index.ts +0 -196
- package/pi.dev-src/pi-mono/coding-agent/src/core/tools/ls.ts +0 -229
- package/pi.dev-src/pi-mono/coding-agent/src/core/tools/path-utils.ts +0 -94
- package/pi.dev-src/pi-mono/coding-agent/src/core/tools/read.ts +0 -273
- package/pi.dev-src/pi-mono/coding-agent/src/core/tools/render-utils.ts +0 -64
- package/pi.dev-src/pi-mono/coding-agent/src/core/tools/tool-definition-wrapper.ts +0 -45
- package/pi.dev-src/pi-mono/coding-agent/src/core/tools/truncate.ts +0 -265
- package/pi.dev-src/pi-mono/coding-agent/src/core/tools/write.ts +0 -281
- package/pi.dev-src/pi-mono/coding-agent/src/index.ts +0 -352
- package/pi.dev-src/pi-mono/coding-agent/src/main.ts +0 -731
- package/pi.dev-src/pi-mono/coding-agent/src/migrations.ts +0 -314
- package/pi.dev-src/pi-mono/coding-agent/src/modes/index.ts +0 -9
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/assets/clankolas.png +0 -0
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/armin.ts +0 -382
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/assistant-message.ts +0 -147
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/bash-execution.ts +0 -218
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/bordered-loader.ts +0 -68
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/branch-summary-message.ts +0 -58
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/compaction-summary-message.ts +0 -59
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/config-selector.ts +0 -592
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/countdown-timer.ts +0 -38
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/custom-editor.ts +0 -80
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/custom-message.ts +0 -99
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/daxnuts.ts +0 -164
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/diff.ts +0 -147
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/dynamic-border.ts +0 -25
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/earendil-announcement.ts +0 -53
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/extension-editor.ts +0 -147
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/extension-input.ts +0 -87
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/extension-selector.ts +0 -107
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/footer.ts +0 -220
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/index.ts +0 -32
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/keybinding-hints.ts +0 -24
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/login-dialog.ts +0 -178
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/model-selector.ts +0 -338
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/oauth-selector.ts +0 -121
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/scoped-models-selector.ts +0 -355
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/session-selector-search.ts +0 -194
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/session-selector.ts +0 -1026
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/settings-selector.ts +0 -456
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/show-images-selector.ts +0 -50
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/skill-invocation-message.ts +0 -55
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/theme-selector.ts +0 -67
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/thinking-selector.ts +0 -74
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/tool-execution.ts +0 -352
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/tree-selector.ts +0 -1246
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/user-message-selector.ts +0 -155
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/user-message.ts +0 -35
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/components/visual-truncate.ts +0 -50
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/interactive-mode.ts +0 -5155
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/theme/dark.json +0 -85
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/theme/light.json +0 -84
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/theme/theme-schema.json +0 -335
- package/pi.dev-src/pi-mono/coding-agent/src/modes/interactive/theme/theme.ts +0 -1141
- package/pi.dev-src/pi-mono/coding-agent/src/modes/print-mode.ts +0 -158
- package/pi.dev-src/pi-mono/coding-agent/src/modes/rpc/jsonl.ts +0 -58
- package/pi.dev-src/pi-mono/coding-agent/src/modes/rpc/rpc-client.ts +0 -515
- package/pi.dev-src/pi-mono/coding-agent/src/modes/rpc/rpc-mode.ts +0 -745
- package/pi.dev-src/pi-mono/coding-agent/src/modes/rpc/rpc-types.ts +0 -264
- package/pi.dev-src/pi-mono/coding-agent/src/package-manager-cli.ts +0 -270
- package/pi.dev-src/pi-mono/coding-agent/src/utils/changelog.ts +0 -99
- package/pi.dev-src/pi-mono/coding-agent/src/utils/child-process.ts +0 -86
- package/pi.dev-src/pi-mono/coding-agent/src/utils/clipboard-image.ts +0 -300
- package/pi.dev-src/pi-mono/coding-agent/src/utils/clipboard-native.ts +0 -22
- package/pi.dev-src/pi-mono/coding-agent/src/utils/clipboard.ts +0 -81
- package/pi.dev-src/pi-mono/coding-agent/src/utils/exif-orientation.ts +0 -183
- package/pi.dev-src/pi-mono/coding-agent/src/utils/frontmatter.ts +0 -39
- package/pi.dev-src/pi-mono/coding-agent/src/utils/fs-watch.ts +0 -30
- package/pi.dev-src/pi-mono/coding-agent/src/utils/git.ts +0 -192
- package/pi.dev-src/pi-mono/coding-agent/src/utils/image-convert.ts +0 -41
- package/pi.dev-src/pi-mono/coding-agent/src/utils/image-resize.ts +0 -176
- package/pi.dev-src/pi-mono/coding-agent/src/utils/mime.ts +0 -30
- package/pi.dev-src/pi-mono/coding-agent/src/utils/paths.ts +0 -20
- package/pi.dev-src/pi-mono/coding-agent/src/utils/photon.ts +0 -139
- package/pi.dev-src/pi-mono/coding-agent/src/utils/shell.ts +0 -210
- package/pi.dev-src/pi-mono/coding-agent/src/utils/sleep.ts +0 -18
- package/pi.dev-src/pi-mono/coding-agent/src/utils/tools-manager.ts +0 -287
- package/pi.dev-src/pi-mono/coding-agent/test/agent-session-auto-compaction-queue.test.ts +0 -437
- package/pi.dev-src/pi-mono/coding-agent/test/agent-session-branching.test.ts +0 -156
- package/pi.dev-src/pi-mono/coding-agent/test/agent-session-compaction.test.ts +0 -208
- package/pi.dev-src/pi-mono/coding-agent/test/agent-session-concurrent.test.ts +0 -618
- package/pi.dev-src/pi-mono/coding-agent/test/agent-session-dynamic-provider.test.ts +0 -117
- package/pi.dev-src/pi-mono/coding-agent/test/agent-session-dynamic-tools.test.ts +0 -182
- package/pi.dev-src/pi-mono/coding-agent/test/agent-session-retry.test.ts +0 -318
- package/pi.dev-src/pi-mono/coding-agent/test/agent-session-runtime-events.test.ts +0 -208
- package/pi.dev-src/pi-mono/coding-agent/test/agent-session-stats.test.ts +0 -143
- package/pi.dev-src/pi-mono/coding-agent/test/agent-session-tree-navigation.test.ts +0 -323
- package/pi.dev-src/pi-mono/coding-agent/test/args.test.ts +0 -328
- package/pi.dev-src/pi-mono/coding-agent/test/assistant-message.test.ts +0 -57
- package/pi.dev-src/pi-mono/coding-agent/test/auth-storage.test.ts +0 -462
- package/pi.dev-src/pi-mono/coding-agent/test/bash-close-hang-windows.test.ts +0 -126
- package/pi.dev-src/pi-mono/coding-agent/test/bash-execution-width.test.ts +0 -80
- package/pi.dev-src/pi-mono/coding-agent/test/block-images.test.ts +0 -120
- package/pi.dev-src/pi-mono/coding-agent/test/clipboard-image-bmp-conversion.test.ts +0 -88
- package/pi.dev-src/pi-mono/coding-agent/test/clipboard-image.test.ts +0 -136
- package/pi.dev-src/pi-mono/coding-agent/test/compaction-extensions-example.test.ts +0 -66
- package/pi.dev-src/pi-mono/coding-agent/test/compaction-extensions.test.ts +0 -415
- package/pi.dev-src/pi-mono/coding-agent/test/compaction-serialization.test.ts +0 -79
- package/pi.dev-src/pi-mono/coding-agent/test/compaction-summary-reasoning.test.ts +0 -118
- package/pi.dev-src/pi-mono/coding-agent/test/compaction-thinking-model.test.ts +0 -223
- package/pi.dev-src/pi-mono/coding-agent/test/compaction.test.ts +0 -550
- package/pi.dev-src/pi-mono/coding-agent/test/config.test.ts +0 -30
- package/pi.dev-src/pi-mono/coding-agent/test/edit-tool-legacy-input.test.ts +0 -116
- package/pi.dev-src/pi-mono/coding-agent/test/edit-tool-no-full-redraw.test.ts +0 -235
- package/pi.dev-src/pi-mono/coding-agent/test/export-html-whitespace.test.ts +0 -12
- package/pi.dev-src/pi-mono/coding-agent/test/export-html-xss.test.ts +0 -28
- package/pi.dev-src/pi-mono/coding-agent/test/extensions-discovery.test.ts +0 -463
- package/pi.dev-src/pi-mono/coding-agent/test/extensions-input-event.test.ts +0 -112
- package/pi.dev-src/pi-mono/coding-agent/test/extensions-runner.test.ts +0 -805
- package/pi.dev-src/pi-mono/coding-agent/test/file-mutation-queue.test.ts +0 -163
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/assistant-message-with-thinking-code.json +0 -33
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/before-compaction.jsonl +0 -1003
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/empty-agent/.gitkeep +0 -0
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/empty-cwd/.gitkeep +0 -0
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/large-session.jsonl +0 -1019
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/consecutive-hyphens/SKILL.md +0 -8
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/disable-model-invocation/SKILL.md +0 -9
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/invalid-name-chars/SKILL.md +0 -8
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/invalid-yaml/SKILL.md +0 -8
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/long-name/SKILL.md +0 -8
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/missing-description/SKILL.md +0 -7
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/multiline-description/SKILL.md +0 -11
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/name-mismatch/SKILL.md +0 -8
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/nested/child-skill/SKILL.md +0 -8
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/no-frontmatter/SKILL.md +0 -3
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/root-skill-preferred/SKILL.md +0 -3
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/root-skill-preferred/nested-child/SKILL.md +0 -3
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/unknown-field/SKILL.md +0 -10
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills/valid-skill/SKILL.md +0 -8
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills-collision/first/calendar/SKILL.md +0 -8
- package/pi.dev-src/pi-mono/coding-agent/test/fixtures/skills-collision/second/calendar/SKILL.md +0 -8
- package/pi.dev-src/pi-mono/coding-agent/test/footer-data-provider.test.ts +0 -265
- package/pi.dev-src/pi-mono/coding-agent/test/footer-width.test.ts +0 -115
- package/pi.dev-src/pi-mono/coding-agent/test/frontmatter.test.ts +0 -60
- package/pi.dev-src/pi-mono/coding-agent/test/git-ssh-url.test.ts +0 -78
- package/pi.dev-src/pi-mono/coding-agent/test/git-update.test.ts +0 -411
- package/pi.dev-src/pi-mono/coding-agent/test/image-processing.test.ts +0 -145
- package/pi.dev-src/pi-mono/coding-agent/test/image-resize-callers.test.ts +0 -53
- package/pi.dev-src/pi-mono/coding-agent/test/initial-message.test.ts +0 -48
- package/pi.dev-src/pi-mono/coding-agent/test/interactive-mode-anthropic-warning.test.ts +0 -73
- package/pi.dev-src/pi-mono/coding-agent/test/interactive-mode-clone-command.test.ts +0 -77
- package/pi.dev-src/pi-mono/coding-agent/test/interactive-mode-compaction.test.ts +0 -57
- package/pi.dev-src/pi-mono/coding-agent/test/interactive-mode-import-command.test.ts +0 -144
- package/pi.dev-src/pi-mono/coding-agent/test/interactive-mode-status.test.ts +0 -635
- package/pi.dev-src/pi-mono/coding-agent/test/interactive-mode-suspend.test.ts +0 -149
- package/pi.dev-src/pi-mono/coding-agent/test/keybindings-migration.test.ts +0 -88
- package/pi.dev-src/pi-mono/coding-agent/test/model-registry.test.ts +0 -1209
- package/pi.dev-src/pi-mono/coding-agent/test/model-resolver.test.ts +0 -436
- package/pi.dev-src/pi-mono/coding-agent/test/package-command-paths.test.ts +0 -144
- package/pi.dev-src/pi-mono/coding-agent/test/package-manager-ssh.test.ts +0 -97
- package/pi.dev-src/pi-mono/coding-agent/test/package-manager.test.ts +0 -1795
- package/pi.dev-src/pi-mono/coding-agent/test/path-utils.test.ts +0 -162
- package/pi.dev-src/pi-mono/coding-agent/test/plan-mode-utils.test.ts +0 -261
- package/pi.dev-src/pi-mono/coding-agent/test/print-mode.test.ts +0 -140
- package/pi.dev-src/pi-mono/coding-agent/test/prompt-templates.test.ts +0 -515
- package/pi.dev-src/pi-mono/coding-agent/test/resource-loader.test.ts +0 -576
- package/pi.dev-src/pi-mono/coding-agent/test/rpc-client-clone.test.ts +0 -29
- package/pi.dev-src/pi-mono/coding-agent/test/rpc-example.ts +0 -86
- package/pi.dev-src/pi-mono/coding-agent/test/rpc-jsonl.test.ts +0 -65
- package/pi.dev-src/pi-mono/coding-agent/test/rpc-prompt-response-semantics.test.ts +0 -285
- package/pi.dev-src/pi-mono/coding-agent/test/rpc.test.ts +0 -321
- package/pi.dev-src/pi-mono/coding-agent/test/sdk-codex-cache-probe-tool-loop.ts +0 -364
- package/pi.dev-src/pi-mono/coding-agent/test/sdk-openrouter-attribution.test.ts +0 -181
- package/pi.dev-src/pi-mono/coding-agent/test/sdk-session-manager.test.ts +0 -95
- package/pi.dev-src/pi-mono/coding-agent/test/sdk-skills.test.ts +0 -109
- package/pi.dev-src/pi-mono/coding-agent/test/session-cwd.test.ts +0 -91
- package/pi.dev-src/pi-mono/coding-agent/test/session-info-modified-timestamp.test.ts +0 -83
- package/pi.dev-src/pi-mono/coding-agent/test/session-manager/build-context.test.ts +0 -268
- package/pi.dev-src/pi-mono/coding-agent/test/session-manager/custom-session-id.test.ts +0 -109
- package/pi.dev-src/pi-mono/coding-agent/test/session-manager/file-operations.test.ts +0 -208
- package/pi.dev-src/pi-mono/coding-agent/test/session-manager/labels.test.ts +0 -198
- package/pi.dev-src/pi-mono/coding-agent/test/session-manager/migration.test.ts +0 -78
- package/pi.dev-src/pi-mono/coding-agent/test/session-manager/save-entry.test.ts +0 -55
- package/pi.dev-src/pi-mono/coding-agent/test/session-manager/tree-traversal.test.ts +0 -533
- package/pi.dev-src/pi-mono/coding-agent/test/session-selector-path-delete.test.ts +0 -315
- package/pi.dev-src/pi-mono/coding-agent/test/session-selector-rename.test.ts +0 -111
- package/pi.dev-src/pi-mono/coding-agent/test/session-selector-search.test.ts +0 -195
- package/pi.dev-src/pi-mono/coding-agent/test/settings-manager-bug.test.ts +0 -147
- package/pi.dev-src/pi-mono/coding-agent/test/settings-manager.test.ts +0 -319
- package/pi.dev-src/pi-mono/coding-agent/test/skills.test.ts +0 -432
- package/pi.dev-src/pi-mono/coding-agent/test/stdout-cleanliness.test.ts +0 -103
- package/pi.dev-src/pi-mono/coding-agent/test/streaming-render-debug.ts +0 -97
- package/pi.dev-src/pi-mono/coding-agent/test/suite/agent-session-bash-persistence.test.ts +0 -242
- package/pi.dev-src/pi-mono/coding-agent/test/suite/agent-session-compaction.test.ts +0 -343
- package/pi.dev-src/pi-mono/coding-agent/test/suite/agent-session-model-extension.test.ts +0 -325
- package/pi.dev-src/pi-mono/coding-agent/test/suite/agent-session-prompt.test.ts +0 -323
- package/pi.dev-src/pi-mono/coding-agent/test/suite/agent-session-queue.test.ts +0 -422
- package/pi.dev-src/pi-mono/coding-agent/test/suite/agent-session-retry-events.test.ts +0 -358
- package/pi.dev-src/pi-mono/coding-agent/test/suite/agent-session-runtime.test.ts +0 -553
- package/pi.dev-src/pi-mono/coding-agent/test/suite/harness.ts +0 -208
- package/pi.dev-src/pi-mono/coding-agent/test/suite/regressions/2023-queued-slash-command-followup.test.ts +0 -80
- package/pi.dev-src/pi-mono/coding-agent/test/suite/regressions/2753-reload-stale-resource-settings.test.ts +0 -100
- package/pi.dev-src/pi-mono/coding-agent/test/suite/regressions/2781-skill-collision-precedence.test.ts +0 -120
- package/pi.dev-src/pi-mono/coding-agent/test/suite/regressions/2791-fswatch-error-crash.test.ts +0 -106
- package/pi.dev-src/pi-mono/coding-agent/test/suite/regressions/2835-tools-allowlist-filters-extension-tools.test.ts +0 -94
- package/pi.dev-src/pi-mono/coding-agent/test/suite/regressions/2860-replaced-session-context.test.ts +0 -274
- package/pi.dev-src/pi-mono/coding-agent/test/suite/regressions/3217-scoped-model-order.test.ts +0 -104
- package/pi.dev-src/pi-mono/coding-agent/test/suite/regressions/3302-find-path-glob.test.ts +0 -72
- package/pi.dev-src/pi-mono/coding-agent/test/suite/regressions/3303-find-nested-gitignore.test.ts +0 -83
- package/pi.dev-src/pi-mono/coding-agent/test/suite/regressions/3317-network-connection-lost-retry.test.ts +0 -33
- package/pi.dev-src/pi-mono/coding-agent/test/system-prompt.test.ts +0 -102
- package/pi.dev-src/pi-mono/coding-agent/test/test-harness.test.ts +0 -321
- package/pi.dev-src/pi-mono/coding-agent/test/test-harness.ts +0 -446
- package/pi.dev-src/pi-mono/coding-agent/test/test-theme-colors.ts +0 -246
- package/pi.dev-src/pi-mono/coding-agent/test/theme-export.test.ts +0 -104
- package/pi.dev-src/pi-mono/coding-agent/test/tool-execution-component.test.ts +0 -331
- package/pi.dev-src/pi-mono/coding-agent/test/tools.test.ts +0 -889
- package/pi.dev-src/pi-mono/coding-agent/test/tree-selector.test.ts +0 -655
- package/pi.dev-src/pi-mono/coding-agent/test/trigger-compact-extension.test.ts +0 -57
- package/pi.dev-src/pi-mono/coding-agent/test/truncate-to-width.test.ts +0 -81
- package/pi.dev-src/pi-mono/coding-agent/test/user-message.test.ts +0 -25
- package/pi.dev-src/pi-mono/coding-agent/test/utilities.ts +0 -316
- package/pi.dev-src/pi-mono/coding-agent/tsconfig.examples.json +0 -16
- package/pi.dev-src/pi-mono/coding-agent/vitest.config.ts +0 -26
- package/pi.dev-src/pi-mono/mom/dev.sh +0 -30
- package/pi.dev-src/pi-mono/mom/docker.sh +0 -95
- package/pi.dev-src/pi-mono/mom/scripts/migrate-timestamps.ts +0 -121
- package/pi.dev-src/pi-mono/mom/src/agent.ts +0 -882
- package/pi.dev-src/pi-mono/mom/src/context.ts +0 -180
- package/pi.dev-src/pi-mono/mom/src/download.ts +0 -117
- package/pi.dev-src/pi-mono/mom/src/events.ts +0 -442
- package/pi.dev-src/pi-mono/mom/src/fs-watch.ts +0 -30
- package/pi.dev-src/pi-mono/mom/src/log.ts +0 -271
- package/pi.dev-src/pi-mono/mom/src/main.ts +0 -367
- package/pi.dev-src/pi-mono/mom/src/sandbox.ts +0 -221
- package/pi.dev-src/pi-mono/mom/src/slack.ts +0 -623
- package/pi.dev-src/pi-mono/mom/src/store.ts +0 -234
- package/pi.dev-src/pi-mono/mom/src/tools/attach.ts +0 -47
- package/pi.dev-src/pi-mono/mom/src/tools/bash.ts +0 -97
- package/pi.dev-src/pi-mono/mom/src/tools/edit.ts +0 -165
- package/pi.dev-src/pi-mono/mom/src/tools/index.ts +0 -19
- package/pi.dev-src/pi-mono/mom/src/tools/read.ts +0 -159
- package/pi.dev-src/pi-mono/mom/src/tools/truncate.ts +0 -236
- package/pi.dev-src/pi-mono/mom/src/tools/write.ts +0 -45
- package/pi.dev-src/pi-mono/mom/test/events.test.ts +0 -50
- package/pi.dev-src/pi-mono/pods/scripts/model_run.sh +0 -83
- package/pi.dev-src/pi-mono/pods/scripts/pod_setup.sh +0 -336
- package/pi.dev-src/pi-mono/pods/src/cli.ts +0 -360
- package/pi.dev-src/pi-mono/pods/src/commands/models.ts +0 -753
- package/pi.dev-src/pi-mono/pods/src/commands/pods.ts +0 -205
- package/pi.dev-src/pi-mono/pods/src/commands/prompt.ts +0 -84
- package/pi.dev-src/pi-mono/pods/src/config.ts +0 -80
- package/pi.dev-src/pi-mono/pods/src/index.ts +0 -2
- package/pi.dev-src/pi-mono/pods/src/model-configs.ts +0 -111
- package/pi.dev-src/pi-mono/pods/src/models.json +0 -295
- package/pi.dev-src/pi-mono/pods/src/ssh.ts +0 -151
- package/pi.dev-src/pi-mono/pods/src/types.ts +0 -27
- package/pi.dev-src/pi-mono/tui/src/autocomplete.ts +0 -783
- package/pi.dev-src/pi-mono/tui/src/components/box.ts +0 -137
- package/pi.dev-src/pi-mono/tui/src/components/cancellable-loader.ts +0 -40
- package/pi.dev-src/pi-mono/tui/src/components/editor.ts +0 -2280
- package/pi.dev-src/pi-mono/tui/src/components/image.ts +0 -104
- package/pi.dev-src/pi-mono/tui/src/components/input.ts +0 -503
- package/pi.dev-src/pi-mono/tui/src/components/loader.ts +0 -86
- package/pi.dev-src/pi-mono/tui/src/components/markdown.ts +0 -852
- package/pi.dev-src/pi-mono/tui/src/components/select-list.ts +0 -229
- package/pi.dev-src/pi-mono/tui/src/components/settings-list.ts +0 -250
- package/pi.dev-src/pi-mono/tui/src/components/spacer.ts +0 -28
- package/pi.dev-src/pi-mono/tui/src/components/text.ts +0 -106
- package/pi.dev-src/pi-mono/tui/src/components/truncated-text.ts +0 -65
- package/pi.dev-src/pi-mono/tui/src/editor-component.ts +0 -74
- package/pi.dev-src/pi-mono/tui/src/fuzzy.ts +0 -133
- package/pi.dev-src/pi-mono/tui/src/index.ts +0 -106
- package/pi.dev-src/pi-mono/tui/src/keybindings.ts +0 -244
- package/pi.dev-src/pi-mono/tui/src/keys.ts +0 -1400
- package/pi.dev-src/pi-mono/tui/src/kill-ring.ts +0 -46
- package/pi.dev-src/pi-mono/tui/src/stdin-buffer.ts +0 -386
- package/pi.dev-src/pi-mono/tui/src/terminal-image.ts +0 -414
- package/pi.dev-src/pi-mono/tui/src/terminal.ts +0 -373
- package/pi.dev-src/pi-mono/tui/src/tui.ts +0 -1243
- package/pi.dev-src/pi-mono/tui/src/undo-stack.ts +0 -28
- package/pi.dev-src/pi-mono/tui/src/utils.ts +0 -1085
- package/pi.dev-src/pi-mono/tui/test/autocomplete.test.ts +0 -542
- package/pi.dev-src/pi-mono/tui/test/bug-regression-isimageline-startswith-bug.test.ts +0 -237
- package/pi.dev-src/pi-mono/tui/test/chat-simple.ts +0 -129
- package/pi.dev-src/pi-mono/tui/test/editor.test.ts +0 -3812
- package/pi.dev-src/pi-mono/tui/test/fuzzy.test.ts +0 -98
- package/pi.dev-src/pi-mono/tui/test/image-test.ts +0 -56
- package/pi.dev-src/pi-mono/tui/test/input.test.ts +0 -580
- package/pi.dev-src/pi-mono/tui/test/key-tester.ts +0 -105
- package/pi.dev-src/pi-mono/tui/test/keybindings.test.ts +0 -38
- package/pi.dev-src/pi-mono/tui/test/keys.test.ts +0 -614
- package/pi.dev-src/pi-mono/tui/test/markdown.test.ts +0 -1236
- package/pi.dev-src/pi-mono/tui/test/overlay-non-capturing.test.ts +0 -609
- package/pi.dev-src/pi-mono/tui/test/overlay-options.test.ts +0 -538
- package/pi.dev-src/pi-mono/tui/test/overlay-short-content.test.ts +0 -56
- package/pi.dev-src/pi-mono/tui/test/regression-regional-indicator-width.test.ts +0 -52
- package/pi.dev-src/pi-mono/tui/test/select-list.test.ts +0 -116
- package/pi.dev-src/pi-mono/tui/test/stdin-buffer.test.ts +0 -422
- package/pi.dev-src/pi-mono/tui/test/terminal-image.test.ts +0 -279
- package/pi.dev-src/pi-mono/tui/test/test-themes.ts +0 -38
- package/pi.dev-src/pi-mono/tui/test/truncate-to-width.test.ts +0 -62
- package/pi.dev-src/pi-mono/tui/test/truncated-text.test.ts +0 -129
- package/pi.dev-src/pi-mono/tui/test/tui-cell-size-input.test.ts +0 -81
- package/pi.dev-src/pi-mono/tui/test/tui-overlay-style-leak.test.ts +0 -72
- package/pi.dev-src/pi-mono/tui/test/tui-render.test.ts +0 -509
- package/pi.dev-src/pi-mono/tui/test/viewport-overwrite-repro.ts +0 -106
- package/pi.dev-src/pi-mono/tui/test/virtual-terminal.ts +0 -218
- package/pi.dev-src/pi-mono/tui/test/wrap-ansi.test.ts +0 -207
- package/pi.dev-src/pi-mono/tui/vitest.config.ts +0 -7
- package/pi.dev-src/pi-mono/web-ui/example/index.html +0 -13
- package/pi.dev-src/pi-mono/web-ui/example/src/app.css +0 -1
- package/pi.dev-src/pi-mono/web-ui/example/src/custom-messages.ts +0 -99
- package/pi.dev-src/pi-mono/web-ui/example/src/main.ts +0 -421
- package/pi.dev-src/pi-mono/web-ui/example/tsconfig.json +0 -23
- package/pi.dev-src/pi-mono/web-ui/example/vite.config.ts +0 -6
- package/pi.dev-src/pi-mono/web-ui/scripts/count-prompt-tokens.ts +0 -88
- package/pi.dev-src/pi-mono/web-ui/src/ChatPanel.ts +0 -209
- package/pi.dev-src/pi-mono/web-ui/src/app.css +0 -68
- package/pi.dev-src/pi-mono/web-ui/src/components/AgentInterface.ts +0 -403
- package/pi.dev-src/pi-mono/web-ui/src/components/AttachmentTile.ts +0 -107
- package/pi.dev-src/pi-mono/web-ui/src/components/ConsoleBlock.ts +0 -72
- package/pi.dev-src/pi-mono/web-ui/src/components/CustomProviderCard.ts +0 -100
- package/pi.dev-src/pi-mono/web-ui/src/components/ExpandableSection.ts +0 -46
- package/pi.dev-src/pi-mono/web-ui/src/components/Input.ts +0 -113
- package/pi.dev-src/pi-mono/web-ui/src/components/MessageEditor.ts +0 -405
- package/pi.dev-src/pi-mono/web-ui/src/components/MessageList.ts +0 -98
- package/pi.dev-src/pi-mono/web-ui/src/components/Messages.ts +0 -383
- package/pi.dev-src/pi-mono/web-ui/src/components/ProviderKeyInput.ts +0 -153
- package/pi.dev-src/pi-mono/web-ui/src/components/SandboxedIframe.ts +0 -626
- package/pi.dev-src/pi-mono/web-ui/src/components/StreamingMessageContainer.ts +0 -103
- package/pi.dev-src/pi-mono/web-ui/src/components/ThinkingBlock.ts +0 -43
- package/pi.dev-src/pi-mono/web-ui/src/components/message-renderer-registry.ts +0 -28
- package/pi.dev-src/pi-mono/web-ui/src/components/sandbox/ArtifactsRuntimeProvider.ts +0 -220
- package/pi.dev-src/pi-mono/web-ui/src/components/sandbox/AttachmentsRuntimeProvider.ts +0 -66
- package/pi.dev-src/pi-mono/web-ui/src/components/sandbox/ConsoleRuntimeProvider.ts +0 -186
- package/pi.dev-src/pi-mono/web-ui/src/components/sandbox/FileDownloadRuntimeProvider.ts +0 -110
- package/pi.dev-src/pi-mono/web-ui/src/components/sandbox/RuntimeMessageBridge.ts +0 -82
- package/pi.dev-src/pi-mono/web-ui/src/components/sandbox/RuntimeMessageRouter.ts +0 -216
- package/pi.dev-src/pi-mono/web-ui/src/components/sandbox/SandboxRuntimeProvider.ts +0 -52
- package/pi.dev-src/pi-mono/web-ui/src/dialogs/ApiKeyPromptDialog.ts +0 -75
- package/pi.dev-src/pi-mono/web-ui/src/dialogs/AttachmentOverlay.ts +0 -636
- package/pi.dev-src/pi-mono/web-ui/src/dialogs/CustomProviderDialog.ts +0 -274
- package/pi.dev-src/pi-mono/web-ui/src/dialogs/ModelSelector.ts +0 -370
- package/pi.dev-src/pi-mono/web-ui/src/dialogs/PersistentStorageDialog.ts +0 -144
- package/pi.dev-src/pi-mono/web-ui/src/dialogs/ProvidersModelsTab.ts +0 -212
- package/pi.dev-src/pi-mono/web-ui/src/dialogs/SessionListDialog.ts +0 -150
- package/pi.dev-src/pi-mono/web-ui/src/dialogs/SettingsDialog.ts +0 -218
- package/pi.dev-src/pi-mono/web-ui/src/index.ts +0 -120
- package/pi.dev-src/pi-mono/web-ui/src/prompts/prompts.ts +0 -282
- package/pi.dev-src/pi-mono/web-ui/src/storage/app-storage.ts +0 -60
- package/pi.dev-src/pi-mono/web-ui/src/storage/backends/indexeddb-storage-backend.ts +0 -193
- package/pi.dev-src/pi-mono/web-ui/src/storage/store.ts +0 -33
- package/pi.dev-src/pi-mono/web-ui/src/storage/stores/custom-providers-store.ts +0 -62
- package/pi.dev-src/pi-mono/web-ui/src/storage/stores/provider-keys-store.ts +0 -33
- package/pi.dev-src/pi-mono/web-ui/src/storage/stores/sessions-store.ts +0 -136
- package/pi.dev-src/pi-mono/web-ui/src/storage/stores/settings-store.ts +0 -34
- package/pi.dev-src/pi-mono/web-ui/src/storage/types.ts +0 -206
- package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/ArtifactElement.ts +0 -14
- package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/ArtifactPill.ts +0 -26
- package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/Console.ts +0 -93
- package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/DocxArtifact.ts +0 -213
- package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/ExcelArtifact.ts +0 -231
- package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/GenericArtifact.ts +0 -117
- package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/HtmlArtifact.ts +0 -195
- package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/ImageArtifact.ts +0 -116
- package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/MarkdownArtifact.ts +0 -82
- package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/PdfArtifact.ts +0 -201
- package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/SvgArtifact.ts +0 -119
- package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/TextArtifact.ts +0 -148
- package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/artifacts-tool-renderer.ts +0 -310
- package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/artifacts.ts +0 -713
- package/pi.dev-src/pi-mono/web-ui/src/tools/artifacts/index.ts +0 -7
- package/pi.dev-src/pi-mono/web-ui/src/tools/extract-document.ts +0 -275
- package/pi.dev-src/pi-mono/web-ui/src/tools/index.ts +0 -46
- package/pi.dev-src/pi-mono/web-ui/src/tools/javascript-repl.ts +0 -293
- package/pi.dev-src/pi-mono/web-ui/src/tools/renderer-registry.ts +0 -130
- package/pi.dev-src/pi-mono/web-ui/src/tools/renderers/BashRenderer.ts +0 -52
- package/pi.dev-src/pi-mono/web-ui/src/tools/renderers/CalculateRenderer.ts +0 -58
- package/pi.dev-src/pi-mono/web-ui/src/tools/renderers/DefaultRenderer.ts +0 -103
- package/pi.dev-src/pi-mono/web-ui/src/tools/renderers/GetCurrentTimeRenderer.ts +0 -92
- package/pi.dev-src/pi-mono/web-ui/src/tools/types.ts +0 -15
- package/pi.dev-src/pi-mono/web-ui/src/utils/attachment-utils.ts +0 -472
- package/pi.dev-src/pi-mono/web-ui/src/utils/auth-token.ts +0 -22
- package/pi.dev-src/pi-mono/web-ui/src/utils/format.ts +0 -42
- package/pi.dev-src/pi-mono/web-ui/src/utils/i18n.ts +0 -653
- package/pi.dev-src/pi-mono/web-ui/src/utils/model-discovery.ts +0 -277
- package/pi.dev-src/pi-mono/web-ui/src/utils/proxy-utils.ts +0 -139
- package/pi.dev-src/pi-mono/web-ui/src/utils/test-sessions.ts +0 -2357
- package/pi.dev-src/pi-mono/web-ui/tsconfig.json +0 -7
- package/tests/attended-results-scenarios.ts +0 -648
- package/tests/attended-results.test.ts +0 -39
- package/tests/cli-command-option-parity.test.ts +0 -798
- package/tests/debug-extension-harness.test.ts +0 -466
- package/tests/extension-registration.test.ts +0 -6785
- package/tests/fixtures/fixture_c.c +0 -361
- package/tests/fixtures/fixture_cpp.cpp +0 -407
- package/tests/fixtures/fixture_csharp.cs +0 -411
- package/tests/fixtures/fixture_elixir.ex +0 -409
- package/tests/fixtures/fixture_go.go +0 -341
- package/tests/fixtures/fixture_haskell.hs +0 -250
- package/tests/fixtures/fixture_java.java +0 -430
- package/tests/fixtures/fixture_javascript.js +0 -383
- package/tests/fixtures/fixture_kotlin.kt +0 -451
- package/tests/fixtures/fixture_lua.lua +0 -276
- package/tests/fixtures/fixture_perl.pl +0 -310
- package/tests/fixtures/fixture_php.php +0 -433
- package/tests/fixtures/fixture_python.py +0 -502
- package/tests/fixtures/fixture_ruby.rb +0 -345
- package/tests/fixtures/fixture_rust.rs +0 -380
- package/tests/fixtures/fixture_scala.scala +0 -398
- package/tests/fixtures/fixture_shell.sh +0 -276
- package/tests/fixtures/fixture_swift.swift +0 -397
- package/tests/fixtures/fixture_typescript.ts +0 -434
- package/tests/fixtures/fixture_zig.zig +0 -295
- package/tests/fixtures_attended_results/project/compress-line-numbers.json +0 -5
- package/tests/fixtures_attended_results/project/compress.json +0 -5
- package/tests/fixtures_attended_results/project/enable-static-check-invalid-command.json +0 -5
- package/tests/fixtures_attended_results/project/enable-static-check-valid.json +0 -5
- package/tests/fixtures_attended_results/project/files-static-check.json +0 -5
- package/tests/fixtures_attended_results/project/find-line-numbers.json +0 -5
- package/tests/fixtures_attended_results/project/find.json +0 -5
- package/tests/fixtures_attended_results/project/get-base-path.json +0 -5
- package/tests/fixtures_attended_results/project/git-check-clean.json +0 -5
- package/tests/fixtures_attended_results/project/git-check-dirty.json +0 -5
- package/tests/fixtures_attended_results/project/git-path.json +0 -5
- package/tests/fixtures_attended_results/project/git-wt-create-invalid.json +0 -5
- package/tests/fixtures_attended_results/project/git-wt-create-valid.json +0 -5
- package/tests/fixtures_attended_results/project/git-wt-delete-nonexistent.json +0 -5
- package/tests/fixtures_attended_results/project/git-wt-delete-valid.json +0 -5
- package/tests/fixtures_attended_results/project/git-wt-name.json +0 -5
- package/tests/fixtures_attended_results/project/static-check.json +0 -5
- package/tests/fixtures_attended_results/project/summarize.json +0 -5
- package/tests/fixtures_attended_results/project/tokens.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress/fixture_c.c.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress/fixture_cpp.cpp.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress/fixture_csharp.cs.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress/fixture_elixir.ex.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress/fixture_go.go.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress/fixture_haskell.hs.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress/fixture_java.java.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress/fixture_javascript.js.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress/fixture_kotlin.kt.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress/fixture_lua.lua.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress/fixture_perl.pl.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress/fixture_php.php.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress/fixture_python.py.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress/fixture_ruby.rb.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress/fixture_rust.rs.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress/fixture_scala.scala.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress/fixture_shell.sh.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress/fixture_swift.swift.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress/fixture_typescript.ts.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress/fixture_zig.zig.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_c.c.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_cpp.cpp.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_csharp.cs.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_elixir.ex.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_go.go.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_haskell.hs.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_java.java.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_javascript.js.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_kotlin.kt.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_lua.lua.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_perl.pl.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_php.php.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_python.py.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_ruby.rb.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_rust.rs.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_scala.scala.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_shell.sh.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_swift.swift.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_typescript.ts.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-compress-line-numbers/fixture_zig.zig.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find/fixture_c.c.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find/fixture_cpp.cpp.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find/fixture_csharp.cs.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find/fixture_elixir.ex.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find/fixture_go.go.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find/fixture_haskell.hs.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find/fixture_java.java.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find/fixture_javascript.js.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find/fixture_kotlin.kt.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find/fixture_lua.lua.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find/fixture_perl.pl.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find/fixture_php.php.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find/fixture_python.py.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find/fixture_ruby.rb.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find/fixture_rust.rs.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find/fixture_scala.scala.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find/fixture_shell.sh.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find/fixture_swift.swift.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find/fixture_typescript.ts.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find/fixture_zig.zig.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_c.c.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_cpp.cpp.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_csharp.cs.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_elixir.ex.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_go.go.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_haskell.hs.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_java.java.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_javascript.js.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_kotlin.kt.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_lua.lua.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_perl.pl.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_php.php.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_python.py.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_ruby.rb.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_rust.rs.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_scala.scala.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_shell.sh.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_swift.swift.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_typescript.ts.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-find-line-numbers/fixture_zig.zig.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-summarize/fixture_c.c.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-summarize/fixture_cpp.cpp.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-summarize/fixture_csharp.cs.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-summarize/fixture_elixir.ex.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-summarize/fixture_go.go.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-summarize/fixture_haskell.hs.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-summarize/fixture_java.java.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-summarize/fixture_javascript.js.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-summarize/fixture_kotlin.kt.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-summarize/fixture_lua.lua.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-summarize/fixture_perl.pl.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-summarize/fixture_php.php.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-summarize/fixture_python.py.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-summarize/fixture_ruby.rb.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-summarize/fixture_rust.rs.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-summarize/fixture_scala.scala.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-summarize/fixture_shell.sh.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-summarize/fixture_swift.swift.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-summarize/fixture_typescript.ts.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-summarize/fixture_zig.zig.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-tokens/fixture_c.c.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-tokens/fixture_cpp.cpp.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-tokens/fixture_csharp.cs.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-tokens/fixture_elixir.ex.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-tokens/fixture_go.go.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-tokens/fixture_haskell.hs.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-tokens/fixture_java.java.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-tokens/fixture_javascript.js.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-tokens/fixture_kotlin.kt.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-tokens/fixture_lua.lua.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-tokens/fixture_perl.pl.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-tokens/fixture_php.php.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-tokens/fixture_python.py.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-tokens/fixture_ruby.rb.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-tokens/fixture_rust.rs.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-tokens/fixture_scala.scala.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-tokens/fixture_shell.sh.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-tokens/fixture_swift.swift.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-tokens/fixture_typescript.ts.json +0 -5
- package/tests/fixtures_attended_results/standalone/files-tokens/fixture_zig.zig.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-command/fixture_c.c.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-command/fixture_cpp.cpp.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-command/fixture_csharp.cs.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-command/fixture_elixir.ex.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-command/fixture_go.go.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-command/fixture_haskell.hs.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-command/fixture_java.java.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-command/fixture_javascript.js.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-command/fixture_kotlin.kt.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-command/fixture_lua.lua.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-command/fixture_perl.pl.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-command/fixture_php.php.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-command/fixture_python.py.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-command/fixture_ruby.rb.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-command/fixture_rust.rs.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-command/fixture_scala.scala.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-command/fixture_shell.sh.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-command/fixture_swift.swift.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-command/fixture_typescript.ts.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-command/fixture_zig.zig.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-dummy/fixture_c.c.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-dummy/fixture_cpp.cpp.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-dummy/fixture_csharp.cs.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-dummy/fixture_elixir.ex.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-dummy/fixture_go.go.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-dummy/fixture_haskell.hs.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-dummy/fixture_java.java.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-dummy/fixture_javascript.js.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-dummy/fixture_kotlin.kt.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-dummy/fixture_lua.lua.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-dummy/fixture_perl.pl.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-dummy/fixture_php.php.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-dummy/fixture_python.py.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-dummy/fixture_ruby.rb.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-dummy/fixture_rust.rs.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-dummy/fixture_scala.scala.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-dummy/fixture_shell.sh.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-dummy/fixture_swift.swift.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-dummy/fixture_typescript.ts.json +0 -5
- package/tests/fixtures_attended_results/standalone/test-static-check-dummy/fixture_zig.zig.json +0 -5
- package/tests/helpers.ts +0 -236
- package/tests/oracle-project.test.ts +0 -67
- package/tests/oracle-standalone.test.ts +0 -68
- package/tests/prompt-command-summary.test.ts +0 -36
- package/tests/prompt-rendering.test.ts +0 -103
- package/tests/python_oracle_stubs/tiktoken.py +0 -76
- package/tests/release-workflow.test.ts +0 -195
- package/tests/static-check-bundled.test.ts +0 -332
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
/// @file fixture_zig.zig
|
|
2
|
-
/// @brief Comprehensive Zig test fixture for parser validation.
|
|
3
|
-
/// @details Covers comptime, error unions, optional types, inline loops,
|
|
4
|
-
/// packed structs, extern unions, test blocks, errdefer,
|
|
5
|
-
/// alignment, vectors, and builtins.
|
|
6
|
-
// Single line comment
|
|
7
|
-
const std = @import("std");
|
|
8
|
-
const mem = @import("std").mem;
|
|
9
|
-
const Allocator = std.mem.Allocator;
|
|
10
|
-
|
|
11
|
-
// ── Functions ────────────────────────────────────────────────────────
|
|
12
|
-
|
|
13
|
-
/// Application entry point; prints a hello message.
|
|
14
|
-
pub fn main() void {
|
|
15
|
-
std.debug.print("Hello\n", .{});
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/// Add two signed integers and return the sum.
|
|
19
|
-
/// @param a First operand.
|
|
20
|
-
/// @param b Second operand.
|
|
21
|
-
/// @return Sum of a and b.
|
|
22
|
-
pub fn add(a: i32, b: i32) i32 {
|
|
23
|
-
return a + b;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/// Divide two integers with error handling for division by zero.
|
|
27
|
-
/// @param numerator The dividend.
|
|
28
|
-
/// @param denominator The divisor; must not be zero.
|
|
29
|
-
/// @return Quotient or error.DivisionByZero.
|
|
30
|
-
pub fn safeDivide(numerator: i32, denominator: i32) !i32 {
|
|
31
|
-
if (denominator == 0) {
|
|
32
|
-
return error.DivisionByZero;
|
|
33
|
-
}
|
|
34
|
-
return @divTrunc(numerator, denominator);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/// Generic function computing the maximum of two comparable values.
|
|
38
|
-
/// @param T The element type (comptime resolved).
|
|
39
|
-
/// @param a First value.
|
|
40
|
-
/// @param b Second value.
|
|
41
|
-
/// @return The larger of a and b.
|
|
42
|
-
pub fn max(comptime T: type, a: T, b: T) T {
|
|
43
|
-
return if (a > b) a else b;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/// Generic linear search returning the index of a target value.
|
|
47
|
-
/// @param T Element type.
|
|
48
|
-
/// @param haystack Slice to search.
|
|
49
|
-
/// @param needle Value to find.
|
|
50
|
-
/// @return Index of needle or null if not found.
|
|
51
|
-
pub fn indexOf(comptime T: type, haystack: []const T, needle: T) ?usize {
|
|
52
|
-
for (haystack, 0..) |item, i| {
|
|
53
|
-
if (item == needle) {
|
|
54
|
-
return i;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
// Not found — return null optional
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/// Perform a comptime string concatenation.
|
|
62
|
-
/// @param a First string literal.
|
|
63
|
-
/// @param b Second string literal.
|
|
64
|
-
/// @return Concatenated string at compile time.
|
|
65
|
-
pub fn comptimeConcat(comptime a: []const u8, comptime b: []const u8) []const u8 {
|
|
66
|
-
return a ++ b;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/// Function with errdefer for resource cleanup on error paths.
|
|
70
|
-
/// @param allocator Memory allocator for buffer creation.
|
|
71
|
-
/// @return Allocated buffer or error.
|
|
72
|
-
pub fn createBuffer(allocator: Allocator) ![]u8 {
|
|
73
|
-
const buf = try allocator.alloc(u8, 1024);
|
|
74
|
-
errdefer allocator.free(buf);
|
|
75
|
-
// Initialize buffer to zero
|
|
76
|
-
@memset(buf, 0);
|
|
77
|
-
return buf;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/// Inline function called in tight loops for vectorized operations.
|
|
81
|
-
/// @param values Slice of floats to sum.
|
|
82
|
-
/// @return Sum of all elements.
|
|
83
|
-
inline fn fastSum(values: []const f32) f32 {
|
|
84
|
-
var total: f32 = 0.0;
|
|
85
|
-
for (values) |v| {
|
|
86
|
-
total += v;
|
|
87
|
-
}
|
|
88
|
-
return total;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/// Extern C-ABI function for FFI interoperability.
|
|
92
|
-
/// @param x Value to double.
|
|
93
|
-
/// @return Input multiplied by two.
|
|
94
|
-
export fn doubleValue(x: i32) i32 {
|
|
95
|
-
return x * 2;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// ── Struct definitions ───────────────────────────────────────────────
|
|
99
|
-
|
|
100
|
-
/// 2D point with floating-point coordinates.
|
|
101
|
-
/// @brief Basic coordinate pair for geometric computations.
|
|
102
|
-
const Point = struct {
|
|
103
|
-
x: f64, /// Horizontal coordinate.
|
|
104
|
-
y: f64, /// Vertical coordinate.
|
|
105
|
-
|
|
106
|
-
/// Compute the squared distance to another point.
|
|
107
|
-
/// @param self This point.
|
|
108
|
-
/// @param other Target point.
|
|
109
|
-
/// @return Distance squared (avoids sqrt).
|
|
110
|
-
pub fn distSquared(self: Point, other: Point) f64 {
|
|
111
|
-
const dx = self.x - other.x;
|
|
112
|
-
const dy = self.y - other.y;
|
|
113
|
-
return dx * dx + dy * dy;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/// Create a point at the origin (0, 0).
|
|
117
|
-
/// @return A zero-initialized Point.
|
|
118
|
-
pub fn origin() Point {
|
|
119
|
-
return .{ .x = 0.0, .y = 0.0 };
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
/// Packed struct for hardware register mapping.
|
|
124
|
-
/// @brief Tests parser handling of packed layout specifier.
|
|
125
|
-
const PackedFlags = packed struct {
|
|
126
|
-
readable: bool, /// Read permission bit.
|
|
127
|
-
writable: bool, /// Write permission bit.
|
|
128
|
-
executable: bool, /// Execute permission bit.
|
|
129
|
-
reserved: u5, /// Reserved bits for alignment.
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
/// Configuration struct with defaults via comptime initialization.
|
|
133
|
-
const Config = struct {
|
|
134
|
-
name: []const u8 = "default", /// Configuration name.
|
|
135
|
-
max_retries: u32 = 3, /// Maximum retry attempts.
|
|
136
|
-
timeout_ms: u64 = 5000, /// Timeout in milliseconds.
|
|
137
|
-
debug: bool = false, /// Debug mode toggle.
|
|
138
|
-
|
|
139
|
-
/// Create a Config for testing with debug enabled.
|
|
140
|
-
/// @return Config with debug=true.
|
|
141
|
-
pub fn testing() Config {
|
|
142
|
-
return .{ .debug = true, .name = "test" };
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
// ── Enum definitions ─────────────────────────────────────────────────
|
|
147
|
-
|
|
148
|
-
/// Color enumeration for rendering pipeline.
|
|
149
|
-
const Color = enum {
|
|
150
|
-
red, /// Red channel.
|
|
151
|
-
green, /// Green channel.
|
|
152
|
-
blue, /// Blue channel.
|
|
153
|
-
|
|
154
|
-
/// Convert color to its RGB integer value.
|
|
155
|
-
/// @param self The color variant.
|
|
156
|
-
/// @return 24-bit RGB integer.
|
|
157
|
-
pub fn toRgb(self: Color) u32 {
|
|
158
|
-
return switch (self) {
|
|
159
|
-
.red => 0xFF0000,
|
|
160
|
-
.green => 0x00FF00,
|
|
161
|
-
.blue => 0x0000FF,
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
/// Status enum with explicit integer tags.
|
|
167
|
-
const Status = enum(u8) {
|
|
168
|
-
idle = 0, /// No operation in progress.
|
|
169
|
-
running = 1, /// Currently executing.
|
|
170
|
-
error = 2, /// Terminated with error.
|
|
171
|
-
done = 3, /// Completed successfully.
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
// ── Union definitions ────────────────────────────────────────────────
|
|
175
|
-
|
|
176
|
-
/// Tagged union for multi-type value storage.
|
|
177
|
-
const Result = union(enum) {
|
|
178
|
-
ok: i32, /// Success value.
|
|
179
|
-
err: []const u8, /// Error message string.
|
|
180
|
-
|
|
181
|
-
/// Check if the result represents success.
|
|
182
|
-
/// @param self The result to inspect.
|
|
183
|
-
/// @return True if variant is ok.
|
|
184
|
-
pub fn isOk(self: Result) bool {
|
|
185
|
-
return self == .ok;
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
/// Extern union for C-compatible memory layout.
|
|
190
|
-
const ExternData = extern union {
|
|
191
|
-
int_val: i32, /// Integer interpretation.
|
|
192
|
-
float_val: f32, /// Float interpretation.
|
|
193
|
-
bytes: [4]u8, /// Raw byte access.
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
// ── Constants and variables ──────────────────────────────────────────
|
|
197
|
-
|
|
198
|
-
/// @brief Maximum allocation size in bytes.
|
|
199
|
-
const MAX_SIZE: usize = 1024;
|
|
200
|
-
|
|
201
|
-
/// @brief Global mutable state counter.
|
|
202
|
-
pub var global_state: i32 = 0;
|
|
203
|
-
|
|
204
|
-
/// @brief Compile-time computed constant.
|
|
205
|
-
const MAGIC_NUMBER: u32 = comptime blk: {
|
|
206
|
-
var x: u32 = 1;
|
|
207
|
-
x *= 42;
|
|
208
|
-
break :blk x;
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
// ── Error set ────────────────────────────────────────────────────────
|
|
212
|
-
|
|
213
|
-
/// Custom error set for parsing operations.
|
|
214
|
-
const ParseError = error{
|
|
215
|
-
InvalidInput,
|
|
216
|
-
UnexpectedToken,
|
|
217
|
-
EndOfStream,
|
|
218
|
-
BufferOverflow,
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
// ── Test blocks ──────────────────────────────────────────────────────
|
|
222
|
-
|
|
223
|
-
/// Test that add function computes correctly.
|
|
224
|
-
test "add returns correct sum" {
|
|
225
|
-
const result = add(2, 3);
|
|
226
|
-
try std.testing.expectEqual(@as(i32, 5), result);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
/// Test that safeDivide returns error on zero divisor.
|
|
230
|
-
test "safeDivide handles zero" {
|
|
231
|
-
const result = safeDivide(10, 0);
|
|
232
|
-
try std.testing.expectError(error.DivisionByZero, result);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
/// Test that indexOf finds existing elements.
|
|
236
|
-
test "indexOf finds element" {
|
|
237
|
-
const items = [_]i32{ 1, 2, 3, 4, 5 };
|
|
238
|
-
const idx = indexOf(i32, &items, 3);
|
|
239
|
-
try std.testing.expectEqual(@as(?usize, 2), idx);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
// coverage extension block
|
|
243
|
-
const io = @import("std");
|
|
244
|
-
const fs = @import("std");
|
|
245
|
-
const mem = @import("std");
|
|
246
|
-
const math = @import("std");
|
|
247
|
-
const json = @import("std");
|
|
248
|
-
const Mode = enum { fast, safe };
|
|
249
|
-
const Phase = enum { init, done };
|
|
250
|
-
const Signal = enum { on, off };
|
|
251
|
-
const Packet = struct { id: i32 };
|
|
252
|
-
const Limits = struct { max: i32 };
|
|
253
|
-
const Variant = union { i: i32, f: f32 };
|
|
254
|
-
const Payload = extern union { a: i32, b: i32 };
|
|
255
|
-
const Message = union { txt: [4]u8, len: u32 };
|
|
256
|
-
var retries: i32 = 0;
|
|
257
|
-
var pointer: usize = 0;
|
|
258
|
-
|
|
259
|
-
// REQ-COVER-SRS-231 START
|
|
260
|
-
/// @REQ-COVER-SRS-231 block 1
|
|
261
|
-
/// @brief Coverage helper construct 1.
|
|
262
|
-
/// @details Provides deterministic fixture-level Doxygen coverage block 1.
|
|
263
|
-
/// @param value Input value for helper construct 1.
|
|
264
|
-
/// @return Output value for helper construct 1.
|
|
265
|
-
fn reqCoverZig1(value: i32) i32 { return value + 1; }
|
|
266
|
-
|
|
267
|
-
/// @REQ-COVER-SRS-231 block 2
|
|
268
|
-
/// @brief Coverage helper construct 2.
|
|
269
|
-
/// @details Provides deterministic fixture-level Doxygen coverage block 2.
|
|
270
|
-
/// @param value Input value for helper construct 2.
|
|
271
|
-
/// @return Output value for helper construct 2.
|
|
272
|
-
fn reqCoverZig2(value: i32) i32 { return value + 2; }
|
|
273
|
-
|
|
274
|
-
/// @REQ-COVER-SRS-231 block 3
|
|
275
|
-
/// @brief Coverage helper construct 3.
|
|
276
|
-
/// @details Provides deterministic fixture-level Doxygen coverage block 3.
|
|
277
|
-
/// @param value Input value for helper construct 3.
|
|
278
|
-
/// @return Output value for helper construct 3.
|
|
279
|
-
fn reqCoverZig3(value: i32) i32 { return value + 3; }
|
|
280
|
-
|
|
281
|
-
/// @REQ-COVER-SRS-231 block 4
|
|
282
|
-
/// @brief Coverage helper construct 4.
|
|
283
|
-
/// @details Provides deterministic fixture-level Doxygen coverage block 4.
|
|
284
|
-
/// @param value Input value for helper construct 4.
|
|
285
|
-
/// @return Output value for helper construct 4.
|
|
286
|
-
fn reqCoverZig4(value: i32) i32 { return value + 4; }
|
|
287
|
-
|
|
288
|
-
/// @REQ-COVER-SRS-231 block 5
|
|
289
|
-
/// @brief Coverage helper construct 5.
|
|
290
|
-
/// @details Provides deterministic fixture-level Doxygen coverage block 5.
|
|
291
|
-
/// @param value Input value for helper construct 5.
|
|
292
|
-
/// @return Output value for helper construct 5.
|
|
293
|
-
fn reqCoverZig5(value: i32) i32 { return value + 5; }
|
|
294
|
-
|
|
295
|
-
// REQ-COVER-SRS-231 END
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"code": 0,
|
|
3
|
-
"stdout": "@@@ src/fixture_c.c | c\n> Lines: 14-355\n```\n14: #include \"myheader.h\"\n15: #include <stdarg.h>\n16: #include <stdio.h>\n17: #include <stdlib.h>\n18: #include <string.h>\n22: #define MAX_SIZE 100\n31: #define CLAMP(val, lo, hi) ((val) < (lo) ? (lo) : ((val) > (hi) ? (hi) : (val)))\n34: #define STRINGIFY(x) #x\n40: #define CONCAT(a, b) a##b\n42: #ifdef DEBUG\n43: #define LOG(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)\n44: #else\n45: #define LOG(fmt, ...) ((void)0)\n46: #endif\n51: typedef int my_int;\n54: typedef unsigned char byte_t;\n62: struct Point {\n63: int x;\n64: int y;\n65: };\n71: struct PackedFlags {\n72: unsigned int readable : 1;\n73: unsigned int writable : 1;\n74: unsigned int executable : 1;\n75: unsigned int reserved : 5;\n76: };\n82: struct Node {\n84: union {\n85: int i_val;\n86: float f_val;\n87: } payload;\n88: struct Node *next;\n89: };\n97: union Data {\n98: int i;\n99: float f;\n100: char s[16];\n101: };\n109: enum Color {\n110: RED,\n111: GREEN,\n112: BLUE\n113: };\n124: typedef int (*comparator_fn)(const void *a, const void *b);\n130: typedef int (*transform_fn)(int value);\n138: typedef struct {\n139: const char *name;\n140: comparator_fn handler;\n141: int priority;\n142: } callback_entry_t;\n147: static int counter = 0;\n150: static char error_buffer[256] = {0};\n160: static inline int min_val(int a, int b) { return a < b ? a : b; }\n168: void greet(const char *name) {\n170: if (name == NULL) {\n171: return;\n172: }\n173: printf(\"Hello %s\\n\", name);\n174: }\n182: int main(int argc, char **argv) {\n183: if (argc < 2) {\n185: fprintf(stderr, \"Usage: %s <name>\\n\", argv[0]);\n186: return 1;\n187: }\n188: greet(argv[1]);\n189: return 0;\n190: }\n200: int sum_ints(int count, ...) {\n201: va_list ap;\n202: va_start(ap, count);\n203: int total = 0;\n205: for (int i = 0; i < count; i++) {\n206: total += va_arg(ap, int);\n207: }\n208: va_end(ap);\n209: return total;\n210: }\n220: void apply_transform(int *arr, size_t len, transform_fn fn) {\n221: for (size_t i = 0; i < len; i++) {\n223: arr[i] = fn(arr[i]);\n224: }\n225: }\n234: unsigned long factorial(unsigned int n) {\n236: if (n <= 1) {\n237: return 1;\n238: }\n240: return n * factorial(n - 1);\n241: }\n251: static void fast_copy(void *restrict dest, const void *restrict src, size_t n) {\n252: memcpy(dest, src, n);\n253: }\n260: static int read_volatile(volatile int *reg) { return *reg; }\n269: int sum_fixed(int arr[static 10]) {\n270: int s = 0;\n271: for (int i = 0; i < 10; i++) {\n272: s += arr[i];\n273: }\n274: return s;\n275: }\n278: struct Vector2 {\n279: int x;\n280: int y;\n281: };\n282: struct Matrix2 {\n283: int a11;\n284: int a22;\n285: };\n286: enum StatusCode { STATUS_OK, STATUS_ERR, STATUS_UNKNOWN };\n287: enum LevelCode { LEVEL_LOW, LEVEL_MEDIUM, LEVEL_HIGH };\n288: enum ModeCode { MODE_A, MODE_B };\n289: enum FlagCode { FLAG_ON, FLAG_OFF };\n290: union NumberValue {\n291: int i;\n292: float f;\n293: };\n294: union PtrValue {\n295: void *p;\n296: long l;\n297: };\n298: union StateValue {\n299: int s;\n300: char c;\n301: };\n302: union PairValue {\n303: int x;\n304: int y;\n305: };\n306: typedef long index_t;\n307: typedef float ratio_t;\n308: typedef struct Point point_t;\n309: typedef double score_t;\n319: int req_cover_c_1(int value) { return value + 1; }\n328: int req_cover_c_2(int value) { return value + 2; }\n337: int req_cover_c_3(int value) { return value + 3; }\n346: int req_cover_c_4(int value) { return value + 4; }\n355: int req_cover_c_5(int value) { return value + 5; }\n```\n\n@@@ src/fixture_cpp.cpp | cpp\n> Lines: 13-402\n```\n13: #include <concepts>\n14: #include <functional>\n15: #include <iostream>\n16: #include <memory>\n17: #include <optional>\n18: #include <string>\n19: #include <vector>\n21: #define VERSION 2\n24: #define LIKELY(x) __builtin_expect(!!(x), 1)\n28: namespace MyNS {\n36: template <typename T>\n37: concept Printable = requires(std::ostream &os, T val) {\n38: { os << val } -> std::same_as<std::ostream &>;\n39: };\n45: template <typename T>\n46: concept Numeric = std::integral<T> || std::floating_point<T>;\n55: template <Printable T> class Container {\n56: public:\n57: T value;\n63: explicit Container(T v) : value(std::move(v)) {}\n69: Container(const Container &other) = default;\n75: Container(Container &&other) noexcept = default;\n82: Container &operator=(const Container &other) = default;\n89: Container &operator=(Container &&other) noexcept = default;\n92: ~Container() = default;\n100: friend std::ostream &operator<<(std::ostream &os, const Container &c) {\n101: return os << c.value;\n102: }\n109: bool operator==(const Container &other) const { return value == other.value; }\n110: };\n118: struct Point {\n119: double x;\n120: double y;\n127: constexpr double dist_sq(const Point &other) const {\n129: double dx = x - other.x;\n130: double dy = y - other.y;\n131: return dx * dx + dy * dy;\n132: }\n139: constexpr Point operator+(const Point &rhs) const {\n140: return {x + rhs.x, y + rhs.y};\n141: }\n142: };\n150: enum class Direction {\n151: Up,\n152: Down,\n153: Left,\n154: Right\n155: };\n160: using StringVec = std::vector<std::string>;\n163: typedef int my_int_t;\n166: using Callback = std::function<void(int)>;\n175: template <typename Derived> class Cloneable {\n176: public:\n181: std::unique_ptr<Derived> clone() const {\n183: return std::make_unique<Derived>(static_cast<const Derived &>(*this));\n184: }\n185: };\n193: class Base {\n194: public:\n199: virtual const char *type_name() const = 0;\n200: virtual ~Base() = default;\n201: };\n207: class DerivedA : public virtual Base {\n208: public:\n209: const char *type_name() const override { return \"DerivedA\"; }\n210: };\n216: class DerivedB : public virtual Base {\n217: public:\n218: const char *type_name() const override { return \"DerivedB\"; }\n219: };\n225: class Diamond : public DerivedA, public DerivedB {\n226: public:\n227: const char *type_name() const override { return \"Diamond\"; }\n228: };\n237: constexpr unsigned long long constexpr_factorial(unsigned int n) {\n239: return n <= 1 ? 1ULL : n * constexpr_factorial(n - 1);\n240: }\n249: std::pair<std::string, std::string> parse_kv(const std::string &input) {\n250: auto pos = input.find('=');\n251: if (pos == std::string::npos) {\n253: return {\"\", \"\"};\n254: }\n255: return {input.substr(0, pos), input.substr(pos + 1)};\n256: }\n264: void greet(std::string name) { std::cout << \"Hello, \" << name << \"\\n\"; }\n270: int main() {\n272: auto [key, val] = parse_kv(\"lang=cpp\");\n273: greet(key);\n274: return 0;\n275: }\n284: constexpr auto square = [](auto x) { return x * x; };\n288: namespace Inner::Detail {\n295: inline std::string format_int(int v) { return std::to_string(v); }\n297: }\n299: }\n309: template <MyNS::Numeric T> std::string serialize(T value) {\n310: return std::to_string(value);\n311: }\n318: inline std::string serialize(const std::string &value) { return value; }\n321: struct Pixel {\n322: int r;\n323: int g;\n324: int b;\n325: };\n326: struct Size {\n327: int w;\n328: int h;\n329: };\n330: struct Bounds {\n331: int x;\n332: int y;\n333: int w;\n334: int h;\n335: };\n336: struct Marker {\n337: int id;\n338: };\n339: enum Mode { ModeA, ModeB };\n340: enum State { StateIdle, StateBusy };\n341: enum Grade { GradeA, GradeB };\n342: enum Severity { SevLow, SevHigh };\n343: namespace extns {\n344: inline int add_one(int v) { return v + 1; }\n345: }\n346: namespace ext_alpha {\n347: inline int ping() { return 1; }\n348: }\n349: namespace ext_beta {\n350: inline int pong() { return 2; }\n351: }\n352: #define FEATURE_ALPHA 1\n353: #define FEATURE_BETA 2\n354: #define FEATURE_GAMMA 3\n355: using NumberVec = std::vector<int>;\n356: typedef long LongId;\n366: int req_cover_cpp_1(int value) { return value + 1; }\n375: int req_cover_cpp_2(int value) { return value + 2; }\n384: int req_cover_cpp_3(int value) { return value + 3; }\n393: int req_cover_cpp_4(int value) { return value + 4; }\n402: int req_cover_cpp_5(int value) { return value + 5; }\n```\n\n@@@ src/fixture_csharp.cs | csharp\n> Lines: 9-410\n```\n9: using System;\n10: using System.Collections.Generic;\n11: using System.Linq;\n12: using System.Threading.Tasks;\n13: using System.Threading;\n15: namespace MyApp {\n24: public delegate void DataChangedHandler(object sender, string data);\n32: public delegate T Transform<T>(T value);\n39: [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]\n40: public class AuditableAttribute : Attribute {\n42: public int Level { get; set; } = 1;\n43: }\n51: [Serializable]\n52: [Auditable(Level = 2)]\n53: public class Person : IComparable<Person>, IDisposable {\n55: public const int MAX_AGE = 150;\n58: private static int _instanceCount = 0;\n61: private string _name;\n68: public string Name {\n69: get => _name;\n70: set {\n72: if (string.IsNullOrWhiteSpace(value))\n73: throw new ArgumentException(\"Name cannot be empty\");\n74: _name = value;\n75: }\n76: }\n79: public int Age { get; init; }\n82: public string? Email { get; set; }\n85: public Guid Id { get; } = Guid.NewGuid();\n90: public event DataChangedHandler? OnDataChanged;\n97: public Person(string name, int age) {\n98: _name = name;\n99: Age = age;\n100: Interlocked.Increment(ref _instanceCount);\n101: }\n106: public void Greet() {\n108: OnDataChanged?.Invoke(this, $\"Greeted {Name}\");\n109: Console.WriteLine($\"Hello, {Name}!\");\n110: }\n117: public static async Task<string> FetchAsync(CancellationToken token = default) {\n118: await Task.Delay(100, token);\n119: return \"data\";\n120: }\n127: public int CompareTo(Person? other) {\n128: if (other is null) return 1;\n129: return Age.CompareTo(other.Age);\n130: }\n135: public void Dispose() {\n137: Interlocked.Decrement(ref _instanceCount);\n138: GC.SuppressFinalize(this);\n139: }\n146: public object? this[string propertyName] {\n147: get {\n148: return propertyName switch {\n149: \"Name\" => Name,\n150: \"Age\" => Age,\n151: \"Email\" => Email,\n152: _ => null,\n153: };\n154: }\n155: }\n162: public void Deconstruct(out string name, out int age) {\n163: name = Name;\n164: age = Age;\n165: }\n171: public static int GetInstanceCount() => _instanceCount;\n172: }\n179: public interface IGreeter {\n184: void SayHello(string name);\n190: void SayGoodbye(string name) {\n191: Console.WriteLine($\"Goodbye, {name}\");\n192: }\n193: }\n199: public interface IRepository<T> where T : class, new() {\n201: Task<T?> FindByIdAsync(int id);\n204: IAsyncEnumerable<T> GetAllAsync(CancellationToken token = default);\n207: Task<bool> SaveAsync(T entity);\n208: }\n215: public readonly struct Point {\n217: public double X { get; init; }\n219: public double Y { get; init; }\n224: public static Point operator +(Point a, Point b) => new() { X = a.X + b.X, Y = a.Y + b.Y };\n229: public double Magnitude => Math.Sqrt(X * X + Y * Y);\n230: }\n237: [Flags]\n238: public enum Color {\n240: None = 0,\n242: Red = 1,\n244: Green = 2,\n246: Blue = 4,\n248: All = Red | Green | Blue,\n249: }\n258: public record ConfigEntry(string Key, string Value);\n265: public record struct Vector2(double X, double Y);\n272: public static class StringExtensions {\n279: public static string Truncate(this string str, int maxLength) {\n280: if (str.Length <= maxLength) return str;\n281: return str[..maxLength] + \"...\";\n282: }\n289: public static bool IsAscii(this string str) {\n290: return str.All(c => c < 128);\n291: }\n292: }\n300: public class SortedCollection<T> where T : IComparable<T> {\n301: private readonly List<T> _items = new();\n307: public void Add(T item) {\n309: var index = _items.BinarySearch(item);\n310: if (index < 0) index = ~index;\n311: _items.Insert(index, item);\n312: }\n319: public IEnumerable<T> Where(Func<T, bool> predicate) {\n320: return _items.Where(predicate);\n321: }\n322: }\n329: public static class PatternMatcher {\n335: public static string Describe(object? obj) {\n336: return obj switch {\n337: null => \"null\",\n338: int i when i > 0 => $\"positive int: {i}\",\n339: int i => $\"non-positive int: {i}\",\n340: string { Length: 0 } => \"empty string\",\n341: string s => $\"string({s.Length}): {s}\",\n342: Person { Age: >= 18 } p => $\"adult: {p.Name}\",\n343: Person p => $\"minor: {p.Name}\",\n344: _ => $\"unknown: {obj.GetType().Name}\",\n345: };\n346: }\n347: }\n349: }\n352: namespace MyApp.Services {}\n353: namespace MyApp.Core {}\n354: namespace MyApp.Data {}\n355: namespace MyApp.Api {}\n356: public interface ILogger {}\n357: public interface IParser {}\n358: public interface IRunner {}\n359: public enum ModeCs { Fast, Safe }\n360: public enum PhaseCs { Init, Done }\n361: public enum StateCs { Open, Closed }\n362: public enum SignalCs { On, Off }\n363: public struct Size { public int W; public int H; }\n364: public readonly struct Vector { public readonly int X; public readonly int Y; }\n365: public struct Limits { public int Max; }\n366: public struct Cursor { public int Index; }\n367: [DebuggerDisplay(\"{Value}\")]\n368: public const int MIN_AGE = 10;\n369: public const int RETRY_LIMIT = 3;\n370: public const int CACHE_SIZE = 128;\n371: public const int DEFAULT_PAGE = 1;\n374: public static class ReqCoverCsharp {\n380: public static int ReqCoverCsharp1(int value) { return value + 1; }\n387: public static int ReqCoverCsharp2(int value) { return value + 2; }\n394: public static int ReqCoverCsharp3(int value) { return value + 3; }\n401: public static int ReqCoverCsharp4(int value) { return value + 4; }\n408: public static int ReqCoverCsharp5(int value) { return value + 5; }\n410: }\n```\n\n@@@ src/fixture_elixir.ex | elixir\n> Lines: 10-408\n```\n10: defmodule MyApp.Server do\n11: @moduledoc \"\"\"\n12: GenServer implementation for managing application state.\n14: Handles synchronous calls, asynchronous casts, and info messages.\n15: Supports state initialization with validated options.\n16: \"\"\"\n18: use GenServer\n19: import Enum\n20: alias MyApp.Config\n21: alias MyApp.Server.State\n22: require Logger\n24: @behaviour GenServer\n29: @default_timeout 5_000\n32: @max_items 1_000\n36: @doc \"\"\"\n37: Internal state struct for the server.\n39: @field name Server instance name.\n40: @field port Listening port number.\n41: @field items List of stored items.\n42: @field started_at Timestamp of server start.\n43: \"\"\"\n44: defstruct [:name, :port, items: [], started_at: nil]\n48: @type t :: %__MODULE__{\n49: name: String.t(),\n50: port: non_neg_integer(),\n51: items: list(any()),\n52: started_at: DateTime.t() | nil\n53: }\n55: @type option :: {:name, String.t()} | {:port, non_neg_integer()}\n59: @doc \"\"\"\n60: Start a new server process linked to the caller.\n62: @param opts Keyword list of options (:name, :port).\n63: @return {:ok, pid} on success or {:error, reason} on failure.\n64: \"\"\"\n65: @spec start_link(keyword()) :: GenServer.on_start()\n66: def start_link(opts) do\n67: name = Keyword.get(opts, :name, \"default\")\n68: GenServer.start_link(__MODULE__, opts, name: via_tuple(name))\n69: end\n71: @doc \"\"\"\n72: Add an item to the server's collection.\n74: @param server The server PID or registered name.\n75: @param item The item to store.\n76: @return :ok\n77: \"\"\"\n78: @spec add_item(GenServer.server(), any()) :: :ok\n79: def add_item(server, item) do\n80: GenServer.call(server, {:add_item, item})\n81: end\n83: @doc \"\"\"\n84: Retrieve all stored items.\n86: @param server The server PID or registered name.\n87: @return List of stored items.\n88: \"\"\"\n89: @spec get_items(GenServer.server()) :: list(any())\n90: def get_items(server) do\n91: GenServer.call(server, :get_items)\n92: end\n94: @doc \"\"\"\n95: Asynchronously notify the server of an event.\n97: @param server The server PID.\n98: @param event The event data to process.\n99: @return :ok\n100: \"\"\"\n101: @spec notify(GenServer.server(), any()) :: :ok\n102: def notify(server, event) do\n103: GenServer.cast(server, {:notify, event})\n104: end\n111: defp via_tuple(name) do\n112: {:via, Registry, {MyApp.Registry, name}}\n113: end\n117: @impl true\n118: def init(opts) do\n120: name = Keyword.fetch!(opts, :name)\n121: port = Keyword.get(opts, :port, 4000)\n123: state = %__MODULE__{\n124: name: name,\n125: port: port,\n126: started_at: DateTime.utc_now()\n127: }\n129: Logger.info(\"Server #{name} started on port #{port}\")\n130: {:ok, state}\n131: end\n133: @impl true\n134: def handle_call({:add_item, item}, _from, state) do\n136: if length(state.items) >= @max_items do\n137: {:reply, {:error, :capacity_exceeded}, state}\n138: else\n139: new_state = %{state | items: [item | state.items]}\n140: {:reply, :ok, new_state}\n141: end\n142: end\n144: @impl true\n145: def handle_call(:get_items, _from, state) do\n146: {:reply, Enum.reverse(state.items), state}\n147: end\n149: @impl true\n150: def handle_cast({:notify, event}, state) do\n151: Logger.debug(\"Received event: #{inspect(event)}\")\n152: {:noreply, state}\n153: end\n155: @impl true\n156: def handle_info(:timeout, state) do\n157: Logger.warn(\"Server #{state.name} timed out\")\n158: {:noreply, state}\n159: end\n164: defp handle_internal(state) do\n166: pruned = Enum.take(state.items, @max_items)\n167: %{state | items: pruned}\n168: end\n170: @doc \"\"\"\n171: Define a macro for compile-time code generation.\n173: @param expr The expression to wrap.\n174: @return Quoted AST wrapping the expression.\n175: \"\"\"\n176: defmacro my_macro(expr) do\n177: quote do\n178: result = unquote(expr)\n179: Logger.debug(\"Macro result: #{inspect(result)}\")\n180: result\n181: end\n182: end\n183: end\n187: defprotocol Printable do\n188: @moduledoc \"\"\"\n189: Protocol for types that can be printed as formatted strings.\n190: \"\"\"\n192: @doc \"\"\"\n193: Convert a value to its formatted string representation.\n195: @param data The value to format.\n196: @return Formatted string.\n197: \"\"\"\n198: @spec print(t) :: String.t()\n199: def print(data)\n200: end\n204: defimpl Printable, for: MyApp.Server do\n205: @doc \"\"\"\n206: Format a server struct for display.\n208: @param server The server struct to format.\n209: @return String in format \"Server(name:port)\".\n210: \"\"\"\n211: def print(server) do\n212: \"Server(#{server.name}:#{server.port})\"\n213: end\n214: end\n216: defimpl Printable, for: BitString do\n217: def print(str) do\n218: \"String(#{str})\"\n219: end\n220: end\n224: defmodule MyApp.Utils do\n225: @moduledoc \"\"\"\n226: Utility functions demonstrating pattern matching, guards,\n227: pipe operators, and comprehensions.\n228: \"\"\"\n230: @doc \"\"\"\n231: Classify a value using guard clauses and pattern matching.\n233: @param value The value to classify.\n234: @return Atom describing the value's category.\n235: \"\"\"\n236: @spec classify(any()) :: atom()\n237: def classify(value) when is_integer(value) and value > 0, do: :positive\n238: def classify(value) when is_integer(value) and value < 0, do: :negative\n239: def classify(0), do: :zero\n240: def classify(value) when is_binary(value), do: :string\n241: def classify(value) when is_list(value), do: :list\n242: def classify(_), do: :unknown\n244: @doc \"\"\"\n245: Process a list using pipe operator for data transformation.\n247: @param items List of strings to process.\n248: @return Sorted list of unique uppercase strings.\n249: \"\"\"\n250: @spec process_list(list(String.t())) :: list(String.t())\n251: def process_list(items) do\n252: items\n253: |> Enum.map(&String.trim/1)\n254: |> Enum.reject(&(&1 == \"\"))\n255: |> Enum.map(&String.upcase/1)\n256: |> Enum.uniq()\n257: |> Enum.sort()\n258: end\n260: @doc \"\"\"\n261: Demonstrate for-comprehension with multiple generators and filters.\n263: @param range Upper bound for the search space.\n264: @return List of Pythagorean triples.\n265: \"\"\"\n266: @spec pythagorean_triples(pos_integer()) :: list(tuple())\n267: def pythagorean_triples(range) do\n268: for a <- 1..range,\n269: b <- a..range,\n270: c <- b..range,\n271: a * a + b * b == c * c do\n272: {a, b, c}\n273: end\n274: end\n276: @doc \"\"\"\n277: Safe division returning :error tuple on zero divisor.\n279: @param a Dividend.\n280: @param b Divisor.\n281: @return {:ok, result} or {:error, :division_by_zero}.\n282: \"\"\"\n283: @spec safe_divide(number(), number()) :: {:ok, float()} | {:error, atom()}\n284: def safe_divide(_, 0), do: {:error, :division_by_zero}\n285: def safe_divide(a, b), do: {:ok, a / b}\n287: @doc \"\"\"\n288: Recursively compute factorial with guard clause.\n290: @param n Non-negative integer.\n291: @return Factorial of n.\n292: \"\"\"\n293: @spec factorial(non_neg_integer()) :: pos_integer()\n294: def factorial(0), do: 1\n295: def factorial(n) when n > 0, do: n * factorial(n - 1)\n296: end\n300: defmodule MyApp.Plugin do\n301: @moduledoc \"\"\"\n302: Behaviour defining the plugin interface.\n303: \"\"\"\n305: @doc \"Initialize the plugin with configuration options.\"\n306: @callback init(opts :: keyword()) :: {:ok, any()} | {:error, String.t()}\n308: @doc \"Execute the plugin's main logic.\"\n309: @callback execute(state :: any()) :: :ok | {:error, String.t()}\n311: @doc \"Clean up plugin resources.\"\n312: @callback cleanup(state :: any()) :: :ok\n314: @optional_callbacks [cleanup: 1]\n315: end\n318: defmodule MyApp.Extra do\n320: defstruct [:name]\n321: end\n323: defmodule MyApp.Audit do\n324: defstruct [:id]\n325: end\n327: defmodule MyApp.State do\n328: defstruct [:status]\n329: end\n331: defmodule MyApp.Payload do\n332: defstruct [:value]\n333: end\n335: defmodule MyApp.Context do\n336: defstruct [:meta]\n337: end\n339: defprotocol Auditable do\n340: def audit(data)\n341: end\n343: defprotocol Renderable do\n344: def render(data)\n345: end\n347: defprotocol Parsable do\n348: def parse(data)\n349: end\n351: defprotocol Validatable do\n352: def validate(data)\n353: end\n355: defimpl Auditable, for: Any do\n356: def audit(data), do: data\n357: end\n359: defimpl Renderable, for: Any do\n360: def render(data), do: data\n361: end\n363: defimpl Parsable, for: Any do\n364: def parse(data), do: data\n365: end\n367: defimpl Validatable, for: Any do\n368: def validate(data), do: data\n369: end\n372: defmodule ReqCoverElixir do\n378: def req_cover_elixir_1(value), do: value + 1\n385: def req_cover_elixir_2(value), do: value + 2\n392: def req_cover_elixir_3(value), do: value + 3\n399: def req_cover_elixir_4(value), do: value + 4\n406: def req_cover_elixir_5(value), do: value + 5\n408: end\n```\n\n@@@ src/fixture_go.go | go\n> Lines: 12-339\n```\n12: package main\n14: import (\n15: \t\"context\"\n16: \t\"fmt\"\n17: \t\"io\"\n18: \t\"sync\"\n19: )\n24: const MaxSize = 100\n27: var globalVar = 0\n30: const (\n32: \tLogDebug = iota\n34: \tLogInfo\n36: \tLogError\n37: )\n43: type Server struct {\n44: \tPort int\n45: \tHost string\n46: \tsync.Mutex\n47: \thandlers map[string]HandlerFunc\n48: }\n51: type HandlerFunc func(ctx context.Context, req []byte) ([]byte, error)\n54: type Address struct {\n55: \tStreet string\n56: \tCity string\n57: \tZip string\n58: }\n61: type Employee struct {\n62: \tName string\n63: \tAge int\n64: \tAddress\n65: \tManager *Employee\n66: }\n71: type Handler interface {\n73: \tHandle(ctx context.Context, data []byte) error\n74: }\n77: type ReadWriteCloser interface {\n78: \tio.Reader\n79: \tio.Writer\n80: \tio.Closer\n81: }\n86: type MyInt int\n89: func (m MyInt) String() string {\n90: \treturn fmt.Sprintf(\"MyInt(%d)\", int(m))\n91: }\n98: type Pair[A any, B any] struct {\n99: \tFirst A\n100: \tSecond B\n101: }\n104: type Ordered interface {\n105: \t~int | ~float64 | ~string\n106: }\n111: func main() {\n112: \tfmt.Println(\"hello\")\n113: }\n116: func init() {\n118: \tglobalVar = 1\n119: }\n123: func (s *Server) Start() error {\n124: \ts.Lock()\n125: \tdefer s.Unlock()\n127: \tif s.Port <= 0 {\n128: \t\treturn fmt.Errorf(\"invalid port: %d\", s.Port)\n129: \t}\n130: \tfmt.Printf(\"Starting on %s:%d\\n\", s.Host, s.Port)\n131: \treturn nil\n132: }\n138: func (s *Server) Register(path string, handler HandlerFunc) {\n139: \tif s.handlers == nil {\n140: \t\ts.handlers = make(map[string]HandlerFunc)\n141: \t}\n142: \ts.handlers[path] = handler\n143: }\n152: func Max[T Ordered](a, b T) T {\n153: \tif a > b {\n154: \t\treturn a\n155: \t}\n156: \treturn b\n157: }\n164: func Filter[T any](items []T, pred func(T) bool) []T {\n165: \tresult := make([]T, 0)\n166: \tfor _, item := range items {\n167: \t\tif pred(item) {\n168: \t\t\tresult = append(result, item)\n169: \t\t}\n170: \t}\n171: \treturn result\n172: }\n180: func Divide(a, b int) (int, int, error) {\n181: \tif b == 0 {\n182: \t\treturn 0, 0, fmt.Errorf(\"division by zero\")\n183: \t}\n184: \treturn a / b, a % b, nil\n185: }\n192: func ParseConfig(input string) (host string, port int, err error) {\n194: \t_, scanErr := fmt.Sscanf(input, \"%s:%d\", &host, &port)\n195: \tif scanErr != nil {\n196: \t\terr = scanErr\n197: \t\treturn\n198: \t}\n199: \treturn\n200: }\n206: func Counter() func() int {\n207: \tcount := 0\n208: \treturn func() int {\n210: \t\tcount++\n211: \t\treturn count\n212: \t}\n213: }\n221: func FanOut(items []string, workers int) <-chan string {\n222: \tresults := make(chan string, len(items))\n223: \tvar wg sync.WaitGroup\n225: \tfor i := 0; i < workers; i++ {\n226: \t\twg.Add(1)\n227: \t\tgo func(id int) {\n228: \t\t\tdefer wg.Done()\n230: \t\t\tfor _, item := range items {\n231: \t\t\t\tresults <- fmt.Sprintf(\"[%d] %s\", id, item)\n232: \t\t\t}\n233: \t\t}(i)\n234: \t}\n237: \tgo func() {\n238: \t\twg.Wait()\n239: \t\tclose(results)\n240: \t}()\n242: \treturn results\n243: }\n250: func Describe(v interface{}) string {\n251: \tswitch val := v.(type) {\n252: \tcase int:\n253: \t\treturn fmt.Sprintf(\"int: %d\", val)\n254: \tcase string:\n255: \t\treturn fmt.Sprintf(\"string: %q\", val)\n256: \tcase bool:\n257: \t\tif val {\n258: \t\t\treturn \"bool: true\"\n259: \t\t}\n260: \t\treturn \"bool: false\"\n261: \tcase nil:\n262: \t\treturn \"nil\"\n263: \tdefault:\n264: \t\treturn fmt.Sprintf(\"unknown: %T\", val)\n265: \t}\n266: }\n273: func SafeExecute(fn func()) (err error) {\n274: \tdefer func() {\n275: \t\tif r := recover(); r != nil {\n277: \t\t\terr = fmt.Errorf(\"panic: %v\", r)\n278: \t\t}\n279: \t}()\n280: \tfn()\n281: \treturn nil\n282: }\n285: package utilx\n286: package configx\n287: package jobsx\n288: package metricx\n289: import \"os\"\n290: import \"time\"\n291: import \"strings\"\n292: import \"bytes\"\n293: func (s *Server) Stop() {}\n294: func (s *Server) Reset() {}\n295: type Session struct { Id string }\n296: type Bucket struct { Name string }\n297: type Closer interface { Close() error }\n298: type Starter interface { Start() error }\n299: type UserAlias string\n300: type Amount int\n301: type Resolver func(string) error\n302: const RetryCount = 3\n303: var LastError error\n311: func reqCoverGo1(value int) int { return value + 1 }\n318: func reqCoverGo2(value int) int { return value + 2 }\n325: func reqCoverGo3(value int) int { return value + 3 }\n332: func reqCoverGo4(value int) int { return value + 4 }\n339: func reqCoverGo5(value int) int { return value + 5 }\n```\n\n@@@ src/fixture_haskell.hs | haskell\n> Lines: 11-248\n```\n11: module MyModule\n12: ( Name\n13: , Person(..)\n14: , Printable(..)\n15: , Expr(..)\n16: , greet\n17: , safeDiv\n18: , processList\n19: , fibonacci\n20: ) where\n22: import Data.List (sort, nub, intercalate)\n23: import Data.Maybe (fromMaybe, isJust)\n24: import qualified Data.Map as Map\n25: import Control.Monad (when, unless, forM_)\n30: type Name = String\n33: type Config = Map.Map String Int\n36: type Transform a = a -> a\n42: data Person = Person\n43: { personName :: String\n44: , personAge :: Int\n45: } deriving (Show, Eq, Ord)\n49: data Tree a\n50: = Leaf\n51: | Node a (Tree a) (Tree a)\n52: deriving (Show, Eq)\n56: data Expr\n57: = Lit Double\n58: | Add Expr Expr\n59: | Mul Expr Expr\n60: | Neg Expr\n61: deriving (Show)\n64: data Result a\n65: = Ok a\n66: | Err String\n67: deriving (Show)\n72: class Printable a where\n74: printIt :: a -> String\n77: debugPrint :: a -> String\n78: debugPrint x = \"Debug: \" ++ printIt x\n81: class Serializable a where\n83: serialize :: a -> [(String, String)]\n88: instance Printable Person where\n89: printIt p = personName p ++ \" (\" ++ show (personAge p) ++ \")\"\n92: instance Serializable Person where\n93: serialize p =\n94: [ (\"name\", personName p)\n95: , (\"age\", show (personAge p))\n96: ]\n99: instance Functor Tree where\n100: fmap _ Leaf = Leaf\n101: fmap f (Node x l r) = Node (f x) (fmap f l) (fmap f r)\n104: instance Functor Result where\n105: fmap f (Ok a) = Ok (f a)\n106: fmap _ (Err e) = Err e\n112: greet :: String -> String\n113: greet name = \"Hello \" ++ name\n117: safeDiv :: Double -> Double -> Maybe Double\n118: safeDiv _ 0 = Nothing\n119: safeDiv x y = Just (x / y)\n123: eval :: Expr -> Double\n124: eval (Lit n) = n\n125: eval (Add a b) = eval a + eval b\n126: eval (Mul a b) = eval a * eval b\n127: eval (Neg e) = -(eval e)\n131: processList :: [Int] -> [Int]\n132: processList xs = result\n133: where\n135: unique = nub xs\n137: sorted = sort unique\n139: result = filter (> 0) sorted\n143: fibonacci :: Int -> Integer\n144: fibonacci n\n145: | n < 0 = error \"negative input\"\n146: | n == 0 = 0\n147: | n == 1 = 1\n148: | otherwise = go n 0 1\n149: where\n150: go 0 a _ = a\n151: go k a b = go (k - 1) b (a + b)\n155: insertTree :: (Ord a) => a -> Tree a -> Tree a\n156: insertTree x Leaf = Node x Leaf Leaf\n157: insertTree x (Node y left right)\n158: | x < y = Node y (insertTree x left) right\n159: | x > y = Node y left (insertTree x right)\n160: | otherwise = Node y left right\n164: foldTree :: (b -> a -> b) -> b -> Tree a -> b\n165: foldTree _ acc Leaf = acc\n166: foldTree f acc (Node x l r) =\n167: let leftAcc = foldTree f acc l\n168: midAcc = f leftAcc x\n169: in foldTree f midAcc r\n173: lookupConfig :: Config -> String -> Int -> Int\n174: lookupConfig cfg key def = fromMaybe def (Map.lookup key cfg)\n178: applyN :: Int -> Transform a -> a -> a\n179: applyN 0 _ x = x\n180: applyN n f x = applyN (n - 1) f (f x)\n184: formatPersons :: (Printable a) => [a] -> String\n185: formatPersons ps = intercalate \", \" (map printIt ps)\n189: safeCompute :: Double -> Double -> Double -> Maybe Double\n190: safeCompute x y z = do\n192: a <- safeDiv x y\n193: b <- safeDiv a z\n194: return (a + b)\n197: module Extra.One where\n198: module Extra.Two where\n199: module Extra.Three where\n200: module Extra.Four where\n201: import qualified Data.Set as Set\n202: type RequestId = Int\n203: type ResponseId = Int\n204: class Renderable a where\n205: class Parsable a where\n206: class Executable a where\n207: data Envelope = Envelope String\n215: reqCoverHaskell1 :: Int -> Int\n216: reqCoverHaskell1 value = value + 1\n223: reqCoverHaskell2 :: Int -> Int\n224: reqCoverHaskell2 value = value + 2\n231: reqCoverHaskell3 :: Int -> Int\n232: reqCoverHaskell3 value = value + 3\n239: reqCoverHaskell4 :: Int -> Int\n240: reqCoverHaskell4 value = value + 4\n247: reqCoverHaskell5 :: Int -> Int\n248: reqCoverHaskell5 value = value + 5\n```\n\n@@@ src/fixture_java.java | java\n> Lines: 11-429\n```\n11: package com.example.app;\n13: import java.util.List;\n14: import java.util.Map;\n15: import java.util.Optional;\n16: import java.util.function.Function;\n17: import java.util.function.Predicate;\n18: import java.util.stream.Collectors;\n19: import static java.lang.Math.PI;\n27: @interface RequiresAuth {\n28: String role() default \"user\";\n29: }\n38: @SuppressWarnings(\"unchecked\")\n39: public class MyClass<T extends Comparable<T>> {\n42: public static final int MAX_SIZE = 100;\n45: private List<T> items;\n51: public MyClass(List<T> items) {\n52: this.items = items;\n53: }\n59: public void greet(String name) {\n61: if (name == null) {\n62: return;\n63: }\n64: System.out.println(\"Hello, \" + name);\n65: }\n71: private static String helper() {\n72: return \"ok\";\n73: }\n80: public Optional<T> findFirst(Predicate<T> predicate) {\n81: for (T item : items) {\n83: if (predicate.test(item)) {\n84: return Optional.of(item);\n85: }\n86: }\n87: return Optional.empty();\n88: }\n96: public <R> List<R> map(Function<T, R> mapper) {\n97: return items.stream()\n98: .map(mapper)\n99: .collect(Collectors.toList());\n100: }\n107: public double sumWildcard(List<? extends Number> source) {\n108: double total = 0.0;\n109: for (Number n : source) {\n110: total += n.doubleValue();\n111: }\n112: return total;\n113: }\n121: public class Builder {\n122: private List<T> pending;\n129: public Builder add(T item) {\n130: pending.add(item);\n131: return this;\n132: }\n138: public MyClass<T> build() {\n139: return new MyClass<>(pending);\n140: }\n141: }\n149: public static class Config {\n151: public final String key;\n153: public final Object value;\n160: public Config(String key, Object value) {\n161: this.key = key;\n162: this.value = value;\n163: }\n164: }\n165: }\n173: public interface Greeter {\n178: void sayHello(String name);\n184: default void sayGoodbye(String name) {\n185: System.out.println(\"Goodbye, \" + name);\n186: }\n192: static Greeter simple() {\n194: return name -> System.out.println(\"Hi, \" + name);\n195: }\n196: }\n204: public enum Color {\n206: RED(\"#FF0000\"),\n208: GREEN(\"#00FF00\"),\n210: BLUE(\"#0000FF\");\n213: private final String hex;\n219: Color(String hex) {\n220: this.hex = hex;\n221: }\n227: public String getHex() {\n228: return hex;\n229: }\n230: }\n240: public record Point(double x, double y) {\n245: public Point {\n246: if (Double.isNaN(x) || Double.isNaN(y)) {\n247: throw new IllegalArgumentException(\"NaN coordinates\");\n248: }\n249: }\n256: public double distanceTo(Point other) {\n257: double dx = this.x - other.x;\n258: double dy = this.y - other.y;\n259: return Math.sqrt(dx * dx + dy * dy);\n260: }\n261: }\n269: public sealed class Shape permits Circle, Rectangle {\n274: public double area() {\n275: return 0.0;\n276: }\n277: }\n284: public final class Circle extends Shape {\n286: private final double radius;\n292: public Circle(double radius) {\n293: this.radius = radius;\n294: }\n300: @Override\n301: public double area() {\n302: return PI * radius * radius;\n303: }\n304: }\n311: public final class Rectangle extends Shape {\n312: private final double width;\n313: private final double height;\n315: public Rectangle(double width, double height) {\n316: this.width = width;\n317: this.height = height;\n318: }\n320: @Override\n321: public double area() {\n322: return width * height;\n323: }\n324: }\n332: public class Evaluator {\n339: public static String describe(Shape shape) {\n341: return switch (shape) {\n342: case Circle c -> \"Circle with radius \" + c.area();\n343: case Rectangle r -> \"Rectangle with area \" + r.area();\n344: default -> \"Unknown shape\";\n345: };\n346: }\n354: @RequiresAuth(role = \"admin\")\n355: public static String readFile(String path) throws java.io.IOException {\n357: try (var reader = new java.io.BufferedReader(new java.io.FileReader(path))) {\n358: return reader.lines().collect(Collectors.joining(\"\\n\"));\n359: }\n360: }\n361: }\n364: package com.example.extra.one;\n365: package com.example.extra.two;\n366: package com.example.extra.three;\n367: package com.example.extra.four;\n368: interface Runner {}\n369: public interface Mapper {}\n370: public interface Handler {}\n371: public interface Auditor {}\n372: enum ModeJava { FAST, SAFE }\n373: enum PhaseJava { INIT, RUN }\n374: enum StatusJava { OPEN, CLOSED }\n375: enum KindJava { A, B }\n376: public static final int DEFAULT_LIMIT = 10;\n377: public static final int RETRY_LIMIT = 3;\n378: public static final int BUFFER_SIZE = 512;\n379: public static final int MAX_USERS = 99;\n380: @Trace\n383: class ReqCoverJava {\n391: static int reqCoverJava1(int value) { return value + 1; }\n400: static int reqCoverJava2(int value) { return value + 2; }\n409: static int reqCoverJava3(int value) { return value + 3; }\n418: static int reqCoverJava4(int value) { return value + 4; }\n427: static int reqCoverJava5(int value) { return value + 5; }\n429: }\n```\n\n@@@ src/fixture_javascript.js | javascript\n> Lines: 11-381\n```\n11: import React from 'react';\n12: import { useState, useEffect } from 'react';\n20: class MyComponent {\n22: #instanceId;\n25: static #registry = new Map();\n28: static {\n29: console.log('MyComponent class loaded');\n30: }\n36: constructor(id = 0) {\n37: this.#instanceId = id;\n38: MyComponent.#registry.set(id, this);\n39: }\n45: render() {\n47: return null;\n48: }\n54: getId() {\n55: return this.#instanceId;\n56: }\n63: static has(id) {\n64: return MyComponent.#registry.has(id);\n65: }\n66: }\n75: class EnhancedComponent extends MyComponent {\n80: render() {\n82: super.render();\n83: return { type: 'div', children: [] };\n84: }\n90: componentDidMount() {\n91: console.log('mounted');\n92: }\n93: }\n103: function greet(name) {\n104: return \"Hello \" + name;\n105: }\n112: async function fetchData() {\n114: return await fetch('/api');\n115: }\n122: const handler = (event) => {\n124: event.preventDefault();\n125: console.log(event.type);\n126: };\n134: const processItems = ({ items, count }) => {\n135: return items.slice(0, count).map(i => i.toUpperCase());\n136: };\n141: const MAX_SIZE = 100;\n144: const PLUGIN_KEY = Symbol('plugin');\n153: const MyWrapped = React.memo(() => {\n154: return null;\n155: });\n164: function* idGenerator() {\n165: let id = 0;\n166: while (true) {\n168: yield id++;\n169: }\n170: }\n179: function* rangeGenerator(start, end) {\n180: for (let i = start; i < end; i++) {\n181: yield i;\n182: }\n183: }\n194: async function* asyncDataStream(url) {\n195: let page = 0;\n196: while (true) {\n197: const response = await fetch(`${url}?page=${page}`);\n198: const data = await response.json();\n199: if (data.length === 0) {\n201: return;\n202: }\n203: yield data;\n204: page++;\n205: }\n206: }\n213: const initResult = (() => {\n215: const config = { debug: false };\n216: return Object.freeze(config);\n217: })();\n227: function createProxy(target) {\n228: return new Proxy(target, {\n229: get(obj, prop) {\n231: console.log(`Access: ${String(prop)}`);\n232: return Reflect.get(obj, prop);\n233: },\n234: set(obj, prop, value) {\n236: console.log(`Set: ${String(prop)} = ${value}`);\n237: return Reflect.set(obj, prop, value);\n238: },\n239: });\n240: }\n250: function buildDynamic(prefix) {\n251: return {\n252: [`${prefix}_name`]: 'value',\n253: [`${prefix}_id`]: 42,\n254: [Symbol.toPrimitive](hint) {\n255: return hint === 'string' ? prefix : 0;\n256: },\n257: };\n258: }\n268: function fetchAndProcess(url) {\n269: return fetch(url)\n270: .then(res => res.json())\n271: .then(data => {\n273: return { ...data, processed: true };\n274: })\n275: .catch(err => {\n277: console.error(err);\n278: return { error: true, processed: false };\n279: });\n280: }\n290: function configureApp({ host = 'localhost', port = 3000, db: { url: dbUrl = 'sqlite://' } = {} } = {}) {\n291: return { host, port, dbUrl };\n292: }\n297: const fs = require('fs');\n302: const _privateState = new WeakMap();\n310: function setPrivate(obj, data) {\n311: _privateState.set(obj, data);\n312: }\n322: async function loadPlugin(name) {\n324: const mod = await import(`./${name}.js`);\n325: return mod;\n326: }\n329: import fs from 'fs';\n330: import path from 'path';\n331: import url from 'url';\n332: export class ExtraService { constructor() { this.ready = true; } }\n333: class HelperComponent { render() { return null; } }\n334: export default class WidgetFactory { create() { return {}; } }\n335: const BoundComponent = React.memo(() => null);\n336: const ForwardedWidget = React.forwardRef((_, ref) => ({ ref }));\n337: const LazyWidget = React.lazy(() => import('./Widget'));\n338: const MemoPanel = memo(() => null);\n339: const API_TOKEN = 'tok';\n340: const CACHE_SIZE = 128;\n341: const RETRY_LIMIT = 5;\n342: const pathMod = require('path');\n343: const cryptoMod = require('crypto');\n344: const utilMod = require('util');\n345: const osMod = require('os');\n353: function reqCoverJs1(value) { return value + 1; }\n360: function reqCoverJs2(value) { return value + 2; }\n367: function reqCoverJs3(value) { return value + 3; }\n374: function reqCoverJs4(value) { return value + 4; }\n381: function reqCoverJs5(value) { return value + 5; }\n```\n\n@@@ src/fixture_kotlin.kt | kotlin\n> Lines: 11-449\n```\n11: import kotlin.collections.List\n12: import kotlinx.coroutines.flow.Flow\n13: import kotlinx.coroutines.flow.flow\n18: @Deprecated(\"Use UserV2 instead\", replaceWith = ReplaceWith(\"UserV2\"))\n19: data class User(val name: String, val age: Int = 0)\n28: sealed class Result<out T> {\n34: data class Success<T>(val value: T) : Result<T>()\n42: data class Error(val message: String, val cause: Throwable? = null) : Result<Nothing>()\n48: object Loading : Result<Nothing>()\n56: fun <R> map(transform: (T) -> R): Result<R> = when (this) {\n57: is Success -> Success(transform(value))\n58: is Error -> Error(message, cause)\n59: is Loading -> Loading\n60: }\n61: }\n70: interface Repository<T> {\n76: fun findById(id: Int): T?\n83: fun save(entity: T): Boolean\n89: fun findAll(): Flow<T>\n90: }\n96: sealed interface Identifiable {\n98: val id: Int\n99: }\n107: enum class Color(val hex: String) {\n109: RED(\"#FF0000\"),\n111: GREEN(\"#00FF00\"),\n113: BLUE(\"#0000FF\");\n115: companion object {\n121: fun fromHex(hex: String): Color? = values().find { it.hex == hex }\n122: }\n123: }\n134: data class Entity(\n135: override val id: Int,\n136: val name: String,\n137: val status: String = \"active\",\n138: ) : Identifiable\n147: @JvmInline\n148: value class EmailAddress(val value: String) {\n149: init {\n150: require(value.contains('@')) { \"Invalid email: $value\" }\n151: }\n154: val domain: String get() = value.substringAfter('@')\n155: }\n165: fun greet(name: String): String {\n166: return \"Hello $name\"\n167: }\n174: suspend fun fetchData(): String {\n176: return \"data\"\n177: }\n186: fun processItems(items: List<String>, transform: (String) -> String): List<String> {\n187: return items.map(transform)\n188: }\n197: fun String.wordCount(): Int {\n198: return this.trim().split(\"\\\\s+\".toRegex()).size\n199: }\n205: val String.lastChar: Char?\n206: get() = if (this.isEmpty()) null else this[this.length - 1]\n217: inline fun <reified T> filterByType(items: List<Any>): List<T> {\n218: return items.filterIsInstance<T>()\n219: }\n229: data class Vector2(val x: Double, val y: Double) {\n235: operator fun plus(other: Vector2) = Vector2(x + other.x, y + other.y)\n241: operator fun unaryMinus() = Vector2(-x, -y)\n248: operator fun times(other: Vector2) = x * other.x + y * other.y\n249: }\n254: val PI = 3.14159265\n257: var counter = 0\n265: object Singleton {\n267: private val config = mutableMapOf<String, Any>()\n274: fun set(key: String, value: Any) {\n275: config[key] = value\n276: }\n284: @Suppress(\"UNCHECKED_CAST\")\n285: fun <T> get(key: String): T? = config[key] as? T\n286: }\n292: companion object Factory {\n293: }\n303: class DelegatingList<T>(private val inner: MutableList<T>) : List<T> by inner {\n305: var accessCount = 0\n306: private set\n311: override val size: Int\n312: get() {\n313: accessCount++\n314: return inner.size\n315: }\n316: }\n324: class Service {\n326: lateinit var dependency: Repository<Entity>\n329: val resource: String by lazy {\n331: \"expensive_resource\"\n332: }\n338: fun isReady(): Boolean = ::dependency.isInitialized\n339: }\n347: class HtmlBuilder {\n348: private val elements = mutableListOf<String>()\n354: fun div(block: HtmlBuilder.() -> Unit) {\n355: val inner = HtmlBuilder()\n356: inner.block()\n357: elements.add(\"<div>${inner.build()}</div>\")\n358: }\n364: fun text(text: String) {\n365: elements.add(text)\n366: }\n372: fun build(): String = elements.joinToString(\"\")\n373: }\n381: fun html(block: HtmlBuilder.() -> Unit): String {\n382: val builder = HtmlBuilder()\n383: builder.block()\n384: return builder.build()\n385: }\n388: import kotlin.math.max\n389: import kotlin.math.min\n390: interface Logger\n391: interface Parser\n392: interface Emitter\n393: interface Formatter\n394: enum class ModeKt { FAST, SAFE }\n395: enum class PhaseKt { INIT, RUN }\n396: enum class StatusKt { READY, WAITING }\n397: enum class SignalKt { ON, OFF }\n398: @Synchronized\n399: @PublishedApi\n400: object CacheStore\n401: var retries = 0\n402: var attempts = 0\n403: var state = \"idle\"\n413: fun reqCoverKotlin1(value: Int): Int = value + 1\n422: fun reqCoverKotlin2(value: Int): Int = value + 2\n431: fun reqCoverKotlin3(value: Int): Int = value + 3\n440: fun reqCoverKotlin4(value: Int): Int = value + 4\n449: fun reqCoverKotlin5(value: Int): Int = value + 5\n```\n\n@@@ src/fixture_lua.lua | lua\n> Lines: 14-274\n```\n14: function globalFunc(x)\n15: return x + 1\n16: end\n22: local function localFunc(y)\n23: if type(y) ~= \"number\" then\n24: error(\"expected number, got \" .. type(y))\n25: end\n27: return y * 2\n28: end\n33: local function sumAll(...)\n34: local total = 0\n35: local args = {...}\n36: for _, v in ipairs(args) do\n38: total = total + v\n39: end\n40: return total\n41: end\n46: local myVar = 42\n49: local config = {\n50: debug = false,\n51: maxRetries = 3,\n52: timeout = 30.0,\n53: }\n59: local handler = function(event)\n61: if event.type == \"click\" then\n62: print(\"clicked at \" .. event.x .. \",\" .. event.y)\n63: else\n64: print(\"event: \" .. event.type)\n65: end\n66: end\n72: local MyModule = {}\n73: MyModule.__index = MyModule\n78: function MyModule.new(name)\n79: local self = setmetatable({}, MyModule)\n80: self.name = name\n81: self._items = {}\n82: return self\n83: end\n88: MyModule.method = function(self)\n89: return self.name\n90: end\n94: function MyModule:addItem(item)\n96: table.insert(self._items, item)\n97: end\n101: function MyModule:count()\n102: return #self._items\n103: end\n109: local Animal = {}\n110: Animal.__index = Animal\n115: function Animal.new(species)\n116: local self = setmetatable({}, Animal)\n117: self.species = species\n118: return self\n119: end\n123: function Animal:speak()\n124: return self.species .. \" says ...\"\n125: end\n129: local Dog = setmetatable({}, { __index = Animal })\n130: Dog.__index = Dog\n135: function Dog.new(name)\n136: local self = Animal.new(\"Dog\")\n137: setmetatable(self, Dog)\n138: self.dogName = name\n139: return self\n140: end\n144: function Dog:speak()\n145: return self.dogName .. \" says Woof!\"\n146: end\n153: local function makeCounter(step)\n154: local count = 0\n155: return function()\n157: count = count + step\n158: return count\n159: end\n160: end\n167: local function fibonacci(limit)\n168: return coroutine.wrap(function()\n169: local a, b = 0, 1\n170: for _ = 1, limit do\n171: coroutine.yield(a)\n173: a, b = b, a + b\n174: end\n175: end)\n176: end\n184: local function safeCall(fn, ...)\n185: local ok, result = pcall(fn, ...)\n186: if not ok then\n188: print(\"Error: \" .. tostring(result))\n189: return false, nil\n190: end\n191: return true, result\n192: end\n197: local mixedTable = {\n199: \"first\",\n200: \"second\",\n202: name = \"test\",\n203: count = 42,\n205: [math.pi] = \"pi\",\n207: nested = {\n208: x = 1,\n209: y = 2,\n210: },\n211: }\n219: local function range(from, to)\n220: local i = from - 1\n221: return function()\n222: i = i + 1\n223: if i <= to then\n224: return i\n225: end\n227: end\n228: end\n236: function req_cover_lua_1(value)\n237: return value + 1\n238: end\n245: function req_cover_lua_2(value)\n246: return value + 2\n247: end\n254: function req_cover_lua_3(value)\n255: return value + 3\n256: end\n263: function req_cover_lua_4(value)\n264: return value + 4\n265: end\n272: function req_cover_lua_5(value)\n273: return value + 5\n274: end\n```\n\n@@@ src/fixture_perl.pl | perl\n> Lines: 1-308\n```\n1: #!/usr/bin/perl\n16: package MyPackage;\n18: use strict;\n19: use warnings;\n20: use Carp qw(croak confess);\n21: require Exporter;\n22: use constant MAX_SIZE => 100;\n23: use constant {\n24: MIN_SIZE => 1,\n25: DEFAULT_NAME => 'unnamed',\n26: };\n29: our $VERSION = '1.0.0';\n32: our @EXPORT = qw(greet process);\n35: our @EXPORT_OK = qw(helper format_output);\n48: sub new {\n49: my ($class, %args) = @_;\n50: croak \"name is required\" unless $args{name};\n51: my $self = bless {\n52: name => $args{name},\n53: age => $args{age} || 0,\n54: _items => [],\n55: _cache => {},\n56: }, $class;\n57: return $self;\n58: }\n62: sub name {\n63: my ($self, $val) = @_;\n64: if (defined $val) {\n66: $self->{name} = $val;\n67: return $self;\n68: }\n69: return $self->{name};\n70: }\n74: sub is_valid {\n75: my ($self) = @_;\n76: return defined($self->{name}) && length($self->{name}) > 0 ? 1 : 0;\n77: }\n83: sub greet {\n84: my ($name) = @_;\n86: unless (defined $name) {\n87: warn \"greet called without name\";\n88: return;\n89: }\n90: print \"Hello $name\\n\";\n91: }\n95: sub process {\n96: return 1;\n97: }\n102: sub format_output {\n103: my (@items) = @_;\n104: if (wantarray()) {\n106: return map { uc($_) } @items;\n107: } else {\n109: return scalar @items;\n110: }\n111: }\n115: sub helper {\n116: return \"ok\";\n117: }\n124: sub extract_emails {\n125: my ($text) = @_;\n126: my @emails;\n128: while ($text =~ /\\b([\\w.+-]+@[\\w-]+\\.[\\w.]+)\\b/g) {\n129: push @emails, $1;\n130: }\n131: return @emails;\n132: }\n139: sub replace_all {\n140: my ($text, $pattern, $replacement) = @_;\n141: $text =~ s/$pattern/$replacement/g;\n142: return $text;\n143: }\n150: sub make_multiplier {\n151: my ($factor) = @_;\n153: return sub {\n154: my ($x) = @_;\n155: return $x * $factor;\n156: };\n157: }\n162: my %dispatch = (\n163: add => sub { $_[0] + $_[1] },\n164: sub => sub { $_[0] - $_[1] },\n165: mul => sub { $_[0] * $_[1] },\n166: div => sub {\n167: croak \"Division by zero\" if $_[1] == 0;\n168: return $_[0] / $_[1];\n169: },\n170: );\n178: sub dispatch {\n179: my ($op, $a, $b) = @_;\n180: my $handler = $dispatch{$op}\n181: or croak \"Unknown operation: $op\";\n182: return $handler->($a, $b);\n183: }\n190: sub generate_template {\n191: my ($name) = @_;\n192: return <<END_TEMPLATE;\n193: Dear $name,\n195: This is a generated template.\n196: Version: $VERSION\n197: Max size: @{[ MAX_SIZE ]}\n199: Regards,\n200: The System\n201: END_TEMPLATE\n202: }\n210: sub AUTOLOAD {\n211: my ($self, @args) = @_;\n212: our $AUTOLOAD;\n214: my $method = $AUTOLOAD;\n215: $method =~ s/.*:://;\n216: return if $method eq 'DESTROY';\n218: if ($method =~ /^get_(\\w+)$/) {\n219: my $attr = $1;\n220: return $self->{$attr};\n221: }\n222: croak \"Undefined method: $method\";\n223: }\n230: sub safe_execute {\n231: my ($code) = @_;\n232: my $result = eval {\n233: $code->();\n234: };\n235: if ($@) {\n237: warn \"Caught error: $@\";\n238: return undef;\n239: }\n240: return $result;\n241: }\n243: 1;\n248: package Extra::One;\n249: package Extra::Two;\n250: package Extra::Three;\n251: package Extra::Four;\n252: use constant RETRY_LIMIT => 5;\n253: use constant API_HOST => 'localhost';\n254: use constant FEATURE_FLAG => 1;\n255: use constant CACHE_SIZE => 256;\n256: use constant DEFAULT_USER => 'guest';\n257: use lib 'lib';\n265: sub req_cover_perl_1 {\n266: my ($value) = @_;\n267: return $value + 1;\n268: }\n275: sub req_cover_perl_2 {\n276: my ($value) = @_;\n277: return $value + 2;\n278: }\n285: sub req_cover_perl_3 {\n286: my ($value) = @_;\n287: return $value + 3;\n288: }\n295: sub req_cover_perl_4 {\n296: my ($value) = @_;\n297: return $value + 4;\n298: }\n305: sub req_cover_perl_5 {\n306: my ($value) = @_;\n307: return $value + 5;\n308: }\n```\n\n@@@ src/fixture_php.php | php\n> Lines: 1-431\n```\n1: <?php\n12: namespace App\\Models;\n14: use App\\Contracts\\Repository;\n15: use App\\Events\\{ModelCreated, ModelDeleted};\n16: use Psr\\Log\\LoggerInterface;\n17: require_once 'config.php';\n22: const VERSION = \"1.0\";\n25: const MAX_PER_PAGE = 50;\n33: enum Status: string {\n35: case Draft = 'draft';\n37: case Published = 'published';\n39: case Archived = 'archived';\n45: public function isActive(): bool {\n46: return $this === self::Published;\n47: }\n53: public function label(): string {\n54: return match($this) {\n55: self::Draft => 'Draft',\n56: self::Published => 'Published',\n57: self::Archived => 'Archived',\n58: };\n59: }\n60: }\n69: abstract class BaseModel {\n75: public function __construct(\n76: public readonly int $id,\n77: public readonly \\DateTimeImmutable $createdAt = new \\DateTimeImmutable(),\n78: ) {}\n84: public function save(): bool {\n86: if (!$this->validate()) {\n87: return false;\n88: }\n89: return true;\n90: }\n96: abstract protected function validate(): bool;\n102: private static function validateConstraints(): bool {\n103: return true;\n104: }\n110: abstract public function toArray(): array;\n111: }\n120: final class User extends BaseModel {\n122: private string $name;\n125: private ?string $email;\n133: public function __construct(\n134: int $id,\n135: string $name,\n136: ?string $email = null,\n137: ) {\n138: parent::__construct($id);\n139: $this->name = $name;\n140: $this->email = $email;\n141: }\n147: public function getName(): string {\n148: return $this->name;\n149: }\n155: public function getIdentifier(): string|int {\n157: return $this->email ?? $this->id;\n158: }\n164: protected function validate(): bool {\n165: return strlen($this->name) > 0;\n166: }\n172: public function toArray(): array {\n173: return [\n174: 'id' => $this->id,\n175: 'name' => $this->name,\n176: 'email' => $this->email,\n177: ];\n178: }\n179: }\n187: interface Repo {\n192: public function findAll(): iterable;\n199: public function findById(int $id): ?BaseModel;\n206: public function count(array $criteria = []): int;\n207: }\n215: trait Cacheable {\n217: protected int $cacheTtl = 3600;\n223: public function cache(): bool {\n225: return true;\n226: }\n232: public function invalidateCache(): void {\n234: }\n240: abstract public function cacheKey(): string;\n241: }\n247: trait SoftDeletable {\n249: protected ?\\DateTimeImmutable $deletedAt = null;\n255: public function softDelete(): void {\n256: $this->deletedAt = new \\DateTimeImmutable();\n257: }\n263: public function isDeleted(): bool {\n264: return $this->deletedAt !== null;\n265: }\n266: }\n275: final class CachedUser extends User {\n276: use Cacheable;\n277: use SoftDeletable;\n283: public function cacheKey(): string {\n284: return \"user:{$this->id}\";\n285: }\n286: }\n294: #[\\Attribute(\\Attribute::TARGET_METHOD | \\Attribute::IS_REPEATABLE)]\n295: class Route {\n301: public function __construct(\n302: public readonly string $path,\n303: public readonly string $method = 'GET',\n304: ) {}\n305: }\n314: function helper(): bool {\n315: return true;\n316: }\n324: function processData(mixed $data): string {\n326: return match(true) {\n327: is_string($data) => \"string: \" . strlen($data),\n328: is_int($data) => \"int: $data\",\n329: is_array($data) => \"array: \" . count($data),\n330: $data instanceof BaseModel => \"model: \" . $data->id,\n331: default => \"unknown\",\n332: };\n333: }\n342: function applyTransform(array $items, callable $fn): array {\n343: return array_map(fn(int $x): int => $fn($x), $items);\n344: }\n352: function createMultiplier(int $factor): \\Closure {\n354: return fn(int $x): int => $x * $factor;\n355: }\n363: function readFileContent(string $path): string|false {\n364: if (!file_exists($path)) {\n365: return false;\n366: }\n367: return file_get_contents($path);\n368: }\n371: namespace App\\Services;\n372: namespace App\\Http;\n373: namespace App\\Domain;\n374: namespace App\\Support;\n375: interface ServiceContract {}\n376: interface CacheContract {}\n377: interface LoggerContract {}\n378: interface EventContract {}\n379: trait HandlesEvents {}\n380: trait TracksChanges {}\n381: trait AuthorizesRequests {}\n382: const API_LIMIT = 50;\n383: const DEFAULT_PAGE = 1;\n384: const TIMEOUT = 30;\n385: final class ApiClient {}\n395: function req_cover_php_1(int $value): int { return $value + 1; }\n404: function req_cover_php_2(int $value): int { return $value + 2; }\n413: function req_cover_php_3(int $value): int { return $value + 3; }\n422: function req_cover_php_4(int $value): int { return $value + 4; }\n431: function req_cover_php_5(int $value): int { return $value + 5; }\n```\n\n@@@ src/fixture_python.py | python\n> Lines: 1-500\n```\n1: #!/usr/bin/env python3\n7: import asyncio\n8: import os\n9: import sys\n10: from pathlib import Path\n11: from typing import (\n12: Optional, List, Dict, Union, Protocol,\n13: TypeVar, Generic, Iterator, AsyncIterator\n14: )\n15: from dataclasses import dataclass, field\n16: from abc import ABC, abstractmethod\n17: from contextlib import contextmanager\n19: MAX_RETRIES = 3\n20: DEFAULT_TIMEOUT = 30.0\n21: _INTERNAL_CACHE: Dict[str, int] = {}\n23: T = TypeVar(\"T\")\n26: @dataclass(slots=True)\n27: class Config:\n35: name: str\n36: values: Dict[str, str] = field(default_factory=dict)\n37: debug: bool = False\n39: def get(self, key: str, default: str = \"\") -> str:\n47: if key in self.values:\n48: return self.values[key]\n50: return default\n52: def __post_init__(self) -> None:\n58: if not self.name.strip():\n59: raise ValueError(\"Config name cannot be empty\")\n62: class MyClass:\n69: class InnerHelper:\n74: def __init__(self, tag: str):\n79: self.tag = tag\n81: def describe(self) -> str:\n86: return f\"Helper({self.tag})\"\n88: def __init__(self, name: str, retries: int = MAX_RETRIES):\n94: self._name = name\n95: self._retries = retries\n97: self._call_count = 0\n99: @property\n100: def name(self) -> str:\n105: return self._name\n107: @name.setter\n108: def name(self, value: str) -> None:\n114: if not value:\n115: raise ValueError(\"Name cannot be empty\")\n116: self._name = value\n118: @staticmethod\n119: def create_default() -> \"MyClass\":\n124: return MyClass(\"default\")\n126: @classmethod\n127: def from_dict(cls, data: dict) -> \"MyClass\":\n134: return cls(\n135: name=data[\"name\"],\n136: retries=data.get(\"retries\", MAX_RETRIES),\n137: )\n139: def process(self, items: List[str], *, verbose: bool = False) -> Optional[str]:\n146: self._call_count += 1\n147: for item in items:\n149: if not item.strip():\n150: continue\n151: if verbose:\n152: print(f\"Processing: {item}\")\n154: return item if len(item) > 1 else item.upper()\n155: return None\n157: def compute(self, x: int, y: int) -> int:\n165: return (x + y) if (x > 0 and y > 0) else abs(x - y)\n168: class AbstractProcessor(ABC):\n178: @abstractmethod\n179: def execute(self, data: bytes) -> bool:\n185: ...\n187: @abstractmethod\n188: async def execute_async(self, data: bytes) -> bool:\n194: ...\n197: class ConcreteProcessor(AbstractProcessor):\n206: def execute(self, data: bytes) -> bool:\n213: try:\n214: text = data.decode(\"utf-8\")\n216: return bool(text.strip())\n217: except UnicodeDecodeError:\n218: return False\n219: finally:\n221: pass\n223: async def execute_async(self, data: bytes) -> bool:\n229: return self.execute(data)\n232: class GenericContainer(Generic[T]):\n242: def __init__(self) -> None:\n244: self._items: List[T] = []\n246: def add(self, item: T) -> None:\n251: self._items.append(item)\n253: def __iter__(self) -> Iterator[T]:\n258: yield from self._items\n260: def find(self, predicate) -> Optional[T]:\n266: for item in self._items:\n267: if predicate(item):\n268: return item\n269: return None\n272: class Renderable(Protocol):\n278: def render(self) -> str:\n283: ...\n286: @property\n287: def regular_function(x: int) -> int:\n293: return x\n296: def function_with_walrus(data: List[int]) -> Optional[int]:\n303: if (n := next((x for x in data if x > 10), None)) is not None:\n304: return n\n305: return None\n308: def multi_return_paths(value: int) -> Union[str, int, None]:\n314: match value:\n315: case 0:\n316: return \"zero\"\n317: case n if n < 0:\n319: return abs(n)\n320: case n if n > 100:\n321: return None\n322: case _:\n323: return str(value)\n326: def generator_function(limit: int) -> Iterator[int]:\n332: for i in range(limit):\n334: yield i * i\n337: async def async_generator(items: List[str]) -> AsyncIterator[str]:\n343: for item in items:\n344: if item.strip():\n345: yield item.upper()\n348: @contextmanager\n349: def managed_resource(path: str):\n356: f = open(path, \"r\")\n357: try:\n358: yield f\n359: finally:\n360: f.close()\n363: def closure_factory(multiplier: int):\n369: def inner(x: int) -> int:\n376: return x * multiplier\n377: return inner\n380: def uses_unpacking(*args: int, **kwargs: str) -> Dict[str, Union[int, str]]:\n387: result: Dict[str, Union[int, str]] = {}\n388: for i, val in enumerate(args):\n389: result[f\"arg_{i}\"] = val\n390: result.update(kwargs)\n391: return result\n395: transform = lambda x: x * 2 + 1\n398: EVEN_SQUARES = [x ** 2 for x in range(20) if x % 2 == 0]\n401: async def async_function():\n406: await asyncio.sleep(0)\n409: def deeply_nested_logic(matrix: List[List[int]]) -> int:\n415: total = 0\n416: for row in matrix:\n417: for val in row:\n418: if val > 0:\n419: if val % 2 == 0:\n421: total += val\n422: else:\n423: continue\n424: else:\n426: pass\n427: return total\n430: def exception_handling_example(path: str) -> Optional[str]:\n436: try:\n437: with open(path, \"r\") as f:\n438: content = f.read()\n439: if not content:\n440: raise ValueError(\"Empty file\")\n441: return content\n442: except FileNotFoundError:\n444: return None\n445: except (PermissionError, OSError) as e:\n447: sys.exit(1)\n448: except Exception:\n449: raise\n450: finally:\n452: pass\n455: MAX_BATCH = 64\n457: CACHE_LIMIT = 128\n459: MAX_USERS = 500\n467: def req_cover_py_1(value: int) -> int:\n468: return value + 1\n475: def req_cover_py_2(value: int) -> int:\n476: return value + 2\n483: def req_cover_py_3(value: int) -> int:\n484: return value + 3\n491: def req_cover_py_4(value: int) -> int:\n492: return value + 4\n499: def req_cover_py_5(value: int) -> int:\n500: return value + 5\n```\n\n@@@ src/fixture_ruby.rb | ruby\n> Lines: 10-343\n```\n10: require 'json'\n11: require 'set'\n12: require_relative 'helper'\n15: MAX_RETRIES = 42\n18: DEFAULT_ENCODING = 'utf-8'.freeze\n20: attr_accessor :name, :age\n26: module Loggable\n29: def log(message)\n30: puts \"[#{self.class.name}] #{message}\"\n31: end\n35: def log_error(error)\n36: puts \"[ERROR] #{error.message}\"\n37: puts error.backtrace.first(5).join(\"\\n\") if error.backtrace\n38: end\n39: end\n47: class MyClass\n48: include Loggable\n49: include Comparable\n52: attr_accessor :name\n55: attr_reader :created_at\n60: def initialize(name, **options)\n61: @name = name\n62: @options = options\n63: @created_at = Time.now\n65: @options[:retries] ||= MAX_RETRIES\n66: end\n71: def self.create(attrs)\n72: new(attrs[:name], **attrs.except(:name))\n73: end\n78: def self.bulk_create(names)\n79: names.map { |n| new(n) }\n80: end\n84: def valid?\n85: !@name.nil? && !@name.empty?\n86: end\n91: def matches?(pattern)\n92: return false if @name.nil?\n93: pattern.match?(@name)\n94: end\n99: def <=>(other)\n100: @name <=> other.name\n101: end\n106: def +(other)\n107: self.class.new(\"#{@name}+#{other.name}\")\n108: end\n112: def to_s\n113: \"MyClass(#{@name})\"\n114: end\n121: def method_missing(method, *args, &block)\n122: if method.to_s.start_with?('find_by_')\n123: field = method.to_s.sub('find_by_', '')\n124: \"Finding by #{field}: #{args.first}\"\n125: else\n126: super\n127: end\n128: end\n134: def respond_to_missing?(method, include_private = false)\n135: method.to_s.start_with?('find_by_') || super\n136: end\n138: protected\n142: def internal_config\n143: @options.dup\n144: end\n146: private\n150: def validate!\n151: raise \"Invalid name\" unless valid?\n152: end\n153: end\n160: class SpecialClass < MyClass\n164: def initialize(name, priority: 0, **options)\n165: super(name, **options)\n166: @priority = priority\n167: end\n171: def to_s\n172: \"SpecialClass(#{@name}, pri=#{@priority})\"\n173: end\n174: end\n180: module MyModule\n183: def helper\n184: true\n185: end\n191: def process_with_block(data)\n192: if block_given?\n193: yield(data)\n194: else\n195: data\n196: end\n197: end\n204: def self.format_list(items)\n205: items.map(&:to_s).join(', ')\n206: end\n207: end\n213: Coordinate = Struct.new(:x, :y) do\n216: def distance_from_origin\n217: Math.sqrt(x**2 + y**2)\n218: end\n219: end\n225: class DynamicModel\n227: %w[title body author].each do |field|\n229: define_method(field) do\n230: instance_variable_get(\"@#{field}\")\n231: end\n234: define_method(\"#{field}=\") do |value|\n235: instance_variable_set(\"@#{field}\", value)\n236: end\n237: end\n238: end\n243: doubler = ->(x) { x * 2 }\n246: greeting_proc = Proc.new { |name| \"Hello, #{name}!\" }\n255: def with_retry(attempts: MAX_RETRIES)\n256: tries = 0\n257: begin\n258: tries += 1\n259: yield\n260: rescue StandardError => e\n262: retry if tries < attempts\n263: raise \"Failed after #{attempts} attempts: #{e.message}\"\n264: ensure\n266: puts \"Completed after #{tries} attempt(s)\"\n267: end\n268: end\n274: module StringExtensions\n275: refine String do\n278: def email?\n279: match?(/\\A[\\w+\\-.]+@[a-z\\d\\-]+(\\.[a-z\\d\\-]+)*\\.[a-z]+\\z/i)\n280: end\n281: end\n282: end\n287: class ServiceObject; end\n288: class ReportBuilder; end\n289: module Metrics; end\n290: module Extras; end\n291: MAX_LIMIT = 100\n292: API_VERSION = \"v2\"\n293: CACHE_SIZE = 1024\n294: attr_writer :token\n295: attr_reader :state\n296: require 'yaml'\n297: require 'logger'\n305: def req_cover_ruby_1(value)\n306: value + 1\n307: end\n314: def req_cover_ruby_2(value)\n315: value + 2\n316: end\n323: def req_cover_ruby_3(value)\n324: value + 3\n325: end\n332: def req_cover_ruby_4(value)\n333: value + 4\n334: end\n341: def req_cover_ruby_5(value)\n342: value + 5\n343: end\n```\n\n@@@ src/fixture_rust.rs | rust\n> Lines: 9-378\n```\n9: use std::io;\n10: use std::collections::HashMap;\n11: use std::fmt::{self, Display, Formatter};\n12: use std::sync::{Arc, Mutex};\n19: #[derive(Debug, Clone, PartialEq)]\n20: pub struct MyStruct {\n22: field: i32,\n23: }\n29: #[derive(Debug)]\n30: pub struct BorrowedData<'a> {\n32: content: &'a str,\n34: tag: u64,\n35: }\n41: pub struct TypedMap<K: std::hash::Hash + Eq, V: Clone> {\n43: inner: HashMap<K, V>,\n44: }\n51: pub enum MyEnum {\n53: A,\n55: B(String),\n57: C { x: i32, y: i32 },\n58: }\n65: pub trait MyTrait {\n67: fn do_work(&self);\n73: fn do_work_with_ctx(&self, ctx: &str) -> bool {\n75: println!(\"ctx: {}\", ctx);\n76: self.do_work();\n77: true\n78: }\n79: }\n85: pub trait Parser<'a> {\n87: type Output;\n93: fn parse(&self, input: &'a [u8]) -> Result<Self::Output, io::Error>;\n94: }\n96: impl MyStruct {\n100: fn new() -> Self {\n101: Self { field: 0 }\n102: }\n108: pub fn with_value(val: i32) -> Self {\n109: Self { field: val }\n110: }\n115: pub fn value(&self) -> i32 {\n116: self.field\n117: }\n123: pub fn try_update(&mut self, new_val: i32) -> Option<i32> {\n124: if new_val == self.field {\n125: return None;\n126: }\n127: let old = self.field;\n128: self.field = new_val;\n130: Some(old)\n131: }\n132: }\n134: impl MyTrait for MyStruct {\n136: fn do_work(&self) {\n137: println!(\"{:?}\", self);\n138: }\n139: }\n141: impl Display for MyStruct {\n146: fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {\n147: write!(f, \"MyStruct({})\", self.field)\n148: }\n149: }\n153: impl<K, V> TypedMap<K, V>\n154: where\n155: K: std::hash::Hash + Eq + Display,\n156: V: Clone + Default,\n157: {\n163: pub fn insert(&mut self, key: K, value: V) -> Option<V> {\n164: self.inner.insert(key, value)\n165: }\n171: pub fn get_or_default(&self, key: &K) -> V {\n172: match self.inner.get(key) {\n173: Some(v) => v.clone(),\n174: None => V::default(),\n175: }\n176: }\n177: }\n182: pub mod my_module;\n185: pub(crate) mod internal {\n187: pub(crate) static COUNTER: std::sync::atomic::AtomicUsize =\n188: std::sync::atomic::AtomicUsize::new(0);\n189: }\n196: macro_rules! hashmap {\n197: ($($key:expr => $val:expr),* $(,)?) => {{\n198: let mut map = HashMap::new();\n199: $(map.insert($key, $val);)*\n200: map\n201: }};\n202: }\n205: macro_rules! my_macro {\n206: () => {};\n207: ($x:expr) => { println!(\"{}\", $x) };\n208: ($x:expr, $($rest:expr),+) => {\n209: print!(\"{}, \", $x);\n210: my_macro!($($rest),+);\n211: };\n212: }\n217: const MY_CONST: i32 = 42;\n220: static MY_STATIC: i32 = 0;\n223: static CONFIG: std::sync::LazyLock<HashMap<String, String>> =\n224: std::sync::LazyLock::new(|| HashMap::new());\n229: pub type IoResult<T> = Result<T, io::Error>;\n232: pub type MyAlias = i32;\n240: pub fn my_function(input: Option<&str>) -> String {\n242: let text = match input {\n243: Some(s) if !s.is_empty() => s,\n244: Some(_) => return String::from(\"empty\"),\n245: None => return String::from(\"none\"),\n246: };\n248: text.to_uppercase()\n249: }\n254: pub async fn async_function() -> String {\n256: String::from(\"hello async\")\n257: }\n264: pub fn filter_with<F>(items: &[i32], predicate: F) -> Vec<i32>\n265: where\n266: F: Fn(&i32) -> bool,\n267: {\n268: items.iter().copied().filter(|x| predicate(x)).collect()\n269: }\n275: pub fn create_worker(use_struct: bool) -> Box<dyn MyTrait> {\n276: if use_struct {\n277: Box::new(MyStruct::new())\n278: } else {\n279: panic!(\"No alternative implementation available\");\n280: }\n281: }\n288: pub unsafe fn read_raw(ptr: *const i32) -> i32 {\n290: *ptr\n291: }\n297: pub extern \"C\" fn ffi_double(x: i32) -> i32 {\n298: x * 2\n299: }\n305: pub fn describe_enum(val: &MyEnum) -> String {\n306: match val {\n307: MyEnum::A => String::from(\"unit\"),\n308: MyEnum::B(s) => format!(\"string: {}\", s),\n309: MyEnum::C { x, y } => {\n311: let mag = ((x * x + y * y) as f64).sqrt();\n312: format!(\"point({}, {}) mag={:.2}\", x, y, mag)\n313: }\n314: }\n315: }\n318: use std::time::Duration;\n319: pub mod ext_tools { pub fn id() -> i32 { 1 } }\n320: mod ext_local { pub fn ping() -> i32 { 2 } }\n321: pub mod ext_api { pub fn pong() -> i32 { 3 } }\n322: #[inline]\n323: #[allow(dead_code)]\n324: #[cfg(test)]\n325: pub enum Status { Ready, Busy }\n326: pub enum Mode { Alpha, Beta }\n327: pub enum Signal { On, Off }\n328: pub enum ErrorKind { Io, Parse }\n329: pub struct ExtraNode { pub id: i32 }\n330: struct InnerNode { id: i32 }\n331: pub trait Inspectable { fn inspect(&self) -> i32; }\n332: trait Named { fn name(&self) -> &'static str; }\n333: pub trait Executable { fn exec(&self) -> i32; }\n334: impl Inspectable for ExtraNode { fn inspect(&self) -> i32 { self.id } }\n335: impl Named for InnerNode { fn name(&self) -> &'static str { \"inner\" } }\n336: impl Executable for MyEnum { fn exec(&self) -> i32 { 1 } }\n337: macro_rules! ext_macro { () => { 42 } }\n338: macro_rules! trace_macro { ($v:expr) => { $v }; }\n339: macro_rules! build_pair { ($a:expr,$b:expr) => { ($a,$b) }; }\n340: pub const LIMIT: usize = 8;\n341: pub type ItemId = u64;\n342: type AliasValue = i32;\n350: fn req_cover_rust_1(value: i32) -> i32 { value + 1 }\n357: fn req_cover_rust_2(value: i32) -> i32 { value + 2 }\n364: fn req_cover_rust_3(value: i32) -> i32 { value + 3 }\n371: fn req_cover_rust_4(value: i32) -> i32 { value + 4 }\n378: fn req_cover_rust_5(value: i32) -> i32 { value + 5 }\n```\n\n@@@ src/fixture_scala.scala | scala\n> Lines: 11-397\n```\n11: import scala.collection.mutable\n12: import scala.concurrent.{Future, ExecutionContext}\n13: import scala.util.{Try, Success, Failure}\n23: case class Person(name: String, age: Int) {\n28: def isAdult: Boolean = age >= 18\n34: def greet: String = s\"Hi, I'm $name, age $age\"\n35: }\n43: sealed trait Shape {\n48: def area: Double\n49: }\n56: case class Circle(radius: Double) extends Shape {\n57: override def area: Double = math.Pi * radius * radius\n58: }\n66: case class Rectangle(width: Double, height: Double) extends Shape {\n67: override def area: Double = width * height\n68: }\n76: abstract class Animal {\n81: def sound: String\n87: def describe: String = s\"I am a ${getClass.getSimpleName} and I say $sound\"\n88: }\n96: trait Drawable {\n101: def draw(): Unit\n102: }\n109: trait Logging { self: Drawable =>\n113: def logAndDraw(): Unit = {\n114: println(\"About to draw\")\n115: draw()\n116: }\n117: }\n123: trait Serializable {\n128: def serialize: Array[Byte]\n129: }\n137: object Main {\n142: def main(args: Array[String]): Unit = {\n143: val people = List(Person(\"Alice\", 30), Person(\"Bob\", 17))\n145: val adults = people.filter(_.isAdult)\n146: adults.foreach(p => println(p.greet))\n147: }\n153: override def toString: String = \"Main\"\n156: val pi = 3.14159265\n159: var counter = 0\n164: type StringList = List[String]\n169: type Transformer[A] = A => A\n176: def describeShape(shape: Shape): String = shape match {\n177: case Circle(r) => s\"Circle with radius $r, area=${shape.area}\"\n178: case Rectangle(w, h) => s\"Rectangle ${w}x${h}, area=${shape.area}\"\n179: }\n186: def classify(x: Int): String = x match {\n187: case 0 => \"zero\"\n188: case n if n < 0 => \"negative\"\n189: case n if n > 100 => \"large\"\n190: case _ => \"positive\"\n191: }\n192: }\n201: class Config private (val entries: Map[String, String]) {\n207: def get(key: String): Option[String] = entries.get(key)\n208: }\n214: object Config {\n220: def apply(entries: (String, String)*): Config = new Config(entries.toMap)\n226: def empty: Config = new Config(Map.empty)\n227: }\n236: class Container[+A](val value: A) {\n243: def map[B](f: A => B): Container[B] = new Container(f(value))\n251: def flatMap[B](f: A => Container[B]): Container[B] = f(value)\n252: }\n261: implicit class RichInt(val n: Int) extends AnyVal {\n266: def isEven: Boolean = n % 2 == 0\n273: def times(s: String): String = s * n\n274: }\n282: object ForCompExample {\n289: def findPairs(range: Int, target: Int): List[(Int, Int)] = {\n290: for {\n291: x <- (1 to range).toList\n292: y <- (x to range).toList\n293: if x + y == target\n294: } yield (x, y)\n295: }\n296: }\n304: object FuncUtils {\n311: def add(a: Int)(b: Int): Int = a + b\n320: def twice[A](f: A => A)(x: A): A = f(f(x))\n331: def compose[A, B, C](f: A => B, g: B => C): A => C = a => g(f(a))\n332: }\n335: import scala.util.Random\n336: import scala.concurrent.duration._\n337: trait Runner\n338: trait Parser\n339: object Metrics\n340: val MaxUsers = 100\n341: val RetryLimit = 3\n342: type UserKey = String\n343: type ErrorCode = Int\n344: type Mapper = String => String\n345: var attempts = 0\n346: var cursor = 1\n347: var stage = \"init\"\n348: var status = \"ready\"\n351: object ReqCoverScala {\n359: def reqCoverScala1(value: Int): Int = value + 1\n368: def reqCoverScala2(value: Int): Int = value + 2\n377: def reqCoverScala3(value: Int): Int = value + 3\n386: def reqCoverScala4(value: Int): Int = value + 4\n395: def reqCoverScala5(value: Int): Int = value + 5\n397: }\n```\n\n@@@ src/fixture_shell.sh | shell\n> Lines: 1-274\n```\n1: #!/bin/bash\n12: MY_VAR=\"hello\"\n15: export PATH_EXT=\"/usr/local/bin\"\n18: readonly MAX_COUNT=10\n21: declare -r BUILD_VERSION=\"1.0.0\"\n24: DEBUG_MODE=0\n29: declare -a LANGUAGES=(\"python\" \"rust\" \"go\" \"java\" \"typescript\")\n32: declare -A EXT_MAP=(\n33: [py]=\"python\"\n34: [rs]=\"rust\"\n35: [go]=\"go\"\n36: [java]=\"java\"\n37: [ts]=\"typescript\"\n38: )\n44: function greet() {\n45: local name=\"${1:?Name required}\"\n47: if [[ -z \"$name\" ]]; then\n48: echo \"Error: empty name\" >&2\n49: return 1\n50: fi\n51: echo \"Hello ${name}!\"\n52: }\n56: cleanup() {\n57: local tmp_dir=\"${TMPDIR:-<PROJECT_PARENT>}/myapp_$$\"\n58: if [[ -d \"$tmp_dir\" ]]; then\n60: rm -rf \"$tmp_dir\"\n61: fi\n62: echo \"Cleanup complete\"\n63: }\n68: parse_args() {\n69: local opt\n70: while getopts \"vdhf:o:\" opt; do\n71: case \"$opt\" in\n72: v)\n74: VERBOSE=1\n75: ;;\n76: d)\n78: DEBUG_MODE=1\n79: ;;\n80: f)\n82: INPUT_FILE=\"$OPTARG\"\n83: ;;\n84: o)\n86: OUTPUT_FILE=\"$OPTARG\"\n87: ;;\n88: h)\n89: echo \"Usage: $0 [-v] [-d] [-f file] [-o output] [-h]\"\n90: return 0\n91: ;;\n92: *)\n93: echo \"Unknown option: $opt\" >&2\n94: return 1\n95: ;;\n96: esac\n97: done\n98: shift $((OPTIND - 1))\n99: }\n105: process_file() {\n106: local input=\"$1\"\n107: local output=\"${2:-/dev/stdout}\"\n110: if [[ ! -f \"$input\" ]]; then\n111: echo \"Error: file not found: $input\" >&2\n112: return 1\n113: fi\n115: if [[ ! -r \"$input\" ]]; then\n116: echo \"Error: file not readable: $input\" >&2\n117: return 1\n118: fi\n121: local line_count\n122: line_count=$(wc -l < \"$input\")\n123: echo \"Processing $input ($line_count lines)\" >&2\n126: while IFS= read -r line; do\n128: [[ -z \"$line\" || \"$line\" =~ ^[[:space:]]*\n129: echo \"$line\"\n130: done < \"$input\" > \"$output\"\n132: return 0\n133: }\n139: retry_command() {\n140: local max_attempts=\"$1\"\n141: shift\n142: local attempt=1\n144: while (( attempt <= max_attempts )); do\n146: if \"$@\"; then\n147: return 0\n148: fi\n149: echo \"Attempt $attempt/$max_attempts failed\" >&2\n150: (( attempt++ ))\n152: sleep $(( 2 ** (attempt - 1) ))\n153: done\n155: echo \"All $max_attempts attempts failed\" >&2\n156: return 1\n157: }\n162: log_message() {\n163: local level=\"$1\"\n164: shift\n165: local timestamp\n166: timestamp=$(date '+%Y-%m-%d %H:%M:%S')\n167: echo \"[$timestamp] [$level] $*\" >&2\n168: }\n172: make_temp() {\n173: local tmpfile\n174: tmpfile=$(mktemp \"${TMPDIR:-<PROJECT_PARENT>}/myapp_XXXXXX\")\n175: echo \"$tmpfile\"\n176: }\n181: trap cleanup EXIT\n184: trap 'echo \"Interrupted\"; exit 130' INT TERM\n189: generate_config() {\n190: cat <<EOF\n192: version=${BUILD_VERSION}\n193: debug=${DEBUG_MODE}\n194: max_count=${MAX_COUNT}\n195: EOF\n196: }\n203: factorial() {\n204: local n=\"${1:-1}\"\n205: local result=1\n206: local i\n207: for (( i = 2; i <= n; i++ )); do\n209: (( result *= i ))\n210: done\n211: echo \"$result\"\n212: }\n217: if [[ -f ./config.sh ]]; then\n218: source ./config.sh\n219: fi\n222: source ./env.sh\n223: . ./helpers.sh\n224: source ./shared.sh\n225: . ./paths.sh\n226: source ./runtime.sh\n227: . ./exports.sh\n228: source ./network.sh\n236: req_cover_shell_1() {\n237: echo \"$(( $1 + 1 ))\"\n238: }\n245: req_cover_shell_2() {\n246: echo \"$(( $1 + 2 ))\"\n247: }\n254: req_cover_shell_3() {\n255: echo \"$(( $1 + 3 ))\"\n256: }\n263: req_cover_shell_4() {\n264: echo \"$(( $1 + 4 ))\"\n265: }\n272: req_cover_shell_5() {\n273: echo \"$(( $1 + 5 ))\"\n274: }\n```\n\n@@@ src/fixture_swift.swift | swift\n> Lines: 8-395\n```\n8: import Foundation\n9: import Combine\n16: class Animal {\n18: var species: String\n21: var legs: Int = 4 {\n22: willSet {\n24: print(\"Legs changing from \\(legs) to \\(newValue)\")\n25: }\n26: didSet {\n28: if legs < 0 { legs = 0 }\n29: }\n30: }\n33: var description: String {\n34: return \"\\(species) with \\(legs) legs\"\n35: }\n39: init(species: String) {\n40: self.species = species\n41: }\n44: func speak() {\n45: print(\"...\")\n46: }\n50: class func createDefault() -> Animal {\n51: return Animal(species: \"Unknown\")\n52: }\n55: deinit {\n56: print(\"\\(species) deallocated\")\n57: }\n58: }\n63: class Dog: Animal {\n65: let name: String\n69: init(name: String) {\n70: self.name = name\n71: super.init(species: \"Dog\")\n72: }\n75: override func speak() {\n76: print(\"\\(name) says: Woof!\")\n77: }\n78: }\n85: struct Point: Equatable {\n86: var x: Double = 0.0\n87: var y: Double = 0.0\n93: static func + (lhs: Point, rhs: Point) -> Point {\n94: return Point(x: lhs.x + rhs.x, y: lhs.y + rhs.y)\n95: }\n99: var magnitude: Double {\n100: return (x * x + y * y).squareRoot()\n101: }\n102: }\n107: struct Matrix {\n109: private var data: [[Double]]\n112: let rows: Int\n114: let cols: Int\n119: init(rows: Int, cols: Int) {\n120: self.rows = rows\n121: self.cols = cols\n122: data = Array(repeating: Array(repeating: 0.0, count: cols), count: rows)\n123: }\n129: subscript(row: Int, col: Int) -> Double {\n130: get { return data[row][col] }\n131: set { data[row][col] = newValue }\n132: }\n133: }\n140: enum Direction: String, CaseIterable {\n141: case up = \"UP\"\n142: case down = \"DOWN\"\n143: case left = \"LEFT\"\n144: case right = \"RIGHT\"\n148: var opposite: Direction {\n149: switch self {\n150: case .up: return .down\n151: case .down: return .up\n152: case .left: return .right\n153: case .right: return .left\n154: }\n155: }\n156: }\n162: enum AppResult<T> {\n164: case success(T)\n166: case failure(Error)\n171: func map<U>(_ transform: (T) -> U) -> AppResult<U> {\n172: switch self {\n173: case .success(let value):\n174: return .success(transform(value))\n175: case .failure(let error):\n176: return .failure(error)\n177: }\n178: }\n179: }\n186: protocol Drawable {\n189: func draw() -> String\n192: var renderPriority: Int { get }\n193: }\n198: protocol Container {\n200: associatedtype Item\n204: mutating func add(_ item: Item)\n207: var count: Int { get }\n208: }\n212: extension Drawable {\n214: var renderPriority: Int { return 0 }\n218: func debugDraw() -> String {\n219: return \"[\\(renderPriority)] \\(draw())\"\n220: }\n221: }\n226: extension Animal: Drawable {\n229: func draw() -> String {\n230: return description\n231: }\n235: func describe() -> String {\n236: return \"Animal: \\(species)\"\n237: }\n238: }\n246: @propertyWrapper\n247: struct Clamped<Value: Comparable> {\n249: let min: Value\n251: let max: Value\n253: private var value: Value\n256: var wrappedValue: Value {\n257: get { return value }\n258: set { value = Swift.min(Swift.max(newValue, min), max) }\n259: }\n262: init(wrappedValue: Value, min: Value, max: Value) {\n263: self.min = min\n264: self.max = max\n266: self.value = Swift.min(Swift.max(wrappedValue, min), max)\n267: }\n268: }\n275: actor Counter {\n277: private var value: Int = 0\n281: func increment() -> Int {\n282: value += 1\n283: return value\n284: }\n287: func reset() {\n288: value = 0\n289: }\n290: }\n296: public func greet(name: String) {\n297: print(\"Hello \\(name)\")\n298: }\n302: func makeDrawable() -> some Drawable {\n303: return Animal(species: \"Cat\")\n304: }\n311: func contains<T: Collection>(items: T, target: T.Element) -> Bool where T.Element: Equatable {\n312: return items.contains(target)\n313: }\n318: func deferred(_ action: @escaping () -> Void) -> () -> Void {\n319: return {\n321: action()\n322: }\n323: }\n328: let MAX_SIZE = 1024\n331: private var counter = 0\n334: let defaultConfig: [String: Any] = {\n335: var config: [String: Any] = [:]\n336: config[\"debug\"] = false\n337: config[\"version\"] = \"1.0\"\n338: return config\n339: }()\n342: import SwiftUI\n343: import Combine\n344: import Foundation\n345: import Dispatch\n346: import UIKit\n347: class ServiceController {}\n348: final class CacheStore {}\n349: struct Vector2 { let x: Int; let y: Int }\n350: struct Limits { let max: Int }\n351: enum ModeSwift { case fast, safe }\n352: enum PhaseSwift { case initState, done }\n353: enum SignalSwift { case on, off }\n354: protocol RunnerSwift { func run() }\n355: protocol LoggerSwift { func log(_ msg: String) }\n356: protocol ParserSwift { func parse(_ input: String) -> String }\n357: extension String { func trimmed2() -> String { self.trimmingCharacters(in: .whitespaces) } }\n358: extension Int { func doubled2() -> Int { self * 2 } }\n359: extension Array { var isNotEmpty: Bool { !self.isEmpty } }\n367: func reqCoverSwift1(_ value: Int) -> Int { value + 1 }\n374: func reqCoverSwift2(_ value: Int) -> Int { value + 2 }\n381: func reqCoverSwift3(_ value: Int) -> Int { value + 3 }\n388: func reqCoverSwift4(_ value: Int) -> Int { value + 4 }\n395: func reqCoverSwift5(_ value: Int) -> Int { value + 5 }\n```\n\n@@@ src/fixture_typescript.ts | typescript\n> Lines: 10-432\n```\n10: import { Component } from 'react';\n11: import type { ReactNode } from 'react';\n19: interface User {\n21: name: string;\n23: age: number;\n25: email?: string;\n27: readonly id: string;\n28: }\n35: interface Repository<T> {\n37: findById(id: string): Promise<T | null>;\n39: save(entity: T): Promise<T>;\n41: delete(id: string): Promise<boolean>;\n42: }\n48: interface Serializable {\n50: toJSON(): string;\n51: }\n56: type StringOrNumber = string | number;\n59: type DeepReadonly<T> = {\n60: readonly [P in keyof T]: T[P] extends object ? DeepReadonly<T[P]> : T[P];\n61: };\n64: type Unwrap<T> = T extends Array<infer U> ? U : T;\n67: type PixelValue = `${number}px`;\n70: type ApiResponse<T> =\n71: | { status: 'success'; data: T }\n72: | { status: 'error'; message: string }\n73: | { status: 'loading' };\n76: type KeysOfType<T, V> = {\n77: [K in keyof T]: T[K] extends V ? K : never;\n78: }[keyof T];\n86: const enum Direction {\n87: Up = 'UP',\n88: Down = 'DOWN',\n89: Left = 'LEFT',\n90: Right = 'RIGHT',\n91: }\n97: enum Color {\n99: Red,\n101: Blue,\n103: Green = 10,\n104: }\n110: enum HttpStatus {\n111: OK = '200',\n112: NotFound = '404',\n113: ServerError = '500',\n114: }\n122: export abstract class Base {\n127: abstract render(): void;\n132: execute(): void {\n134: console.log('before render');\n135: this.render();\n137: console.log('after render');\n138: }\n139: }\n148: class Derived extends Base {\n150: value: number = 0;\n153: label?: string;\n158: render(): void {\n159: console.log(this.value);\n160: }\n161: }\n168: class TypedContainer<T extends Serializable> {\n170: private items: T[] = [];\n176: add(item: T): void {\n177: this.items.push(item);\n178: }\n184: toJSON(): string {\n185: return `[${this.items.map(i => i.toJSON()).join(',')}]`;\n186: }\n193: find(predicate: (item: T) => boolean): T | undefined {\n194: for (const item of this.items) {\n195: if (predicate(item)) {\n196: return item;\n197: }\n198: }\n199: return undefined;\n200: }\n201: }\n210: class UserEntity implements User, Serializable {\n211: readonly id: string;\n212: name: string;\n213: age: number;\n215: constructor(id: string, name: string, age: number) {\n216: this.id = id;\n217: this.name = name;\n218: this.age = age;\n219: }\n225: toJSON(): string {\n226: return JSON.stringify({ id: this.id, name: this.name, age: this.age });\n227: }\n228: }\n237: export function greet(name: string): void {\n238: console.log(`Hello, ${name}`);\n239: }\n249: function parse(input: string): number;\n250: function parse(input: number): string;\n251: function parse(input: string | number): string | number {\n252: if (typeof input === 'string') {\n253: return parseInt(input, 10);\n254: }\n255: return input.toString();\n256: }\n266: const add = (a: number): number => a + 1;\n275: const transform = <T extends { toString(): string }>(value: T): string => {\n276: return value.toString();\n277: };\n288: async function fetchEntity<T>(url: string): Promise<T> {\n289: const response = await fetch(url);\n291: return response.json() as Promise<T>;\n292: }\n300: export namespace MyNS {\n302: export const x = 1;\n309: export function double(val: number): number {\n310: return val * 2;\n311: }\n312: }\n320: declare module MyMod {\n322: export const version: string;\n323: }\n331: @Component\n332: class Decorated {\n334: template: string = '<div></div>';\n335: }\n345: function isUser(value: unknown): value is User {\n346: if (typeof value !== 'object' || value === null) {\n347: return false;\n348: }\n349: const obj = value as Record<string, unknown>;\n350: return typeof obj.name === 'string' && typeof obj.age === 'number';\n351: }\n359: const config = {\n360: width: '100px' as PixelValue,\n361: height: '200px' as PixelValue,\n362: } satisfies Record<string, PixelValue>;\n373: function makeOptional<T extends object>(obj: T): Partial<T> {\n374: return { ...obj };\n375: }\n378: import { Injectable } from 'inversify';\n379: import { Observable } from 'rxjs';\n380: import { FC } from 'react';\n381: @injectable\n382: @sealed\n383: @track\n384: @memoized\n385: interface CacheEntry { key: string; value: string }\n386: export interface Runner { run(): Promise<void> }\n387: enum ModeTs { Fast, Safe }\n388: enum StatusTs { Ready, Busy }\n389: namespace ExtNSOne { export const v = 1; }\n390: namespace ExtNSTwo { export const v = 2; }\n391: namespace ExtNSThree { export const v = 3; }\n392: namespace ExtNSFour { export const v = 4; }\n393: declare module ExtOne { export const one: number; }\n394: module ExtTwo { export const two = 2; }\n395: module ExtThree { export const three = 3; }\n396: module ExtFour { export const four = 4; }\n404: function reqCoverTs1(value: number): number { return value + 1; }\n411: function reqCoverTs2(value: number): number { return value + 2; }\n418: function reqCoverTs3(value: number): number { return value + 3; }\n425: function reqCoverTs4(value: number): number { return value + 4; }\n432: function reqCoverTs5(value: number): number { return value + 5; }\n```\n\n@@@ src/fixture_zig.zig | zig\n> Lines: 7-293\n```\n7: const std = @import(\"std\");\n8: const mem = @import(\"std\").mem;\n9: const Allocator = std.mem.Allocator;\n14: pub fn main() void {\n15: std.debug.print(\"Hello\\n\", .{});\n16: }\n22: pub fn add(a: i32, b: i32) i32 {\n23: return a + b;\n24: }\n30: pub fn safeDivide(numerator: i32, denominator: i32) !i32 {\n31: if (denominator == 0) {\n32: return error.DivisionByZero;\n33: }\n34: return @divTrunc(numerator, denominator);\n35: }\n42: pub fn max(comptime T: type, a: T, b: T) T {\n43: return if (a > b) a else b;\n44: }\n51: pub fn indexOf(comptime T: type, haystack: []const T, needle: T) ?usize {\n52: for (haystack, 0..) |item, i| {\n53: if (item == needle) {\n54: return i;\n55: }\n56: }\n58: return null;\n59: }\n65: pub fn comptimeConcat(comptime a: []const u8, comptime b: []const u8) []const u8 {\n66: return a ++ b;\n67: }\n72: pub fn createBuffer(allocator: Allocator) ![]u8 {\n73: const buf = try allocator.alloc(u8, 1024);\n74: errdefer allocator.free(buf);\n76: @memset(buf, 0);\n77: return buf;\n78: }\n83: inline fn fastSum(values: []const f32) f32 {\n84: var total: f32 = 0.0;\n85: for (values) |v| {\n86: total += v;\n87: }\n88: return total;\n89: }\n94: export fn doubleValue(x: i32) i32 {\n95: return x * 2;\n96: }\n102: const Point = struct {\n103: x: f64,\n104: y: f64,\n110: pub fn distSquared(self: Point, other: Point) f64 {\n111: const dx = self.x - other.x;\n112: const dy = self.y - other.y;\n113: return dx * dx + dy * dy;\n114: }\n118: pub fn origin() Point {\n119: return .{ .x = 0.0, .y = 0.0 };\n120: }\n121: };\n125: const PackedFlags = packed struct {\n126: readable: bool,\n127: writable: bool,\n128: executable: bool,\n129: reserved: u5,\n130: };\n133: const Config = struct {\n134: name: []const u8 = \"default\",\n135: max_retries: u32 = 3,\n136: timeout_ms: u64 = 5000,\n137: debug: bool = false,\n141: pub fn testing() Config {\n142: return .{ .debug = true, .name = \"test\" };\n143: }\n144: };\n149: const Color = enum {\n150: red,\n151: green,\n152: blue,\n157: pub fn toRgb(self: Color) u32 {\n158: return switch (self) {\n159: .red => 0xFF0000,\n160: .green => 0x00FF00,\n161: .blue => 0x0000FF,\n162: };\n163: }\n164: };\n167: const Status = enum(u8) {\n168: idle = 0,\n169: running = 1,\n170: error = 2,\n171: done = 3,\n172: };\n177: const Result = union(enum) {\n178: ok: i32,\n179: err: []const u8,\n184: pub fn isOk(self: Result) bool {\n185: return self == .ok;\n186: }\n187: };\n190: const ExternData = extern union {\n191: int_val: i32,\n192: float_val: f32,\n193: bytes: [4]u8,\n194: };\n199: const MAX_SIZE: usize = 1024;\n202: pub var global_state: i32 = 0;\n205: const MAGIC_NUMBER: u32 = comptime blk: {\n206: var x: u32 = 1;\n207: x *= 42;\n208: break :blk x;\n209: };\n214: const ParseError = error{\n215: InvalidInput,\n216: UnexpectedToken,\n217: EndOfStream,\n218: BufferOverflow,\n219: };\n224: test \"add returns correct sum\" {\n225: const result = add(2, 3);\n226: try std.testing.expectEqual(@as(i32, 5), result);\n227: }\n230: test \"safeDivide handles zero\" {\n231: const result = safeDivide(10, 0);\n232: try std.testing.expectError(error.DivisionByZero, result);\n233: }\n236: test \"indexOf finds element\" {\n237: const items = [_]i32{ 1, 2, 3, 4, 5 };\n238: const idx = indexOf(i32, &items, 3);\n239: try std.testing.expectEqual(@as(?usize, 2), idx);\n240: }\n243: const io = @import(\"std\");\n244: const fs = @import(\"std\");\n245: const mem = @import(\"std\");\n246: const math = @import(\"std\");\n247: const json = @import(\"std\");\n248: const Mode = enum { fast, safe };\n249: const Phase = enum { init, done };\n250: const Signal = enum { on, off };\n251: const Packet = struct { id: i32 };\n252: const Limits = struct { max: i32 };\n253: const Variant = union { i: i32, f: f32 };\n254: const Payload = extern union { a: i32, b: i32 };\n255: const Message = union { txt: [4]u8, len: u32 };\n256: var retries: i32 = 0;\n257: var pointer: usize = 0;\n265: fn reqCoverZig1(value: i32) i32 { return value + 1; }\n272: fn reqCoverZig2(value: i32) i32 { return value + 2; }\n279: fn reqCoverZig3(value: i32) i32 { return value + 3; }\n286: fn reqCoverZig4(value: i32) i32 { return value + 4; }\n293: fn reqCoverZig5(value: i32) i32 { return value + 5; }\n```\n",
|
|
4
|
-
"stderr": ""
|
|
5
|
-
}
|