@superblocksteam/vite-plugin-file-sync 2.0.156-next.3 → 2.0.156
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/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts +2 -9
- package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts.map +1 -1
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js +6 -34
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.d.ts +1 -2
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.d.ts.map +1 -1
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.js +9 -52
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.js.map +1 -1
- package/dist/ai-service/agent/tool-permission-delivery.d.ts +16 -25
- package/dist/ai-service/agent/tool-permission-delivery.d.ts.map +1 -1
- package/dist/ai-service/agent/tool-permission-delivery.js +38 -384
- package/dist/ai-service/agent/tool-permission-delivery.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.d.ts +35 -9
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js +98 -71
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/test-api.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/test-api.js +2 -3
- package/dist/ai-service/agent/tools/apis/test-api.js.map +1 -1
- package/dist/ai-service/agent/tools/app-environment/update-app-environment.d.ts +1 -1
- package/dist/ai-service/agent/tools/app-environment/update-app-environment.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/app-environment/update-app-environment.js +1 -13
- package/dist/ai-service/agent/tools/app-environment/update-app-environment.js.map +1 -1
- package/dist/ai-service/agent/tools/build-capture-screenshot.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-capture-screenshot.js +3 -8
- package/dist/ai-service/agent/tools/build-capture-screenshot.js.map +1 -1
- package/dist/ai-service/agent/tools/build-navigate-preview.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-navigate-preview.js +2 -4
- package/dist/ai-service/agent/tools/build-navigate-preview.js.map +1 -1
- package/dist/ai-service/agent/tools/build-reload-file.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-reload-file.js +2 -4
- package/dist/ai-service/agent/tools/build-reload-file.js.map +1 -1
- package/dist/ai-service/agent/tools/get-logs.d.ts +2 -2
- package/dist/ai-service/agent/tools/integrations/delete-integration.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/delete-integration.js +3 -6
- package/dist/ai-service/agent/tools/integrations/delete-integration.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +13 -13
- package/dist/ai-service/agent/tools/integrations/integration-setup.d.ts +6 -18
- package/dist/ai-service/agent/tools/integrations/integration-setup.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/integration-setup.js +15 -41
- package/dist/ai-service/agent/tools/integrations/integration-setup.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/internal.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/internal.js +2 -4
- package/dist/ai-service/agent/tools/integrations/internal.js.map +1 -1
- package/dist/ai-service/agent/tools/report-security-findings.d.ts +23 -23
- package/dist/ai-service/agent/tools.d.ts +2 -4
- package/dist/ai-service/agent/tools.d.ts.map +1 -1
- package/dist/ai-service/agent/tools.js +14 -21
- package/dist/ai-service/agent/tools.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/git.d.ts +2 -2
- package/dist/ai-service/index.d.ts +25 -26
- package/dist/ai-service/index.d.ts.map +1 -1
- package/dist/ai-service/index.js +121 -340
- package/dist/ai-service/index.js.map +1 -1
- package/dist/ai-service/integrations/store.d.ts +1 -2
- package/dist/ai-service/integrations/store.d.ts.map +1 -1
- package/dist/ai-service/integrations/store.js +2 -3
- package/dist/ai-service/integrations/store.js.map +1 -1
- package/dist/ai-service/judge/tools/playwright-action.d.ts +1 -1
- package/dist/ai-service/judge/tools/submit-feedback.d.ts +1 -1
- package/dist/ai-service/llm/client.d.ts +3 -9
- package/dist/ai-service/llm/client.d.ts.map +1 -1
- package/dist/ai-service/llm/client.js +3 -10
- package/dist/ai-service/llm/client.js.map +1 -1
- package/dist/ai-service/llm/context-v2/context-metrics.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/context-metrics.js +0 -3
- package/dist/ai-service/llm/context-v2/context-metrics.js.map +1 -1
- package/dist/ai-service/llm/stream/observers/llmobs.d.ts +6 -6
- package/dist/ai-service/llm/stream/observers/llmobs.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/observers/llmobs.js +9 -10
- package/dist/ai-service/llm/stream/observers/llmobs.js.map +1 -1
- package/dist/ai-service/llm/stream/orchestrator.d.ts +0 -4
- package/dist/ai-service/llm/stream/orchestrator.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/orchestrator.js +41 -19
- package/dist/ai-service/llm/stream/orchestrator.js.map +1 -1
- package/dist/ai-service/llm/stream/retry-engine.d.ts +1 -1
- package/dist/ai-service/llm/stream/retry-engine.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/retry-engine.js +1 -26
- package/dist/ai-service/llm/stream/retry-engine.js.map +1 -1
- package/dist/ai-service/policy-agent-metrics.d.ts +0 -10
- package/dist/ai-service/policy-agent-metrics.d.ts.map +1 -1
- package/dist/ai-service/policy-agent-metrics.js +0 -33
- package/dist/ai-service/policy-agent-metrics.js.map +1 -1
- package/dist/ai-service/state-machine/clark-fsm.d.ts +1 -29
- package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
- package/dist/ai-service/state-machine/clark-fsm.js +1 -3
- package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.js +6 -7
- package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.js +5 -18
- package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/fetch-with-reconnect-retry.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/fetch-with-reconnect-retry.js +6 -8
- package/dist/ai-service/state-machine/helpers/fetch-with-reconnect-retry.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.d.ts +14 -0
- package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.js +36 -0
- package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/pre-session-metrics.d.ts +0 -2
- package/dist/ai-service/state-machine/helpers/pre-session-metrics.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/pre-session-metrics.js +0 -3
- package/dist/ai-service/state-machine/helpers/pre-session-metrics.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/prompt-request-metrics.d.ts +0 -1
- package/dist/ai-service/state-machine/helpers/prompt-request-metrics.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/prompt-request-metrics.js +27 -60
- package/dist/ai-service/state-machine/helpers/prompt-request-metrics.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/stable-peer.d.ts +1 -12
- package/dist/ai-service/state-machine/helpers/stable-peer.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/stable-peer.js +9 -42
- package/dist/ai-service/state-machine/helpers/stable-peer.js.map +1 -1
- package/dist/ai-service/state-machine/mocks.d.ts.map +1 -1
- package/dist/ai-service/state-machine/mocks.js +0 -6
- package/dist/ai-service/state-machine/mocks.js.map +1 -1
- package/dist/ai-service/util/rpc-timeout.d.ts +5 -12
- package/dist/ai-service/util/rpc-timeout.d.ts.map +1 -1
- package/dist/ai-service/util/rpc-timeout.js +5 -12
- package/dist/ai-service/util/rpc-timeout.js.map +1 -1
- package/dist/file-sync-vite-plugin.d.ts.map +1 -1
- package/dist/file-sync-vite-plugin.js +21 -8
- package/dist/file-sync-vite-plugin.js.map +1 -1
- package/dist/lock-service/activity-tracker.d.ts +5 -0
- package/dist/lock-service/activity-tracker.d.ts.map +1 -1
- package/dist/lock-service/activity-tracker.js +13 -0
- package/dist/lock-service/activity-tracker.js.map +1 -1
- package/dist/lock-service/index.d.ts +27 -308
- package/dist/lock-service/index.d.ts.map +1 -1
- package/dist/lock-service/index.js +156 -680
- package/dist/lock-service/index.js.map +1 -1
- package/dist/policy-gate-callback-mapper.d.ts +2 -3
- package/dist/policy-gate-callback-mapper.d.ts.map +1 -1
- package/dist/policy-gate-callback-mapper.js.map +1 -1
- package/dist/policy-gate-runner.d.ts +2 -4
- package/dist/policy-gate-runner.d.ts.map +1 -1
- package/dist/policy-gate-runner.js +8 -31
- package/dist/policy-gate-runner.js.map +1 -1
- package/dist/socket-manager.d.ts +6 -47
- package/dist/socket-manager.d.ts.map +1 -1
- package/dist/socket-manager.js +66 -283
- package/dist/socket-manager.js.map +1 -1
- package/dist/sync-service/index.d.ts.map +1 -1
- package/dist/sync-service/index.js +3 -3
- package/dist/sync-service/index.js.map +1 -1
- package/package.json +8 -8
- package/dist/ai-service/agent/tool-permission-delivery-metrics.d.ts +0 -3
- package/dist/ai-service/agent/tool-permission-delivery-metrics.d.ts.map +0 -1
- package/dist/ai-service/agent/tool-permission-delivery-metrics.js +0 -23
- package/dist/ai-service/agent/tool-permission-delivery-metrics.js.map +0 -1
- package/dist/ai-service/llm/stream/observers/step-token-usage.d.ts +0 -15
- package/dist/ai-service/llm/stream/observers/step-token-usage.d.ts.map +0 -1
- package/dist/ai-service/llm/stream/observers/step-token-usage.js +0 -88
- package/dist/ai-service/llm/stream/observers/step-token-usage.js.map +0 -1
- package/dist/ai-service/llm/stream/terminal-reason.d.ts +0 -6
- package/dist/ai-service/llm/stream/terminal-reason.d.ts.map +0 -1
- package/dist/ai-service/llm/stream/terminal-reason.js +0 -73
- package/dist/ai-service/llm/stream/terminal-reason.js.map +0 -1
- package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.d.ts +0 -28
- package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.d.ts.map +0 -1
- package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.js +0 -254
- package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.js.map +0 -1
- package/dist/ai-service/util/call-peer.d.ts +0 -11
- package/dist/ai-service/util/call-peer.d.ts.map +0 -1
- package/dist/ai-service/util/call-peer.js +0 -47
- package/dist/ai-service/util/call-peer.js.map +0 -1
- package/dist/ai-service/util/peer-liveness.d.ts +0 -23
- package/dist/ai-service/util/peer-liveness.d.ts.map +0 -1
- package/dist/ai-service/util/peer-liveness.js +0 -42
- package/dist/ai-service/util/peer-liveness.js.map +0 -1
- package/dist/scan-scope-merge.d.ts +0 -16
- package/dist/scan-scope-merge.d.ts.map +0 -1
- package/dist/scan-scope-merge.js +0 -90
- package/dist/scan-scope-merge.js.map +0 -1
- package/dist/test-setup.d.ts +0 -2
- package/dist/test-setup.d.ts.map +0 -1
- package/dist/test-setup.js +0 -21
- package/dist/test-setup.js.map +0 -1
|
@@ -35,16 +35,9 @@ export interface RegistryPolicy {
|
|
|
35
35
|
* clark.plan-generation-system-prompt.enabled rollout flag.
|
|
36
36
|
*/
|
|
37
37
|
export type SystemPromptVariant = "agent" | "plan-generation";
|
|
38
|
-
export
|
|
39
|
-
gitConnected?: boolean;
|
|
38
|
+
export declare const buildBaseSystemPrompt: (config: AiServiceConfig, mode?: AiMode, factsSection?: string, appKnowledgeSection?: string, onDemandKnowledgeIndex?: string, registryPolicy?: RegistryPolicy, v2ToV3MigrationInProgress?: boolean, coreModel?: CoreModelName, includeAppBuilderModelGuidance?: boolean, options?: {
|
|
40
39
|
variant?: SystemPromptVariant;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Native Git being enabled does not mean a repository is connected.
|
|
44
|
-
* Presence of the runtime Git service is the connection signal.
|
|
45
|
-
*/
|
|
46
|
-
export declare function gitConnectedFromRuntime(gitService: unknown): boolean;
|
|
47
|
-
export declare const buildBaseSystemPrompt: (config: AiServiceConfig, mode?: AiMode, factsSection?: string, appKnowledgeSection?: string, onDemandKnowledgeIndex?: string, registryPolicy?: RegistryPolicy, v2ToV3MigrationInProgress?: boolean, coreModel?: CoreModelName, includeAppBuilderModelGuidance?: boolean, options?: SystemPromptOptions) => string;
|
|
40
|
+
}) => string;
|
|
48
41
|
/**
|
|
49
42
|
* Resolves app-editor model guidance from LaunchDarkly (`ai.prompt.app-builder.model-guidance`).
|
|
50
43
|
* Only injected when `buildBaseSystemPrompt` is called with `includeAppBuilderModelGuidance`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-base-system-prompt.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/agent/prompts/build-base-system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,aAAa,EACd,MAAM,uCAAuC,CAAC;AAQ/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAStD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,cAAc;IAC7B,wBAAwB,EAAE,OAAO,CAAC;IAClC,MAAM,CAAC,EAAE,YAAY,GAAG,gBAAgB,GAAG,aAAa,CAAC;CAC1D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,iBAAiB,CAAC;AAE9D,
|
|
1
|
+
{"version":3,"file":"build-base-system-prompt.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/agent/prompts/build-base-system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,aAAa,EACd,MAAM,uCAAuC,CAAC;AAQ/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAStD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,cAAc;IAC7B,wBAAwB,EAAE,OAAO,CAAC;IAClC,MAAM,CAAC,EAAE,YAAY,GAAG,gBAAgB,GAAG,aAAa,CAAC;CAC1D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,iBAAiB,CAAC;AAE9D,eAAO,MAAM,qBAAqB,GAChC,QAAQ,eAAe,EACvB,OAAO,MAAM,EACb,eAAe,MAAM,EACrB,sBAAsB,MAAM,EAC5B,yBAAyB,MAAM,EAC/B,iBAAiB,cAAc,EAC/B,mCAAiC,EACjC,YAAY,aAAa,EACzB,wCAAsC,EACtC,UAAU;IAAE,OAAO,CAAC,EAAE,mBAAmB,CAAA;CAAE,WAmd5C,CAAC;AA4oBF;;;;;;;;;GASG;AACH,wBAAgB,iCAAiC,CAC/C,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EACnD,SAAS,CAAC,EAAE,aAAa,GACxB,MAAM,CAiBR"}
|
|
@@ -6,26 +6,8 @@ import { buildSystemSkillExclusions } from "../../migration-prompt-gating.js";
|
|
|
6
6
|
import { generateSkillsXml } from "../../skills/index.js";
|
|
7
7
|
import { buildYamlApiSection, buildSdkApiSection, buildApiToolGuidance, } from "./api-prompts.js";
|
|
8
8
|
const logger = getPrefixedLogger("[build-base-system-prompt]");
|
|
9
|
-
/**
|
|
10
|
-
* Native Git being enabled does not mean a repository is connected.
|
|
11
|
-
* Presence of the runtime Git service is the connection signal.
|
|
12
|
-
*/
|
|
13
|
-
export function gitConnectedFromRuntime(gitService) {
|
|
14
|
-
return gitService !== undefined;
|
|
15
|
-
}
|
|
16
9
|
export const buildBaseSystemPrompt = (config, mode, factsSection, appKnowledgeSection, onDemandKnowledgeIndex, registryPolicy, v2ToV3MigrationInProgress = false, coreModel, includeAppBuilderModelGuidance = false, options) => {
|
|
17
10
|
const planGenerationVariant = options?.variant === "plan-generation";
|
|
18
|
-
// Three distinct states, not two. With native Git disabled there is no
|
|
19
|
-
// connection signal to read, so the prompt must not assert one either way;
|
|
20
|
-
// it may still say that publishing does not depend on Git, which holds for
|
|
21
|
-
// every app.
|
|
22
|
-
const gitConnectionState = !config
|
|
23
|
-
.features.nativeGitEnabled
|
|
24
|
-
? "unknown"
|
|
25
|
-
: options?.gitConnected === true
|
|
26
|
-
? "connected"
|
|
27
|
-
: "disconnected";
|
|
28
|
-
const gitConnected = gitConnectionState === "connected";
|
|
29
11
|
const managedNativeDbAvailable = isManagedNativeDbAvailableForClark(config);
|
|
30
12
|
const superblocksDocsGuidance = config.features.superblocksDocsMcpEnabled
|
|
31
13
|
? "For Superblocks product documentation, use the `search_superblocks_docs` tool first for setup, integration, and platform behavior questions. If the docs MCP result is missing or incomplete, then use `web_fetch` against `https://docs.superblocks.com` and, if needed, discover pages via `https://docs.superblocks.com/sitemap.xml`.\nWhen referring to Superblocks pages in your response, always include relative links: [Integrations](/integrations) for the integrations page, or [Integration Name](/integrations/{slug}) for a specific integration (e.g., [Salesforce](/integrations/salesforce), [PostgreSQL](/integrations/postgres))."
|
|
@@ -33,11 +15,6 @@ export const buildBaseSystemPrompt = (config, mode, factsSection, appKnowledgeSe
|
|
|
33
15
|
const managedNativeDbAvailabilityGuidance = managedNativeDbAvailable
|
|
34
16
|
? ""
|
|
35
17
|
: "\n\n**App Database availability:** App Databases (called Superblocks Database in the product documentation) are not available for this organization. Documentation describing this feature does not override this restriction. Do not propose or attempt to provision an App Database. You may still use existing database integrations or help the user configure a supported integration.";
|
|
36
|
-
const publishingGuidance = gitConnected
|
|
37
|
-
? ""
|
|
38
|
-
: `\n\n**Version control and publishing:** ${gitConnectionState === "disconnected"
|
|
39
|
-
? "This application is not connected to a Git repository. Connecting to GitHub, GitLab, Bitbucket, or Azure DevOps is optional and is not required to publish."
|
|
40
|
-
: "Publishing this application does not require connecting a Git repository."} When the user wants to publish, guide them to publish from a checkpoint card or from Version history by clicking **Publish**. Do not propose connecting a Git repository as a prerequisite for publishing. Documentation describing Git workflows does not override this publishing path.`;
|
|
41
18
|
let preamble = "";
|
|
42
19
|
if (planGenerationVariant) {
|
|
43
20
|
// Replaces the modes/tools preamble below: the plan-generation stream has
|
|
@@ -134,11 +111,8 @@ You cannot delete App Database bindings. Explain that deletion is not supported
|
|
|
134
111
|
- The chat-attachment rule above still applies: never import a file attachment's contents by looping one-off data writes.`
|
|
135
112
|
: ""}
|
|
136
113
|
|
|
137
|
-
${
|
|
138
|
-
? `**Git
|
|
139
|
-
In Plan mode **without** an approved plan you do not have access to \`git\` or \`git_raw\` (read-only tools only) — tell the user to switch to **Build** mode in the UI so you can run the git operation, and do not fall back to generic manual git CLI steps.
|
|
140
|
-
|
|
141
|
-
**Resolving Git Merge Conflicts:**
|
|
114
|
+
${config.features.nativeGitEnabled
|
|
115
|
+
? `**Resolving Git Merge Conflicts:**
|
|
142
116
|
When a pull results in merge conflicts, you will be told which files have conflicts. Follow these rules:
|
|
143
117
|
- Read ALL conflicted files before resolving anything — understand the full picture of what features, components, or modules were changed on each side.
|
|
144
118
|
- Synthesize conflicts at the feature/module level. Group related conflicts across files by the logical change they belong to (e.g., "sidebar navigation", "auth flow refactor"). Think in terms of what was built or changed, not which lines diverged.
|
|
@@ -154,6 +128,7 @@ When a pull results in merge conflicts, you will be told which files have confli
|
|
|
154
128
|
- If the user wants to cancel the merge, ${config.features.nativeGitRawEnabled
|
|
155
129
|
? "use `git_raw` with `['merge', '--abort']` to restore the pre-merge state."
|
|
156
130
|
: "use `git_merge_abort` to restore the pre-merge state."}
|
|
131
|
+
- If the user asks to set up git, connect git, connect to GitHub, GitLab, Azure DevOps or Bitbucket, connect to a repository host, or otherwise wants to use git features: in Plan mode **without** an approved plan you do not have access to \`git\` or \`git_raw\` (read-only tools only)—tell the user to switch to **Build** mode in the UI so you can run the git tool and trigger the Git setup flow, and do not reply with generic manual git installation steps when the intended path is the in-app connection flow. When you have access to git tools (Build mode, or Plan mode with an approved plan), call ${config.features.nativeGitRawEnabled ? "`git_raw`" : "`git`"} first instead of replying with manual setup instructions. If git is not connected yet, the tool will trigger the Git setup UI automatically.
|
|
157
132
|
- Never leave conflict markers in resolved files.
|
|
158
133
|
- After any merge completes, run \`build_debug\` to verify the app still builds and runs. Only run \`build_captureScreenshot\` if the merge changed the UI and you need to confirm it looks right—screenshots are expensive, so do not run one routinely. If either reveals issues, fix them and re-run verification until the app is healthy.
|
|
159
134
|
${config.features.nativeGitRawEnabled
|
|
@@ -172,11 +147,9 @@ ${config.features.nativeGitRawEnabled
|
|
|
172
147
|
- Deployments can only be made from the main branch. To deploy, first use \`git\` with \`operation: "log_from_main"\` to get commit SHAs from main, then use \`operation: "deploy"\` with the full SHA. NEVER use a SHA from \`git log\` (which shows \`${SUPERBLOCKS_LIVE_GIT_BRANCH}\` commits) for deploy. If the commit is only on \`${SUPERBLOCKS_LIVE_GIT_BRANCH}\`, create a pull request first to merge it into main.
|
|
173
148
|
`}
|
|
174
149
|
`
|
|
175
|
-
:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
`
|
|
179
|
-
: ""}Here are some additional guidelines to follow:
|
|
150
|
+
: `**Version Control:**
|
|
151
|
+
If the user asks about committing, deploying, publishing, or version-controlling their application, read the documentation at \`https://docs.superblocks.com/development-lifecycle/deploy/version-control\` using \`web_fetch\` and guide them based on its contents.
|
|
152
|
+
`}Here are some additional guidelines to follow:
|
|
180
153
|
|
|
181
154
|
`;
|
|
182
155
|
}
|
|
@@ -316,7 +289,6 @@ When an \`<environment_compatibility>\` block is present, treat it as the server
|
|
|
316
289
|
- If that tool is unavailable, provide a read-only explanation and the server-supplied remediation options instead of claiming to make the change.
|
|
317
290
|
`}
|
|
318
291
|
${managedNativeDbAvailabilityGuidance}
|
|
319
|
-
${publishingGuidance}
|
|
320
292
|
<safety_guidance>
|
|
321
293
|
${safetyGuidance}
|
|
322
294
|
</safety_guidance>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-base-system-prompt.js","sourceRoot":"","sources":["../../../../src/ai-service/agent/prompts/build-base-system-prompt.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,GAAG,iBAAiB,CAAC,4BAA4B,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"build-base-system-prompt.js","sourceRoot":"","sources":["../../../../src/ai-service/agent/prompts/build-base-system-prompt.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,GAAG,iBAAiB,CAAC,4BAA4B,CAAC,CAAC;AAuC/D,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,M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uV,CAAC;AACjW,CAAC;AAED,SAAS,4BAA4B,CACnC,cAA0C,EAC1C,yBAAkC;IAElC,IAAI,CAAC,cAAc;QAAE,OAAO,EAAE,CAAC;IAC/B,MAAM,yBAAyB,GAAG,yBAAyB;QACzD,CAAC,CAAC,8BAA8B,EAAE;QAClC,CAAC,CAAC,EAAE,CAAC;IAEP,yEAAyE;IACzE,0EAA0E;IAC1E,2EAA2E;IAC3E,uEAAuE;IACvE,2EAA2E;IAC3E,sCAAsC;IACtC,IAAI,cAAc,CAAC,MAAM,KAAK,aAAa,EAAE,CAAC;QAC5C,OAAO,8VAA8V,yBAAyB;;CAEjY,CAAC;IACA,CAAC;IAED,IAAI,cAAc,CAAC,wBAAwB,EAAE,CAAC;QAC5C,yEAAyE;QACzE,sEAAsE;QACtE,qCAAqC;QACrC,MAAM,uBAAuB,GAAG,uBAAuB,CAAC,GAAG,CACzD,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,IAAI,CACxB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACb,OAAO,kcAAkc,uBAAuB,uHAAuH,yBAAyB;;CAEnnB,CAAC;IACA,CAAC;IAED,OAAO,yMAAyM,yBAAyB;;CAE1O,CAAC;AACF,CAAC;AAED,MAAM,uBAAuB,GAAG,MAAM,CAAC;;;;;;;;CAQtC,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ScanScopeJson } from "@superblocksteam/shared";
|
|
2
1
|
/**
|
|
3
2
|
* Three-layer prompt architecture for the Security Agent.
|
|
4
3
|
*
|
|
@@ -13,5 +12,5 @@ export interface SecurityAgentAppContext {
|
|
|
13
12
|
}>;
|
|
14
13
|
}
|
|
15
14
|
export declare function buildSecurityAgentSkeleton(): string;
|
|
16
|
-
export declare function composeSecurityAgentPrompt(appContext: SecurityAgentAppContext, adminPrompt?: string
|
|
15
|
+
export declare function composeSecurityAgentPrompt(appContext: SecurityAgentAppContext, adminPrompt?: string): string;
|
|
17
16
|
//# sourceMappingURL=build-security-scan-prompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-security-scan-prompt.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/agent/prompts/build-security-scan-prompt.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"build-security-scan-prompt.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/agent/prompts/build-security-scan-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,KAAK,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;CACJ;AAsBD,wBAAgB,0BAA0B,IAAI,MAAM,CA2DnD;AA8JD,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,uBAAuB,EACnC,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,CAYR"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Three-layer prompt architecture for the Security Agent.
|
|
3
|
+
*
|
|
4
|
+
* Layer 1: System Skeleton — agent identity, behavioral rules, output contract, safety.
|
|
5
|
+
* Layer 2: App Context — dynamic, per-app metadata to prevent false positives.
|
|
6
|
+
* Layer 3: Admin Policy Prompt — what to look for (from template or IT admin).
|
|
7
|
+
*/
|
|
2
8
|
// Policy of the Superblocks-managed security agent, used whenever a review carries no admin prompt.
|
|
3
9
|
// Admin-authored agents replace it with their own; keep this text in sync with the General Security
|
|
4
10
|
// Review starting template in review_policy_agent_template.
|
|
@@ -221,65 +227,16 @@ Read these if you encounter code patterns you do not recognize and need to deter
|
|
|
221
227
|
whether they are safe platform conventions or genuine security concerns.`);
|
|
222
228
|
return sections.join("\n\n");
|
|
223
229
|
}
|
|
224
|
-
export function composeSecurityAgentPrompt(appContext, adminPrompt
|
|
230
|
+
export function composeSecurityAgentPrompt(appContext, adminPrompt) {
|
|
225
231
|
const skeleton = buildSecurityAgentSkeleton();
|
|
226
232
|
const context = buildSecurityAgentAppContext(appContext);
|
|
227
233
|
const policy = adminPrompt?.trim() ? adminPrompt : DEFAULT_ADMIN_PROMPT;
|
|
228
|
-
const scopeSection = buildDiffScopedReviewSection(scanScopeJson);
|
|
229
234
|
return `${skeleton}
|
|
230
235
|
|
|
231
|
-
${context}
|
|
236
|
+
${context}
|
|
232
237
|
|
|
233
238
|
## Policy: What to Review
|
|
234
239
|
|
|
235
240
|
${policy}`;
|
|
236
241
|
}
|
|
237
|
-
function buildDiffScopedReviewSection(scanScopeJson) {
|
|
238
|
-
if (!scanScopeJson) {
|
|
239
|
-
return "";
|
|
240
|
-
}
|
|
241
|
-
const inDiffPaths = new Set(scanScopeJson.changedFiles.map((file) => file.path));
|
|
242
|
-
const inDiffFindings = scanScopeJson.priorFindings.filter((finding) => isInDiffPriorFinding(finding, inDiffPaths));
|
|
243
|
-
const changedFileList = scanScopeJson.changedFiles
|
|
244
|
-
.map((file) => `- ${file.changeType} ${file.path}`)
|
|
245
|
-
.join("\n");
|
|
246
|
-
const priorFindingList = inDiffFindings.length === 0
|
|
247
|
-
? "- None"
|
|
248
|
-
: inDiffFindings
|
|
249
|
-
.map((finding) => {
|
|
250
|
-
const paths = findingFiles(finding.locations);
|
|
251
|
-
const pathSuffix = paths.length === 0 ? "" : ` (${paths.join(", ")})`;
|
|
252
|
-
return `- ${finding.severity} ${finding.category}: ${finding.title}${pathSuffix}`;
|
|
253
|
-
})
|
|
254
|
-
.join("\n");
|
|
255
|
-
const truncatedNote = scanScopeJson.diffTruncated
|
|
256
|
-
? "\nThe unified diff was truncated. Use tools for files listed by name only."
|
|
257
|
-
: "";
|
|
258
|
-
const unifiedDiffFence = markdownFence(scanScopeJson.unifiedDiff);
|
|
259
|
-
return `
|
|
260
|
-
|
|
261
|
-
## Diff-scoped review
|
|
262
|
-
|
|
263
|
-
Treat the changed files and unified diff as the priority scope. Confirm or drop prior findings that sit in those files. Integration configurations stay in scope. The rest of the tree stays reachable through tools; follow references into unchanged files when needed.
|
|
264
|
-
${truncatedNote}
|
|
265
|
-
|
|
266
|
-
### Changed files
|
|
267
|
-
|
|
268
|
-
${changedFileList}
|
|
269
|
-
|
|
270
|
-
### Prior findings in the diff
|
|
271
|
-
|
|
272
|
-
${priorFindingList}
|
|
273
|
-
|
|
274
|
-
### Unified diff
|
|
275
|
-
|
|
276
|
-
${unifiedDiffFence}`;
|
|
277
|
-
}
|
|
278
|
-
function markdownFence(content) {
|
|
279
|
-
let fence = "```";
|
|
280
|
-
while (content.includes(fence)) {
|
|
281
|
-
fence += "`";
|
|
282
|
-
}
|
|
283
|
-
return `${fence}\n${content}\n${fence}`;
|
|
284
|
-
}
|
|
285
242
|
//# sourceMappingURL=build-security-scan-prompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-security-scan-prompt.js","sourceRoot":"","sources":["../../../../src/ai-service/agent/prompts/build-security-scan-prompt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-security-scan-prompt.js","sourceRoot":"","sources":["../../../../src/ai-service/agent/prompts/build-security-scan-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,oGAAoG;AACpG,oGAAoG;AACpG,4DAA4D;AAC5D,MAAM,oBAAoB,GAAG;IAC3B,8DAA8D;IAC9D,yDAAyD;IACzD,EAAE;IACF,oEAAoE;IACpE,2GAA2G;IAC3G,0EAA0E;IAC1E,6DAA6D;IAC7D,uFAAuF;IACvF,+CAA+C;IAC/C,6FAA6F;IAC7F,yDAAyD;IACzD,uEAAuE;IACvE,EAAE;IACF,4FAA4F;CAC7F,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,UAAU,0BAA0B;IACxC,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAErD,OAAO;;;;;;WA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,CAAC;IACzD,MAAM,MAAM,GAAG,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,oBAAoB,CAAC;IAExE,OAAO,GAAG,QAAQ;;EAElB,OAAO;;;;EAIP,MAAM,EAAE,CAAC;AACX,CAAC"}
|
|
@@ -1,50 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Delivery of the tool-permission dialog to the browser peer.
|
|
2
|
+
* Delivery of the tool-permission dialog to the browser peer (ENG-4820).
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
4
|
+
* Owns the fail-fast contract: the delivery RPC is bounded by
|
|
5
|
+
* PERMISSION_PROMPT_DELIVERY_TIMEOUT_MS (10s) — far below the 60s
|
|
6
|
+
* tool-execution timeout — so an unresponsive tab surfaces as a
|
|
7
|
+
* PermissionPromptDeliveryError the agent can relay, instead of freezing the
|
|
8
|
+
* generation turn for the full tool budget and masquerading as a tool
|
|
9
|
+
* timeout. The user's approve/deny decision is NOT awaited here; after
|
|
10
|
+
* successful delivery the tool ends with REQUIRES_USER_CONFIRMATION and the
|
|
11
|
+
* decision resumes the turn via aiRespondToToolPermission.
|
|
11
12
|
*/
|
|
12
13
|
import type { Clark } from "../state-machine/clark-fsm.js";
|
|
13
14
|
/**
|
|
14
|
-
* The RPC payload exactly
|
|
15
|
+
* The RPC payload — exactly what the browser peer's aiRequestToolPermission
|
|
15
16
|
* expects. Satisfies the RPC contract.
|
|
16
17
|
*/
|
|
17
18
|
export type ToolPermissionPromptRequest = Parameters<NonNullable<Clark["context"]["peer"]>["call"]["aiRequestToolPermission"]>[0];
|
|
18
|
-
type PendingToolPermissionDelivery = NonNullable<Clark["context"]["pendingToolPermissionRequest"]>["delivery"];
|
|
19
|
-
export type ToolPermissionReplayOutcome = "acked" | "parked" | "skipped" | "superseded";
|
|
20
|
-
export declare function flushPendingToolPermissionPrompt(clark: Clark, options?: {
|
|
21
|
-
replaceInFlight?: boolean;
|
|
22
|
-
source?: "reconnect" | "retry";
|
|
23
|
-
}): Promise<ToolPermissionReplayOutcome>;
|
|
24
|
-
export declare function inFlightToolPermissionReplay(clark: Clark): Promise<ToolPermissionReplayOutcome> | undefined;
|
|
25
19
|
/**
|
|
26
20
|
* Thrown when the permission dialog could not be delivered to the browser.
|
|
27
21
|
* The message is written for the LLM to relay to the user verbatim. The
|
|
28
22
|
* diagnosis depends on the cause: "may be unresponsive" is accurate only for
|
|
29
|
-
* the timeout path
|
|
23
|
+
* the timeout path — an immediate rejection (e.g. a socket drop) can happen
|
|
30
24
|
* with a perfectly healthy tab, so it carries the underlying reason instead.
|
|
31
25
|
*/
|
|
32
26
|
export declare class PermissionPromptDeliveryError extends Error {
|
|
33
27
|
constructor(toolName: string, options?: {
|
|
34
28
|
cause?: unknown;
|
|
35
|
-
expiredAfterGrace?: boolean;
|
|
36
29
|
});
|
|
37
30
|
}
|
|
38
|
-
export declare function createExpiredPermissionPromptDeliveryError(toolName: string, delivery: Extract<PendingToolPermissionDelivery, {
|
|
39
|
-
status: "parked";
|
|
40
|
-
}>): PermissionPromptDeliveryError;
|
|
41
31
|
/**
|
|
42
|
-
* Deliver the permission dialog to the browser peer
|
|
43
|
-
*
|
|
32
|
+
* Deliver the permission dialog to the browser peer, failing fast when the
|
|
33
|
+
* tab cannot acknowledge. On any delivery failure the pending permission
|
|
34
|
+
* request is cleared (a lingering one suppresses every future prompt in the
|
|
35
|
+
* session) before the error is rethrown.
|
|
44
36
|
*
|
|
45
37
|
* No-peer behavior is unchanged from the pre-ENG-4820 code: warn and return
|
|
46
38
|
* without error; the pending request stays stored.
|
|
47
39
|
*/
|
|
48
|
-
export declare function deliverToolPermissionPrompt(clark: Clark, request: ToolPermissionPromptRequest): Promise<
|
|
49
|
-
export {};
|
|
40
|
+
export declare function deliverToolPermissionPrompt(clark: Clark, request: ToolPermissionPromptRequest): Promise<void>;
|
|
50
41
|
//# sourceMappingURL=tool-permission-delivery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-permission-delivery.d.ts","sourceRoot":"","sources":["../../../src/ai-service/agent/tool-permission-delivery.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tool-permission-delivery.d.ts","sourceRoot":"","sources":["../../../src/ai-service/agent/tool-permission-delivery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAQ3D;;;GAGG;AACH,MAAM,MAAM,2BAA2B,GAAG,UAAU,CAClD,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,yBAAyB,CAAC,CACzE,CAAC,CAAC,CAAC,CAAC;AAEL;;;;;;GAMG;AACH,qBAAa,6BAA8B,SAAQ,KAAK;gBAC1C,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAgB5D;AAED;;;;;;;;GAQG;AACH,wBAAsB,2BAA2B,CAC/C,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,IAAI,CAAC,CAgDf"}
|