agent-bundle 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +161 -0
- package/dist/agent/agent.d.ts +32 -0
- package/dist/agent/agent.js +241 -0
- package/dist/agent/agent.js.map +1 -0
- package/dist/agent/agent.test-helpers.d.ts +63 -0
- package/dist/agent/agent.test-helpers.js +170 -0
- package/dist/agent/agent.test-helpers.js.map +1 -0
- package/dist/agent/define-agent.d.ts +2 -0
- package/dist/agent/define-agent.js +18 -0
- package/dist/agent/define-agent.js.map +1 -0
- package/dist/agent/dependencies.d.ts +15 -0
- package/dist/agent/dependencies.js +14 -0
- package/dist/agent/dependencies.js.map +1 -0
- package/dist/agent/index.d.ts +4 -0
- package/dist/agent/index.js +5 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/internals.d.ts +28 -0
- package/dist/agent/internals.js +160 -0
- package/dist/agent/internals.js.map +1 -0
- package/dist/agent/session.d.ts +4 -0
- package/dist/agent/session.js +2 -0
- package/dist/agent/session.js.map +1 -0
- package/dist/agent/types.d.ts +52 -0
- package/dist/agent/types.js +2 -0
- package/dist/agent/types.js.map +1 -0
- package/dist/agent-loop/agent-loop.d.ts +27 -0
- package/dist/agent-loop/agent-loop.js +2 -0
- package/dist/agent-loop/agent-loop.js.map +1 -0
- package/dist/agent-loop/index.d.ts +4 -0
- package/dist/agent-loop/index.js +5 -0
- package/dist/agent-loop/index.js.map +1 -0
- package/dist/agent-loop/pi-mono/events.d.ts +3 -0
- package/dist/agent-loop/pi-mono/events.js +73 -0
- package/dist/agent-loop/pi-mono/events.js.map +1 -0
- package/dist/agent-loop/pi-mono/index.d.ts +1 -0
- package/dist/agent-loop/pi-mono/index.js +2 -0
- package/dist/agent-loop/pi-mono/index.js.map +1 -0
- package/dist/agent-loop/pi-mono/input.d.ts +6 -0
- package/dist/agent-loop/pi-mono/input.js +120 -0
- package/dist/agent-loop/pi-mono/input.js.map +1 -0
- package/dist/agent-loop/pi-mono/model.d.ts +7 -0
- package/dist/agent-loop/pi-mono/model.js +72 -0
- package/dist/agent-loop/pi-mono/model.js.map +1 -0
- package/dist/agent-loop/pi-mono/pi-mono-loop.d.ts +11 -0
- package/dist/agent-loop/pi-mono/pi-mono-loop.js +167 -0
- package/dist/agent-loop/pi-mono/pi-mono-loop.js.map +1 -0
- package/dist/agent-loop/pi-mono/pi-mono-loop.test-helpers.d.ts +28 -0
- package/dist/agent-loop/pi-mono/pi-mono-loop.test-helpers.js +76 -0
- package/dist/agent-loop/pi-mono/pi-mono-loop.test-helpers.js.map +1 -0
- package/dist/agent-loop/pi-mono/queue.d.ts +9 -0
- package/dist/agent-loop/pi-mono/queue.js +37 -0
- package/dist/agent-loop/pi-mono/queue.js.map +1 -0
- package/dist/agent-loop/pi-mono/tools.d.ts +4 -0
- package/dist/agent-loop/pi-mono/tools.js +164 -0
- package/dist/agent-loop/pi-mono/tools.js.map +1 -0
- package/dist/agent-loop/pi-mono/utils.d.ts +14 -0
- package/dist/agent-loop/pi-mono/utils.js +83 -0
- package/dist/agent-loop/pi-mono/utils.js.map +1 -0
- package/dist/agent-loop/system-prompt/fill.d.ts +1 -0
- package/dist/agent-loop/system-prompt/fill.js +19 -0
- package/dist/agent-loop/system-prompt/fill.js.map +1 -0
- package/dist/agent-loop/system-prompt/generate.d.ts +11 -0
- package/dist/agent-loop/system-prompt/generate.js +21 -0
- package/dist/agent-loop/system-prompt/generate.js.map +1 -0
- package/dist/agent-loop/system-prompt/index.d.ts +2 -0
- package/dist/agent-loop/system-prompt/index.js +3 -0
- package/dist/agent-loop/system-prompt/index.js.map +1 -0
- package/dist/agent-loop/types.d.ts +77 -0
- package/dist/agent-loop/types.js +2 -0
- package/dist/agent-loop/types.js.map +1 -0
- package/dist/cli/build/build.d.ts +35 -0
- package/dist/cli/build/build.js +174 -0
- package/dist/cli/build/build.js.map +1 -0
- package/dist/cli/build/build.test-helpers.d.ts +9 -0
- package/dist/cli/build/build.test-helpers.js +50 -0
- package/dist/cli/build/build.test-helpers.js.map +1 -0
- package/dist/cli/build/codegen-commands.d.ts +16 -0
- package/dist/cli/build/codegen-commands.js +81 -0
- package/dist/cli/build/codegen-commands.js.map +1 -0
- package/dist/cli/build/codegen.d.ts +55 -0
- package/dist/cli/build/codegen.js +212 -0
- package/dist/cli/build/codegen.js.map +1 -0
- package/dist/cli/build/e2b-template.d.ts +38 -0
- package/dist/cli/build/e2b-template.js +210 -0
- package/dist/cli/build/e2b-template.js.map +1 -0
- package/dist/cli/build/e2b-template.test-helpers.d.ts +19 -0
- package/dist/cli/build/e2b-template.test-helpers.js +80 -0
- package/dist/cli/build/e2b-template.test-helpers.js.map +1 -0
- package/dist/cli/build/sandbox-image.d.ts +35 -0
- package/dist/cli/build/sandbox-image.js +57 -0
- package/dist/cli/build/sandbox-image.js.map +1 -0
- package/dist/cli/build-codegen.d.ts +41 -0
- package/dist/cli/build-codegen.js +168 -0
- package/dist/cli/build-codegen.js.map +1 -0
- package/dist/cli/build-e2b-template.d.ts +38 -0
- package/dist/cli/build-e2b-template.js +223 -0
- package/dist/cli/build-e2b-template.js.map +1 -0
- package/dist/cli/build-e2b-template.test-helpers.d.ts +19 -0
- package/dist/cli/build-e2b-template.test-helpers.js +80 -0
- package/dist/cli/build-e2b-template.test-helpers.js.map +1 -0
- package/dist/cli/build-sandbox-image.d.ts +35 -0
- package/dist/cli/build-sandbox-image.js +57 -0
- package/dist/cli/build-sandbox-image.js.map +1 -0
- package/dist/cli/build.d.ts +30 -0
- package/dist/cli/build.js +151 -0
- package/dist/cli/build.js.map +1 -0
- package/dist/cli/build.test-helpers.d.ts +9 -0
- package/dist/cli/build.test-helpers.js +50 -0
- package/dist/cli/build.test-helpers.js.map +1 -0
- package/dist/cli/config/load-bundle-config.d.ts +2 -0
- package/dist/cli/config/load-bundle-config.js +20 -0
- package/dist/cli/config/load-bundle-config.js.map +1 -0
- package/dist/cli/config/resolve-project-root.d.ts +1 -0
- package/dist/cli/config/resolve-project-root.js +19 -0
- package/dist/cli/config/resolve-project-root.js.map +1 -0
- package/dist/cli/deploy/aws-cli.d.ts +42 -0
- package/dist/cli/deploy/aws-cli.js +95 -0
- package/dist/cli/deploy/aws-cli.js.map +1 -0
- package/dist/cli/deploy/aws-ecr.d.ts +20 -0
- package/dist/cli/deploy/aws-ecr.js +97 -0
- package/dist/cli/deploy/aws-ecr.js.map +1 -0
- package/dist/cli/deploy/aws-ecs-infra.d.ts +39 -0
- package/dist/cli/deploy/aws-ecs-infra.js +169 -0
- package/dist/cli/deploy/aws-ecs-infra.js.map +1 -0
- package/dist/cli/deploy/aws-ecs-role.d.ts +9 -0
- package/dist/cli/deploy/aws-ecs-role.js +114 -0
- package/dist/cli/deploy/aws-ecs-role.js.map +1 -0
- package/dist/cli/deploy/aws-ecs-service.d.ts +37 -0
- package/dist/cli/deploy/aws-ecs-service.js +207 -0
- package/dist/cli/deploy/aws-ecs-service.js.map +1 -0
- package/dist/cli/deploy/aws-ecs-shared.d.ts +59 -0
- package/dist/cli/deploy/aws-ecs-shared.js +30 -0
- package/dist/cli/deploy/aws-ecs-shared.js.map +1 -0
- package/dist/cli/deploy/aws-ecs.d.ts +3 -0
- package/dist/cli/deploy/aws-ecs.js +141 -0
- package/dist/cli/deploy/aws-ecs.js.map +1 -0
- package/dist/cli/deploy/aws-prerequisites.d.ts +16 -0
- package/dist/cli/deploy/aws-prerequisites.js +28 -0
- package/dist/cli/deploy/aws-prerequisites.js.map +1 -0
- package/dist/cli/deploy/aws-teardown.d.ts +13 -0
- package/dist/cli/deploy/aws-teardown.js +204 -0
- package/dist/cli/deploy/aws-teardown.js.map +1 -0
- package/dist/cli/deploy/deploy.d.ts +36 -0
- package/dist/cli/deploy/deploy.js +209 -0
- package/dist/cli/deploy/deploy.js.map +1 -0
- package/dist/cli/error.d.ts +1 -0
- package/dist/cli/error.js +4 -0
- package/dist/cli/error.js.map +1 -0
- package/dist/cli/generate/generate.d.ts +37 -0
- package/dist/cli/generate/generate.js +121 -0
- package/dist/cli/generate/generate.js.map +1 -0
- package/dist/cli/generate.d.ts +32 -0
- package/dist/cli/generate.js +102 -0
- package/dist/cli/generate.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +182 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/load-bundle-config.d.ts +2 -0
- package/dist/cli/load-bundle-config.js +20 -0
- package/dist/cli/load-bundle-config.js.map +1 -0
- package/dist/cli/resolve-project-root.d.ts +1 -0
- package/dist/cli/resolve-project-root.js +19 -0
- package/dist/cli/resolve-project-root.js.map +1 -0
- package/dist/cli/serve/dev.d.ts +6 -0
- package/dist/cli/serve/dev.js +73 -0
- package/dist/cli/serve/dev.js.map +1 -0
- package/dist/cli/serve/http.d.ts +12 -0
- package/dist/cli/serve/http.js +123 -0
- package/dist/cli/serve/http.js.map +1 -0
- package/dist/cli/serve/init.d.ts +42 -0
- package/dist/cli/serve/init.js +110 -0
- package/dist/cli/serve/init.js.map +1 -0
- package/dist/cli/serve/runtime.d.ts +25 -0
- package/dist/cli/serve/runtime.js +142 -0
- package/dist/cli/serve/runtime.js.map +1 -0
- package/dist/cli/serve/serve.d.ts +7 -0
- package/dist/cli/serve/serve.js +63 -0
- package/dist/cli/serve/serve.js.map +1 -0
- package/dist/cli/serve/serve.test-helpers.d.ts +36 -0
- package/dist/cli/serve/serve.test-helpers.js +205 -0
- package/dist/cli/serve/serve.test-helpers.js.map +1 -0
- package/dist/cli/serve/worktree-port.d.ts +36 -0
- package/dist/cli/serve/worktree-port.js +124 -0
- package/dist/cli/serve/worktree-port.js.map +1 -0
- package/dist/cli/serve-http.d.ts +12 -0
- package/dist/cli/serve-http.js +112 -0
- package/dist/cli/serve-http.js.map +1 -0
- package/dist/cli/serve-runtime.d.ts +16 -0
- package/dist/cli/serve-runtime.js +122 -0
- package/dist/cli/serve-runtime.js.map +1 -0
- package/dist/cli/serve.d.ts +33 -0
- package/dist/cli/serve.js +150 -0
- package/dist/cli/serve.js.map +1 -0
- package/dist/cli/serve.test-helpers.d.ts +30 -0
- package/dist/cli/serve.test-helpers.js +145 -0
- package/dist/cli/serve.test-helpers.js.map +1 -0
- package/dist/code-formatter/bundle.json +41 -0
- package/dist/code-formatter/index.ts +26 -0
- package/dist/code-formatter/package.json +10 -0
- package/dist/code-formatter/types.ts +2 -0
- package/dist/code-formatter-e2b/bundle.json +40 -0
- package/dist/code-formatter-e2b/index.ts +25 -0
- package/dist/code-formatter-e2b/package.json +10 -0
- package/dist/code-formatter-e2b/types.ts +2 -0
- package/dist/coding-assistant-ollama/bundle.json +43 -0
- package/dist/coding-assistant-ollama/index.ts +28 -0
- package/dist/coding-assistant-ollama/package.json +10 -0
- package/dist/coding-assistant-ollama/types.ts +2 -0
- package/dist/commands/find.d.ts +8 -0
- package/dist/commands/find.js +11 -0
- package/dist/commands/find.js.map +1 -0
- package/dist/commands/loader.d.ts +13 -0
- package/dist/commands/loader.js +163 -0
- package/dist/commands/loader.js.map +1 -0
- package/dist/commands/types.d.ts +7 -0
- package/dist/commands/types.js +2 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/commands/with-commands.d.ts +6 -0
- package/dist/commands/with-commands.js +19 -0
- package/dist/commands/with-commands.js.map +1 -0
- package/dist/data-analyst/bundle.json +40 -0
- package/dist/data-analyst/index.ts +25 -0
- package/dist/data-analyst/package.json +10 -0
- package/dist/data-analyst/types.ts +2 -0
- package/dist/financial-analyst/bundle.json +40 -0
- package/dist/financial-analyst/index.ts +25 -0
- package/dist/financial-analyst/package.json +10 -0
- package/dist/financial-analyst/types.ts +2 -0
- package/dist/mcp/client-manager.d.ts +26 -0
- package/dist/mcp/client-manager.js +101 -0
- package/dist/mcp/client-manager.js.map +1 -0
- package/dist/mcp/connect-server.d.ts +21 -0
- package/dist/mcp/connect-server.js +170 -0
- package/dist/mcp/connect-server.js.map +1 -0
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.js +3 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/sandbox-stdio-transport.d.ts +32 -0
- package/dist/mcp/sandbox-stdio-transport.js +199 -0
- package/dist/mcp/sandbox-stdio-transport.js.map +1 -0
- package/dist/observability/hooks.d.ts +10 -0
- package/dist/observability/hooks.js +97 -0
- package/dist/observability/hooks.js.map +1 -0
- package/dist/observability/index.d.ts +6 -0
- package/dist/observability/index.js +7 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/observability/metrics.d.ts +31 -0
- package/dist/observability/metrics.js +61 -0
- package/dist/observability/metrics.js.map +1 -0
- package/dist/observability/middleware.d.ts +12 -0
- package/dist/observability/middleware.js +45 -0
- package/dist/observability/middleware.js.map +1 -0
- package/dist/observability/otel-harness.test-util.d.ts +37 -0
- package/dist/observability/otel-harness.test-util.js +96 -0
- package/dist/observability/otel-harness.test-util.js.map +1 -0
- package/dist/observability/provider.d.ts +8 -0
- package/dist/observability/provider.js +19 -0
- package/dist/observability/provider.js.map +1 -0
- package/dist/observability/tracing.d.ts +14 -0
- package/dist/observability/tracing.js +40 -0
- package/dist/observability/tracing.js.map +1 -0
- package/dist/observability/types.d.ts +39 -0
- package/dist/observability/types.js +31 -0
- package/dist/observability/types.js.map +1 -0
- package/dist/personalized-recommend/bundle.json +64 -0
- package/dist/personalized-recommend/index.ts +41 -0
- package/dist/personalized-recommend/package.json +10 -0
- package/dist/personalized-recommend/types.ts +2 -0
- package/dist/plugins/loader.d.ts +11 -0
- package/dist/plugins/loader.js +100 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/plugins/merge.d.ts +10 -0
- package/dist/plugins/merge.js +22 -0
- package/dist/plugins/merge.js.map +1 -0
- package/dist/plugins/parse.d.ts +10 -0
- package/dist/plugins/parse.js +139 -0
- package/dist/plugins/parse.js.map +1 -0
- package/dist/plugins/types.d.ts +28 -0
- package/dist/plugins/types.js +2 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/plugins/urls.d.ts +7 -0
- package/dist/plugins/urls.js +40 -0
- package/dist/plugins/urls.js.map +1 -0
- package/dist/runtime.d.ts +5 -0
- package/dist/runtime.js +3 -0
- package/dist/runtime.js.map +1 -0
- package/dist/sandbox/factory.d.ts +2 -0
- package/dist/sandbox/factory.js +27 -0
- package/dist/sandbox/factory.js.map +1 -0
- package/dist/sandbox/index.d.ts +4 -0
- package/dist/sandbox/index.js +5 -0
- package/dist/sandbox/index.js.map +1 -0
- package/dist/sandbox/providers/e2b.d.ts +28 -0
- package/dist/sandbox/providers/e2b.js +294 -0
- package/dist/sandbox/providers/e2b.js.map +1 -0
- package/dist/sandbox/providers/kubernetes-command-run.d.ts +8 -0
- package/dist/sandbox/providers/kubernetes-command-run.js +195 -0
- package/dist/sandbox/providers/kubernetes-command-run.js.map +1 -0
- package/dist/sandbox/providers/kubernetes-helpers.d.ts +31 -0
- package/dist/sandbox/providers/kubernetes-helpers.js +152 -0
- package/dist/sandbox/providers/kubernetes-helpers.js.map +1 -0
- package/dist/sandbox/providers/kubernetes-kubeconfig.d.ts +7 -0
- package/dist/sandbox/providers/kubernetes-kubeconfig.js +51 -0
- package/dist/sandbox/providers/kubernetes-kubeconfig.js.map +1 -0
- package/dist/sandbox/providers/kubernetes-spawn.d.ts +2 -0
- package/dist/sandbox/providers/kubernetes-spawn.js +42 -0
- package/dist/sandbox/providers/kubernetes-spawn.js.map +1 -0
- package/dist/sandbox/providers/kubernetes-spawn.utils.d.ts +32 -0
- package/dist/sandbox/providers/kubernetes-spawn.utils.js +249 -0
- package/dist/sandbox/providers/kubernetes-spawn.utils.js.map +1 -0
- package/dist/sandbox/providers/kubernetes.constants.d.ts +3 -0
- package/dist/sandbox/providers/kubernetes.constants.js +4 -0
- package/dist/sandbox/providers/kubernetes.constants.js.map +1 -0
- package/dist/sandbox/providers/kubernetes.d.ts +37 -0
- package/dist/sandbox/providers/kubernetes.js +258 -0
- package/dist/sandbox/providers/kubernetes.js.map +1 -0
- package/dist/sandbox/types.d.ts +57 -0
- package/dist/sandbox/types.js +2 -0
- package/dist/sandbox/types.js.map +1 -0
- package/dist/sandbox/utils.d.ts +1 -0
- package/dist/sandbox/utils.js +4 -0
- package/dist/sandbox/utils.js.map +1 -0
- package/dist/schema/bundle.d.ts +143 -0
- package/dist/schema/bundle.js +203 -0
- package/dist/schema/bundle.js.map +1 -0
- package/dist/service/command-routes.d.ts +8 -0
- package/dist/service/command-routes.js +44 -0
- package/dist/service/command-routes.js.map +1 -0
- package/dist/service/create-server.d.ts +9 -0
- package/dist/service/create-server.js +113 -0
- package/dist/service/create-server.js.map +1 -0
- package/dist/service/index.d.ts +1 -0
- package/dist/service/index.js +2 -0
- package/dist/service/index.js.map +1 -0
- package/dist/skills/index.d.ts +1 -0
- package/dist/skills/index.js +2 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/loader.d.ts +18 -0
- package/dist/skills/loader.js +142 -0
- package/dist/skills/loader.js.map +1 -0
- package/dist/skills/summaries.d.ts +8 -0
- package/dist/skills/summaries.js +9 -0
- package/dist/skills/summaries.js.map +1 -0
- package/dist/test-helpers/env.d.ts +2 -0
- package/dist/test-helpers/env.js +20 -0
- package/dist/test-helpers/env.js.map +1 -0
- package/dist/test-helpers/mock-agent.d.ts +56 -0
- package/dist/test-helpers/mock-agent.js +180 -0
- package/dist/test-helpers/mock-agent.js.map +1 -0
- package/dist/test-helpers/mock-sandbox.d.ts +33 -0
- package/dist/test-helpers/mock-sandbox.js +200 -0
- package/dist/test-helpers/mock-sandbox.js.map +1 -0
- package/dist/tui/index.d.ts +2 -0
- package/dist/tui/index.js +3 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/render.d.ts +8 -0
- package/dist/tui/render.js +40 -0
- package/dist/tui/render.js.map +1 -0
- package/dist/tui/tui.d.ts +19 -0
- package/dist/tui/tui.js +133 -0
- package/dist/tui/tui.js.map +1 -0
- package/dist/webui/create-webui-server.d.ts +22 -0
- package/dist/webui/create-webui-server.js +293 -0
- package/dist/webui/create-webui-server.js.map +1 -0
- package/dist/webui/event-bus.d.ts +16 -0
- package/dist/webui/event-bus.js +24 -0
- package/dist/webui/event-bus.js.map +1 -0
- package/dist/webui/index.d.ts +2 -0
- package/dist/webui/index.js +3 -0
- package/dist/webui/index.js.map +1 -0
- package/dist/webui/public/app.js +847 -0
- package/dist/webui/public/file-transfer.js +114 -0
- package/dist/webui/public/index.html +166 -0
- package/dist/webui/public/styles.css +1678 -0
- package/package.json +99 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/* File Upload & Download — companion to app.js */
|
|
2
|
+
(function () {
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
// ── Toast helper ──
|
|
6
|
+
function showToast(message, isError) {
|
|
7
|
+
var toast = document.createElement("div");
|
|
8
|
+
toast.className = "ft-toast" + (isError ? " ft-toast--error" : "");
|
|
9
|
+
toast.textContent = message;
|
|
10
|
+
document.body.appendChild(toast);
|
|
11
|
+
setTimeout(function () { toast.remove(); }, 3000);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// ── Upload button in file-panel header ──
|
|
15
|
+
var panelHeader = document.querySelector("#file-panel .panel-header");
|
|
16
|
+
if (!panelHeader) return;
|
|
17
|
+
|
|
18
|
+
var uploadInput = document.createElement("input");
|
|
19
|
+
uploadInput.type = "file";
|
|
20
|
+
uploadInput.multiple = true;
|
|
21
|
+
uploadInput.style.display = "none";
|
|
22
|
+
panelHeader.appendChild(uploadInput);
|
|
23
|
+
|
|
24
|
+
var uploadBtn = document.createElement("button");
|
|
25
|
+
uploadBtn.type = "button";
|
|
26
|
+
uploadBtn.className = "ft-upload-btn";
|
|
27
|
+
uploadBtn.setAttribute("aria-label", "Upload files");
|
|
28
|
+
uploadBtn.setAttribute("title", "Upload files");
|
|
29
|
+
uploadBtn.innerHTML =
|
|
30
|
+
'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" ' +
|
|
31
|
+
'stroke-width="2" stroke-linecap="round" stroke-linejoin="round">' +
|
|
32
|
+
'<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>' +
|
|
33
|
+
'<polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>';
|
|
34
|
+
panelHeader.appendChild(uploadBtn);
|
|
35
|
+
|
|
36
|
+
uploadBtn.addEventListener("click", function () { uploadInput.click(); });
|
|
37
|
+
|
|
38
|
+
function uploadFiles(files) {
|
|
39
|
+
Array.from(files).forEach(function (file) {
|
|
40
|
+
var form = new FormData();
|
|
41
|
+
form.append("file", file);
|
|
42
|
+
fetch("/api/file-upload", { method: "POST", body: form })
|
|
43
|
+
.then(function (res) { return res.json(); })
|
|
44
|
+
.then(function (data) {
|
|
45
|
+
if (data.ok) {
|
|
46
|
+
showToast("Uploaded " + file.name, false);
|
|
47
|
+
window.dispatchEvent(new CustomEvent("files-changed"));
|
|
48
|
+
} else {
|
|
49
|
+
showToast(data.error || "Upload failed", true);
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
.catch(function () { showToast("Upload failed", true); });
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
uploadInput.addEventListener("change", function () {
|
|
57
|
+
if (uploadInput.files && uploadInput.files.length) {
|
|
58
|
+
uploadFiles(uploadInput.files);
|
|
59
|
+
uploadInput.value = "";
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
// ── Drag-and-drop on file tree ──
|
|
64
|
+
var fileTree = document.getElementById("file-tree");
|
|
65
|
+
if (fileTree) {
|
|
66
|
+
fileTree.addEventListener("dragover", function (e) {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
fileTree.classList.add("ft-drag-over");
|
|
69
|
+
});
|
|
70
|
+
fileTree.addEventListener("dragleave", function (e) {
|
|
71
|
+
if (!fileTree.contains(e.relatedTarget)) {
|
|
72
|
+
fileTree.classList.remove("ft-drag-over");
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
fileTree.addEventListener("drop", function (e) {
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
fileTree.classList.remove("ft-drag-over");
|
|
78
|
+
if (e.dataTransfer && e.dataTransfer.files.length) {
|
|
79
|
+
uploadFiles(e.dataTransfer.files);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// ── Download button in preview header ──
|
|
85
|
+
var previewHeader = document.querySelector("#preview-area .preview-header");
|
|
86
|
+
if (!previewHeader) return;
|
|
87
|
+
|
|
88
|
+
var downloadBtn = document.createElement("button");
|
|
89
|
+
downloadBtn.type = "button";
|
|
90
|
+
downloadBtn.className = "ft-download-btn";
|
|
91
|
+
downloadBtn.setAttribute("aria-label", "Download file");
|
|
92
|
+
downloadBtn.setAttribute("title", "Download workspace");
|
|
93
|
+
downloadBtn.innerHTML =
|
|
94
|
+
'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" ' +
|
|
95
|
+
'stroke-width="2" stroke-linecap="round" stroke-linejoin="round">' +
|
|
96
|
+
'<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>' +
|
|
97
|
+
'<polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>';
|
|
98
|
+
|
|
99
|
+
// Insert before the close button
|
|
100
|
+
var closeBtn = document.getElementById("preview-close");
|
|
101
|
+
previewHeader.insertBefore(downloadBtn, closeBtn);
|
|
102
|
+
|
|
103
|
+
downloadBtn.addEventListener("click", function () {
|
|
104
|
+
var filePreview = document.getElementById("preview-area");
|
|
105
|
+
var filePath = filePreview ? filePreview.getAttribute("data-file-path") : null;
|
|
106
|
+
if (!filePath) return;
|
|
107
|
+
var a = document.createElement("a");
|
|
108
|
+
a.href = "/api/file-download?path=" + encodeURIComponent(filePath);
|
|
109
|
+
a.download = filePath.split("/").pop() || "file";
|
|
110
|
+
document.body.appendChild(a);
|
|
111
|
+
a.click();
|
|
112
|
+
a.remove();
|
|
113
|
+
});
|
|
114
|
+
})();
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>agent-bundle</title>
|
|
7
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
8
|
+
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap" rel="stylesheet">
|
|
9
|
+
<link rel="stylesheet" href="/assets/styles.css">
|
|
10
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/github-dark.min.css">
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<!-- Background effects (matching site/index.html) -->
|
|
14
|
+
<div class="mesh-bg"></div>
|
|
15
|
+
<div class="noise"></div>
|
|
16
|
+
|
|
17
|
+
<div id="app">
|
|
18
|
+
<!-- Header -->
|
|
19
|
+
<header id="header">
|
|
20
|
+
<button id="menu-toggle" class="menu-toggle" type="button" aria-label="Toggle file tree">
|
|
21
|
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
|
|
22
|
+
<line x1="3" y1="6" x2="21" y2="6"/>
|
|
23
|
+
<line x1="3" y1="12" x2="21" y2="12"/>
|
|
24
|
+
<line x1="3" y1="18" x2="21" y2="18"/>
|
|
25
|
+
</svg>
|
|
26
|
+
</button>
|
|
27
|
+
<span class="logo">agent<span class="logo-dot">·</span>bundle</span>
|
|
28
|
+
</header>
|
|
29
|
+
|
|
30
|
+
<div id="panels">
|
|
31
|
+
<!-- Left: File Panel -->
|
|
32
|
+
<aside id="file-panel">
|
|
33
|
+
<div class="panel-header">
|
|
34
|
+
<span class="panel-title">Files</span>
|
|
35
|
+
<span class="subtle">/workspace</span>
|
|
36
|
+
</div>
|
|
37
|
+
<div id="file-tree" class="file-tree"></div>
|
|
38
|
+
</aside>
|
|
39
|
+
|
|
40
|
+
<!-- Center: Workspace (hero) -->
|
|
41
|
+
<main id="workspace-panel">
|
|
42
|
+
|
|
43
|
+
<!-- Workspace content area -->
|
|
44
|
+
<div id="workspace-content" class="workspace-content">
|
|
45
|
+
<!-- Welcome State (shown when no file selected and no messages) -->
|
|
46
|
+
<div id="welcome-state" class="welcome-state">
|
|
47
|
+
<div class="welcome-icon">
|
|
48
|
+
<svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="#8b5cf6" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
49
|
+
<line x1="18" y1="20" x2="18" y2="10"></line>
|
|
50
|
+
<line x1="12" y1="20" x2="12" y2="4"></line>
|
|
51
|
+
<line x1="6" y1="20" x2="6" y2="14"></line>
|
|
52
|
+
<rect x="1" y="1" width="22" height="22" rx="3" ry="3" stroke="#8b5cf6" stroke-width="1.5" fill="none" opacity="0.3"></rect>
|
|
53
|
+
</svg>
|
|
54
|
+
</div>
|
|
55
|
+
<h2 class="welcome-title" id="welcome-agent-name">Data Analysis Agent</h2>
|
|
56
|
+
<p class="welcome-powered">powered by agent<span class="dot">·</span>bundle</p>
|
|
57
|
+
<p class="welcome-subtitle">Drop a CSV, ask questions in plain English, get charts and reports</p>
|
|
58
|
+
<div id="skill-badges" class="skill-badges"></div>
|
|
59
|
+
<div class="welcome-heading">Try an example</div>
|
|
60
|
+
<div id="prompt-chips" class="prompt-chips">
|
|
61
|
+
<button class="prompt-chip" data-prompt="Generate sample sales data for 12 months and show monthly revenue trends">
|
|
62
|
+
📊 Monthly revenue trends
|
|
63
|
+
</button>
|
|
64
|
+
<button class="prompt-chip" data-prompt="Create a dataset of 100 students with random grades, then show the grade distribution histogram">
|
|
65
|
+
📈 Grade distribution analysis
|
|
66
|
+
</button>
|
|
67
|
+
<button class="prompt-chip" data-prompt="Analyze the correlation between temperature and ice cream sales with sample data">
|
|
68
|
+
🔗 Correlation analysis
|
|
69
|
+
</button>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<!-- Empty state: no files yet -->
|
|
74
|
+
<div id="empty-no-files" class="workspace-empty" style="display:none;">
|
|
75
|
+
<div class="workspace-empty-card">
|
|
76
|
+
<div class="workspace-empty-icon">
|
|
77
|
+
<svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
78
|
+
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
|
|
79
|
+
<polyline points="14 2 14 8 20 8"></polyline>
|
|
80
|
+
<line x1="12" y1="18" x2="12" y2="12"></line>
|
|
81
|
+
<line x1="9" y1="15" x2="15" y2="15"></line>
|
|
82
|
+
</svg>
|
|
83
|
+
</div>
|
|
84
|
+
<div class="workspace-empty-text">Files will appear here as the agent works.</div>
|
|
85
|
+
<div class="workspace-empty-suggestions">
|
|
86
|
+
<button class="workspace-empty-suggestion" data-prompt="Analyze the data and show trends">Analyze the data and show trends</button>
|
|
87
|
+
<button class="workspace-empty-suggestion" data-prompt="Generate a chart from the dataset">Generate a chart from the dataset</button>
|
|
88
|
+
<button class="workspace-empty-suggestion" data-prompt="Create a summary report">Create a summary report</button>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<!-- Empty state: files exist, none selected -->
|
|
94
|
+
<div id="empty-with-files" class="workspace-empty" style="display:none;align-items:stretch;justify-content:flex-start;">
|
|
95
|
+
<div class="workspace-empty-header">Recently Generated</div>
|
|
96
|
+
<div id="file-card-grid" class="file-card-grid">
|
|
97
|
+
<!-- Cards injected by JS -->
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
<!-- Preview content (shown when a file is selected) -->
|
|
102
|
+
<div id="preview-area" class="preview-area" style="display:none;">
|
|
103
|
+
<div class="preview-header">
|
|
104
|
+
<div id="preview-breadcrumb" class="preview-breadcrumb">
|
|
105
|
+
<span id="preview-filename" class="preview-breadcrumb-current">filename</span>
|
|
106
|
+
</div>
|
|
107
|
+
<button id="preview-close" class="preview-close" type="button" aria-label="Close preview">×</button>
|
|
108
|
+
</div>
|
|
109
|
+
<div id="preview-content" class="preview-content"></div>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
</div>
|
|
113
|
+
</main>
|
|
114
|
+
|
|
115
|
+
<!-- Right: Chat Sidebar -->
|
|
116
|
+
<aside id="chat-sidebar" class="chat-sidebar">
|
|
117
|
+
<div class="chat-sidebar-header">
|
|
118
|
+
<span class="chat-sidebar-title">Chat</span>
|
|
119
|
+
<span id="status-badge" class="badge badge--idle">idle</span>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<!-- Chat Messages Area -->
|
|
123
|
+
<div id="chat-messages" class="chat-messages">
|
|
124
|
+
<!-- Messages injected by JS -->
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<!-- Chat Input -->
|
|
128
|
+
<form id="chat-form" class="chat-form">
|
|
129
|
+
<div class="input-wrapper">
|
|
130
|
+
<textarea
|
|
131
|
+
id="chat-input"
|
|
132
|
+
class="chat-input"
|
|
133
|
+
placeholder="Send a message..."
|
|
134
|
+
rows="1"
|
|
135
|
+
autocomplete="off"
|
|
136
|
+
autofocus
|
|
137
|
+
></textarea>
|
|
138
|
+
<button type="submit" id="send-btn" class="send-btn" aria-label="Send message">
|
|
139
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
140
|
+
<line x1="22" y1="2" x2="11" y2="13"></line>
|
|
141
|
+
<polygon points="22 2 15 22 11 13 2 9 22 2"></polygon>
|
|
142
|
+
</svg>
|
|
143
|
+
</button>
|
|
144
|
+
</div>
|
|
145
|
+
<div class="input-hint">Enter to send · Shift+Enter for newline</div>
|
|
146
|
+
</form>
|
|
147
|
+
</aside>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
|
|
151
|
+
<!-- Panel overlay (mobile backdrop) -->
|
|
152
|
+
<div class="panel-overlay"></div>
|
|
153
|
+
|
|
154
|
+
<!-- Image Modal -->
|
|
155
|
+
<div id="image-modal" class="image-modal" style="display:none;" role="dialog" aria-modal="true" aria-label="Image preview">
|
|
156
|
+
<img id="modal-image" src="" alt="Preview">
|
|
157
|
+
<button id="modal-close" class="modal-close" type="button" aria-label="Close image preview">×</button>
|
|
158
|
+
</div>
|
|
159
|
+
|
|
160
|
+
<!-- Scripts -->
|
|
161
|
+
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
|
162
|
+
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/highlight.min.js"></script>
|
|
163
|
+
<script src="/assets/app.js"></script>
|
|
164
|
+
<script src="/assets/file-transfer.js"></script>
|
|
165
|
+
</body>
|
|
166
|
+
</html>
|