# Standalone minimal SDK application. Unlike the ordinary SDK profile, this
# bundle does not layer over dsh-base: this insert is the complete Cordis tree.
# User profile, home, and invocation patches still apply above it.

- insert:
    - id: sdk-app-startup
      name: '@deepseek-ai/dsh-sdk-app'
      config:
        profile: sdk-minimal

    - id: sdk-jsonrpc-server
      name: '@deepseek-ai/dsh-sdk-jsonrpc-server'
      inject: [sdkAppStartup, loader]
      config:
        maxTokensAsSuccess: false

    - id: deepseek-llm-api-extensions
      name: '@deepseek-ai/dsh-deepseek-llm-api-extensions'

    - id: session-log-deepseek
      name: '@deepseek-ai/dsh-session-log-deepseek'

    - id: plugin-package-inventory-deepseek
      name: '@deepseek-ai/dsh-plugin-package-inventory-deepseek'

    - id: llm-deepseek
      name: '@deepseek-ai/dsh-llm-deepseek'
      config:
        apiKeyEnv: DEEPSEEK_API_KEY
        defaultContextWindow: !!js Number(process.env.DSH_CONTEXT_WINDOW ?? 1000000)
        streamIdleTimeoutMs: 172800000

    - id: sandbox
      name: '@deepseek-ai/dsh-sandbox-local'

    # Shared projection registry: sandbox-policy and terminal-bash fold
    # sandbox-mode state through its units and require it as a hard injection.
    - id: session-projection
      name: '@deepseek-ai/dsh-session-projection'

    - id: sandbox-policy
      name: '@deepseek-ai/dsh-sandbox-policy'
      config:
        mode: danger-full-access
        workspaceRoot: !!js process.cwd()

    - id: subprocess
      name: '@deepseek-ai/dsh-subprocess-local'

    - id: pty
      name: '@deepseek-ai/dsh-terminal'

    - id: terminal-bash
      name: '@deepseek-ai/dsh-terminal-bash'
      disabled: !!js process.platform === 'win32'
      config:
        timeoutMs: 300000

    - id: terminal-pwsh
      name: '@deepseek-ai/dsh-terminal-bash'
      disabled: !!js process.platform !== 'win32'
      config:
        shellDialect: pwsh
        timeoutMs: 300000

    # The editor uses the bare local filesystem; persistent Bash still consumes
    # the shared danger-full-access sandbox policy above.
    - id: fs-local
      name: '@deepseek-ai/dsh-fs-local'
      config:
        cwd: !!js process.cwd()

    - id: agent-spine
      name: '@deepseek-ai/dsh-agent-spine-demo'
      config:
        includeHarnessIdentity: false
        includeRuntimeContext: false
        persona: !!js process.env.DSH_SYSTEM_PROMPT ?? 'You are a helpful software engineer assistant.'
        workspaceContext: false
        skills:
          enabled: false
        toolBash: false
        toolJobs: false

    - id: persistent-bash
      name: '@deepseek-ai/dsh-tool-bash-persistent'
      disabled: !!js process.platform === 'win32'
      config:
        timeoutMs: 300000
        description: |-
          Run commands in a bash shell
          * When invoking this tool, the contents of the "command" parameter does NOT need to be XML-escaped.
          * You don't have access to the internet via this tool.
          * You do have access to a mirror of common linux and python packages via apt and pip.
          * State is persistent across command calls and discussions with the user.
          * To inspect a particular line range of a file, e.g. lines 10-25, try 'sed -n 10,25p /path/to/the/file'.
          * Please avoid commands that may produce a very large amount of output.
          * Please run long lived commands in the background, e.g. 'sleep 10 &' or start a server in the background.

    - id: persistent-pwsh
      name: '@deepseek-ai/dsh-tool-pwsh-persistent'
      disabled: !!js process.platform !== 'win32'
      config:
        timeoutMs: 300000
        description: |-
          Run commands in a PowerShell shell
          * When invoking this tool, the contents of the "command" parameter does NOT need to be XML-escaped.
          * You don't have access to the internet via this tool.
          * State is persistent across command calls and discussions with the user.
          * Use native Windows paths (C:\...) and $env:NAME variables; this is PowerShell, not bash.
          * Please avoid commands that may produce a very large amount of output.
          * Please run long lived commands in the background, e.g. 'Start-Job' or start a server with Start-Process.

    - id: str-replace-editor
      name: '@deepseek-ai/dsh-tool-str-replace-editor'
      config:
        maxOutputChars: 16000

    - id: sessions
      name: '@deepseek-ai/dsh-session-persistence-jsonl'
      config:
        root: !!js dshHomePath('sessions')
        compression: none
