Commit 28bcb45b authored by jiangyz's avatar jiangyz

单点登录

parent a9e537c1
Pipeline #25187 passed with stages
in 3 minutes and 4 seconds
---
name: "OPSX: Apply"
description: Implement tasks from an OpenSpec change (Experimental)
category: Workflow
tags: [workflow, artifacts, experimental]
---
Implement tasks from an OpenSpec change.
**Input**: Optionally specify a change name (e.g., `/opsx:apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
**Steps**
1. **Select the change**
If a name is provided, use it. Otherwise:
- Infer from conversation context if the user mentioned a change
- Auto-select if only one active change exists
- If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).
2. **Check status to understand the schema**
```bash
openspec status --change "<name>" --json
```
Parse the JSON to understand:
- `schemaName`: The workflow being used (e.g., "spec-driven")
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
3. **Get apply instructions**
```bash
openspec instructions apply --change "<name>" --json
```
This returns:
- `contextFiles`: artifact ID -> array of concrete file paths (varies by schema)
- Progress (total, complete, remaining)
- Task list with status
- Dynamic instruction based on current state
**Handle states:**
- If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx:continue`
- If `state: "all_done"`: congratulate, suggest archive
- Otherwise: proceed to implementation
4. **Read context files**
Read every file path listed under `contextFiles` from the apply instructions output.
The files depend on the schema being used:
- **spec-driven**: proposal, specs, design, tasks
- Other schemas: follow the contextFiles from CLI output
5. **Show current progress**
Display:
- Schema being used
- Progress: "N/M tasks complete"
- Remaining tasks overview
- Dynamic instruction from CLI
6. **Implement tasks (loop until done or blocked)**
For each pending task:
- Show which task is being worked on
- Make the code changes required
- Keep changes minimal and focused
- Mark task complete in the tasks file: `- [ ]``- [x]`
- Continue to next task
**Pause if:**
- Task is unclear → ask for clarification
- Implementation reveals a design issue → suggest updating artifacts
- Error or blocker encountered → report and wait for guidance
- User interrupts
7. **On completion or pause, show status**
Display:
- Tasks completed this session
- Overall progress: "N/M tasks complete"
- If all done: suggest archive
- If paused: explain why and wait for guidance
**Output During Implementation**
```
## Implementing: <change-name> (schema: <schema-name>)
Working on task 3/7: <task description>
[...implementation happening...]
✓ Task complete
Working on task 4/7: <task description>
[...implementation happening...]
✓ Task complete
```
**Output On Completion**
```
## Implementation Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 7/7 tasks complete ✓
### Completed This Session
- [x] Task 1
- [x] Task 2
...
All tasks complete! You can archive this change with `/opsx:archive`.
```
**Output On Pause (Issue Encountered)**
```
## Implementation Paused
**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 4/7 tasks complete
### Issue Encountered
<description of the issue>
**Options:**
1. <option 1>
2. <option 2>
3. Other approach
What would you like to do?
```
**Guardrails**
- Keep going through tasks until done or blocked
- Always read context files before starting (from the apply instructions output)
- If task is ambiguous, pause and ask before implementing
- If implementation reveals issues, pause and suggest artifact updates
- Keep code changes minimal and scoped to each task
- Update task checkbox immediately after completing each task
- Pause on errors, blockers, or unclear requirements - don't guess
- Use contextFiles from CLI output, don't assume specific file names
**Fluid Workflow Integration**
This skill supports the "actions on a change" model:
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
---
name: "OPSX: Archive"
description: Archive a completed change in the experimental workflow
category: Workflow
tags: [workflow, archive, experimental]
---
Archive a completed change in the experimental workflow.
**Input**: Optionally specify a change name after `/opsx:archive` (e.g., `/opsx:archive add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
**Steps**
1. **If no change name provided, prompt for selection**
Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
Show only active changes (not already archived).
Include the schema used for each change if available.
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
2. **Check artifact completion status**
Run `openspec status --change "<name>" --json` to check artifact completion.
Parse the JSON to understand:
- `schemaName`: The workflow being used
- `artifacts`: List of artifacts with their status (`done` or other)
**If any artifacts are not `done`:**
- Display warning listing incomplete artifacts
- Prompt user for confirmation to continue
- Proceed if user confirms
3. **Check task completion status**
Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
**If incomplete tasks found:**
- Display warning showing count of incomplete tasks
- Prompt user for confirmation to continue
- Proceed if user confirms
**If no tasks file exists:** Proceed without task-related warning.
4. **Assess delta spec sync state**
Check for delta specs at `openspec/changes/<name>/specs/`. If none exist, proceed without sync prompt.
**If delta specs exist:**
- Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`
- Determine what changes would be applied (adds, modifications, removals, renames)
- Show a combined summary before prompting
**Prompt options:**
- If changes needed: "Sync now (recommended)", "Archive without syncing"
- If already synced: "Archive now", "Sync anyway", "Cancel"
If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke openspec-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.
5. **Perform the archive**
Create the archive directory if it doesn't exist:
```bash
mkdir -p openspec/changes/archive
```
Generate target name using current date: `YYYY-MM-DD-<change-name>`
**Check if target already exists:**
- If yes: Fail with error, suggest renaming existing archive or using different date
- If no: Move the change directory to archive
```bash
mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
```
6. **Display summary**
Show archive completion summary including:
- Change name
- Schema that was used
- Archive location
- Spec sync status (synced / sync skipped / no delta specs)
- Note about any warnings (incomplete artifacts/tasks)
**Output On Success**
```
## Archive Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
**Specs:** ✓ Synced to main specs
All artifacts complete. All tasks complete.
```
**Output On Success (No Delta Specs)**
```
## Archive Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
**Specs:** No delta specs
All artifacts complete. All tasks complete.
```
**Output On Success With Warnings**
```
## Archive Complete (with warnings)
**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
**Specs:** Sync skipped (user chose to skip)
**Warnings:**
- Archived with 2 incomplete artifacts
- Archived with 3 incomplete tasks
- Delta spec sync was skipped (user chose to skip)
Review the archive if this was not intentional.
```
**Output On Error (Archive Exists)**
```
## Archive Failed
**Change:** <change-name>
**Target:** openspec/changes/archive/YYYY-MM-DD-<name>/
Target archive directory already exists.
**Options:**
1. Rename the existing archive
2. Delete the existing archive if it's a duplicate
3. Wait until a different date to archive
```
**Guardrails**
- Always prompt for change selection if not provided
- Use artifact graph (openspec status --json) for completion checking
- Don't block archive on warnings - just inform and confirm
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
- Show clear summary of what happened
- If sync is requested, use the Skill tool to invoke `openspec-sync-specs` (agent-driven)
- If delta specs exist, always run the sync assessment and show the combined summary before prompting
---
name: "OPSX: Explore"
description: "Enter explore mode - think through ideas, investigate problems, clarify requirements"
category: Workflow
tags: [workflow, explore, experimental, thinking]
---
Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
**IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.
**This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.
**Input**: The argument after `/opsx:explore` is whatever the user wants to think about. Could be:
- A vague idea: "real-time collaboration"
- A specific problem: "the auth system is getting unwieldy"
- A change name: "add-dark-mode" (to explore in context of that change)
- A comparison: "postgres vs sqlite for this"
- Nothing (just enter explore mode)
---
## The Stance
- **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
- **Open threads, not interrogations** - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.
- **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
- **Adaptive** - Follow interesting threads, pivot when new information emerges
- **Patient** - Don't rush to conclusions, let the shape of the problem emerge
- **Grounded** - Explore the actual codebase when relevant, don't just theorize
---
## What You Might Do
Depending on what the user brings, you might:
**Explore the problem space**
- Ask clarifying questions that emerge from what they said
- Challenge assumptions
- Reframe the problem
- Find analogies
**Investigate the codebase**
- Map existing architecture relevant to the discussion
- Find integration points
- Identify patterns already in use
- Surface hidden complexity
**Compare options**
- Brainstorm multiple approaches
- Build comparison tables
- Sketch tradeoffs
- Recommend a path (if asked)
**Visualize**
```
┌─────────────────────────────────────────┐
│ Use ASCII diagrams liberally │
├─────────────────────────────────────────┤
│ │
│ ┌────────┐ ┌────────┐ │
│ │ State │────────▶│ State │ │
│ │ A │ │ B │ │
│ └────────┘ └────────┘ │
│ │
│ System diagrams, state machines, │
│ data flows, architecture sketches, │
│ dependency graphs, comparison tables │
│ │
└─────────────────────────────────────────┘
```
**Surface risks and unknowns**
- Identify what could go wrong
- Find gaps in understanding
- Suggest spikes or investigations
---
## OpenSpec Awareness
You have full context of the OpenSpec system. Use it naturally, don't force it.
### Check for context
At the start, quickly check what exists:
```bash
openspec list --json
```
This tells you:
- If there are active changes
- Their names, schemas, and status
- What the user might be working on
If the user mentioned a specific change name, read its artifacts for context.
### When no change exists
Think freely. When insights crystallize, you might offer:
- "This feels solid enough to start a change. Want me to create a proposal?"
- Or keep exploring - no pressure to formalize
### When a change exists
If the user mentions a change or you detect one is relevant:
1. **Read existing artifacts for context**
- `openspec/changes/<name>/proposal.md`
- `openspec/changes/<name>/design.md`
- `openspec/changes/<name>/tasks.md`
- etc.
2. **Reference them naturally in conversation**
- "Your design mentions using Redis, but we just realized SQLite fits better..."
- "The proposal scopes this to premium users, but we're now thinking everyone..."
3. **Offer to capture when decisions are made**
| Insight Type | Where to Capture |
|----------------------------|--------------------------------|
| New requirement discovered | `specs/<capability>/spec.md` |
| Requirement changed | `specs/<capability>/spec.md` |
| Design decision made | `design.md` |
| Scope changed | `proposal.md` |
| New work identified | `tasks.md` |
| Assumption invalidated | Relevant artifact |
Example offers:
- "That's a design decision. Capture it in design.md?"
- "This is a new requirement. Add it to specs?"
- "This changes scope. Update the proposal?"
4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
---
## What You Don't Have To Do
- Follow a script
- Ask the same questions every time
- Produce a specific artifact
- Reach a conclusion
- Stay on topic if a tangent is valuable
- Be brief (this is thinking time)
---
## Ending Discovery
There's no required ending. Discovery might:
- **Flow into a proposal**: "Ready to start? I can create a change proposal."
- **Result in artifact updates**: "Updated design.md with these decisions"
- **Just provide clarity**: User has what they need, moves on
- **Continue later**: "We can pick this up anytime"
When things crystallize, you might offer a summary - but it's optional. Sometimes the thinking IS the value.
---
## Guardrails
- **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
- **Don't fake understanding** - If something is unclear, dig deeper
- **Don't rush** - Discovery is thinking time, not task time
- **Don't force structure** - Let patterns emerge naturally
- **Don't auto-capture** - Offer to save insights, don't just do it
- **Do visualize** - A good diagram is worth many paragraphs
- **Do explore the codebase** - Ground discussions in reality
- **Do question assumptions** - Including the user's and your own
---
name: "OPSX: Propose"
description: Propose a new change - create it and generate all artifacts in one step
category: Workflow
tags: [workflow, artifacts, experimental]
---
Propose a new change - create the change and generate all artifacts in one step.
I'll create a change with artifacts:
- proposal.md (what & why)
- design.md (how)
- tasks.md (implementation steps)
When ready to implement, run /opsx:apply
---
**Input**: The argument after `/opsx:propose` is the change name (kebab-case), OR a description of what the user wants to build.
**Steps**
1. **If no input provided, ask what they want to build**
Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
> "What change do you want to work on? Describe what you want to build or fix."
From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
**IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
2. **Create the change directory**
```bash
openspec new change "<name>"
```
This creates a scaffolded change at `openspec/changes/<name>/` with `.openspec.yaml`.
3. **Get the artifact build order**
```bash
openspec status --change "<name>" --json
```
Parse the JSON to get:
- `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
- `artifacts`: list of all artifacts with their status and dependencies
4. **Create artifacts in sequence until apply-ready**
Use the **TodoWrite tool** to track progress through the artifacts.
Loop through artifacts in dependency order (artifacts with no pending dependencies first):
a. **For each artifact that is `ready` (dependencies satisfied)**:
- Get instructions:
```bash
openspec instructions <artifact-id> --change "<name>" --json
```
- The instructions JSON includes:
- `context`: Project background (constraints for you - do NOT include in output)
- `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
- `template`: The structure to use for your output file
- `instruction`: Schema-specific guidance for this artifact type
- `outputPath`: Where to write the artifact
- `dependencies`: Completed artifacts to read for context
- Read any completed dependency files for context
- Create the artifact file using `template` as the structure
- Apply `context` and `rules` as constraints - but do NOT copy them into the file
- Show brief progress: "Created <artifact-id>"
b. **Continue until all `applyRequires` artifacts are complete**
- After creating each artifact, re-run `openspec status --change "<name>" --json`
- Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array
- Stop when all `applyRequires` artifacts are done
c. **If an artifact requires user input** (unclear context):
- Use **AskUserQuestion tool** to clarify
- Then continue with creation
5. **Show final status**
```bash
openspec status --change "<name>"
```
**Output**
After completing all artifacts, summarize:
- Change name and location
- List of artifacts created with brief descriptions
- What's ready: "All artifacts created! Ready for implementation."
- Prompt: "Run `/opsx:apply` to start implementing."
**Artifact Creation Guidelines**
- Follow the `instruction` field from `openspec instructions` for each artifact type
- The schema defines what each artifact should contain - follow it
- Read dependency artifacts for context before creating new ones
- Use `template` as the structure for your output file - fill in its sections
- **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
- Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
- These guide what you write, but should never appear in the output
**Guardrails**
- Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`)
- Always read dependency artifacts before creating a new one
- If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
- If a change with that name already exists, ask if user wants to continue it or create a new one
- Verify each artifact file exists after writing before proceeding to next
{
"permissions": {
"allow": [
"WebSearch",
"Read(//d/Code/agent-lab/**)",
"Bash(gh --version)",
"Bash(npm --version)",
"Bash(npm install *)",
"Bash(openspec init *)",
"Bash(npx skills *)"
]
}
}
---
name: openspec-apply-change
description: Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.
license: MIT
compatibility: Requires openspec CLI.
metadata:
author: openspec
version: "1.0"
generatedBy: "1.3.1"
---
Implement tasks from an OpenSpec change.
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
**Steps**
1. **Select the change**
If a name is provided, use it. Otherwise:
- Infer from conversation context if the user mentioned a change
- Auto-select if only one active change exists
- If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).
2. **Check status to understand the schema**
```bash
openspec status --change "<name>" --json
```
Parse the JSON to understand:
- `schemaName`: The workflow being used (e.g., "spec-driven")
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
3. **Get apply instructions**
```bash
openspec instructions apply --change "<name>" --json
```
This returns:
- `contextFiles`: artifact ID -> array of concrete file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)
- Progress (total, complete, remaining)
- Task list with status
- Dynamic instruction based on current state
**Handle states:**
- If `state: "blocked"` (missing artifacts): show message, suggest using openspec-continue-change
- If `state: "all_done"`: congratulate, suggest archive
- Otherwise: proceed to implementation
4. **Read context files**
Read every file path listed under `contextFiles` from the apply instructions output.
The files depend on the schema being used:
- **spec-driven**: proposal, specs, design, tasks
- Other schemas: follow the contextFiles from CLI output
5. **Show current progress**
Display:
- Schema being used
- Progress: "N/M tasks complete"
- Remaining tasks overview
- Dynamic instruction from CLI
6. **Implement tasks (loop until done or blocked)**
For each pending task:
- Show which task is being worked on
- Make the code changes required
- Keep changes minimal and focused
- Mark task complete in the tasks file: `- [ ]``- [x]`
- Continue to next task
**Pause if:**
- Task is unclear → ask for clarification
- Implementation reveals a design issue → suggest updating artifacts
- Error or blocker encountered → report and wait for guidance
- User interrupts
7. **On completion or pause, show status**
Display:
- Tasks completed this session
- Overall progress: "N/M tasks complete"
- If all done: suggest archive
- If paused: explain why and wait for guidance
**Output During Implementation**
```
## Implementing: <change-name> (schema: <schema-name>)
Working on task 3/7: <task description>
[...implementation happening...]
✓ Task complete
Working on task 4/7: <task description>
[...implementation happening...]
✓ Task complete
```
**Output On Completion**
```
## Implementation Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 7/7 tasks complete ✓
### Completed This Session
- [x] Task 1
- [x] Task 2
...
All tasks complete! Ready to archive this change.
```
**Output On Pause (Issue Encountered)**
```
## Implementation Paused
**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 4/7 tasks complete
### Issue Encountered
<description of the issue>
**Options:**
1. <option 1>
2. <option 2>
3. Other approach
What would you like to do?
```
**Guardrails**
- Keep going through tasks until done or blocked
- Always read context files before starting (from the apply instructions output)
- If task is ambiguous, pause and ask before implementing
- If implementation reveals issues, pause and suggest artifact updates
- Keep code changes minimal and scoped to each task
- Update task checkbox immediately after completing each task
- Pause on errors, blockers, or unclear requirements - don't guess
- Use contextFiles from CLI output, don't assume specific file names
**Fluid Workflow Integration**
This skill supports the "actions on a change" model:
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
---
name: openspec-archive-change
description: Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.
license: MIT
compatibility: Requires openspec CLI.
metadata:
author: openspec
version: "1.0"
generatedBy: "1.3.1"
---
Archive a completed change in the experimental workflow.
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
**Steps**
1. **If no change name provided, prompt for selection**
Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
Show only active changes (not already archived).
Include the schema used for each change if available.
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
2. **Check artifact completion status**
Run `openspec status --change "<name>" --json` to check artifact completion.
Parse the JSON to understand:
- `schemaName`: The workflow being used
- `artifacts`: List of artifacts with their status (`done` or other)
**If any artifacts are not `done`:**
- Display warning listing incomplete artifacts
- Use **AskUserQuestion tool** to confirm user wants to proceed
- Proceed if user confirms
3. **Check task completion status**
Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
**If incomplete tasks found:**
- Display warning showing count of incomplete tasks
- Use **AskUserQuestion tool** to confirm user wants to proceed
- Proceed if user confirms
**If no tasks file exists:** Proceed without task-related warning.
4. **Assess delta spec sync state**
Check for delta specs at `openspec/changes/<name>/specs/`. If none exist, proceed without sync prompt.
**If delta specs exist:**
- Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`
- Determine what changes would be applied (adds, modifications, removals, renames)
- Show a combined summary before prompting
**Prompt options:**
- If changes needed: "Sync now (recommended)", "Archive without syncing"
- If already synced: "Archive now", "Sync anyway", "Cancel"
If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke openspec-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.
5. **Perform the archive**
Create the archive directory if it doesn't exist:
```bash
mkdir -p openspec/changes/archive
```
Generate target name using current date: `YYYY-MM-DD-<change-name>`
**Check if target already exists:**
- If yes: Fail with error, suggest renaming existing archive or using different date
- If no: Move the change directory to archive
```bash
mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
```
6. **Display summary**
Show archive completion summary including:
- Change name
- Schema that was used
- Archive location
- Whether specs were synced (if applicable)
- Note about any warnings (incomplete artifacts/tasks)
**Output On Success**
```
## Archive Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
**Specs:** ✓ Synced to main specs (or "No delta specs" or "Sync skipped")
All artifacts complete. All tasks complete.
```
**Guardrails**
- Always prompt for change selection if not provided
- Use artifact graph (openspec status --json) for completion checking
- Don't block archive on warnings - just inform and confirm
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
- Show clear summary of what happened
- If sync is requested, use openspec-sync-specs approach (agent-driven)
- If delta specs exist, always run the sync assessment and show the combined summary before prompting
This diff is collapsed.
---
name: openspec-propose
description: Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.
license: MIT
compatibility: Requires openspec CLI.
metadata:
author: openspec
version: "1.0"
generatedBy: "1.3.1"
---
Propose a new change - create the change and generate all artifacts in one step.
I'll create a change with artifacts:
- proposal.md (what & why)
- design.md (how)
- tasks.md (implementation steps)
When ready to implement, run /opsx:apply
---
**Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
**Steps**
1. **If no clear input provided, ask what they want to build**
Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
> "What change do you want to work on? Describe what you want to build or fix."
From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
**IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
2. **Create the change directory**
```bash
openspec new change "<name>"
```
This creates a scaffolded change at `openspec/changes/<name>/` with `.openspec.yaml`.
3. **Get the artifact build order**
```bash
openspec status --change "<name>" --json
```
Parse the JSON to get:
- `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
- `artifacts`: list of all artifacts with their status and dependencies
4. **Create artifacts in sequence until apply-ready**
Use the **TodoWrite tool** to track progress through the artifacts.
Loop through artifacts in dependency order (artifacts with no pending dependencies first):
a. **For each artifact that is `ready` (dependencies satisfied)**:
- Get instructions:
```bash
openspec instructions <artifact-id> --change "<name>" --json
```
- The instructions JSON includes:
- `context`: Project background (constraints for you - do NOT include in output)
- `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
- `template`: The structure to use for your output file
- `instruction`: Schema-specific guidance for this artifact type
- `outputPath`: Where to write the artifact
- `dependencies`: Completed artifacts to read for context
- Read any completed dependency files for context
- Create the artifact file using `template` as the structure
- Apply `context` and `rules` as constraints - but do NOT copy them into the file
- Show brief progress: "Created <artifact-id>"
b. **Continue until all `applyRequires` artifacts are complete**
- After creating each artifact, re-run `openspec status --change "<name>" --json`
- Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array
- Stop when all `applyRequires` artifacts are done
c. **If an artifact requires user input** (unclear context):
- Use **AskUserQuestion tool** to clarify
- Then continue with creation
5. **Show final status**
```bash
openspec status --change "<name>"
```
**Output**
After completing all artifacts, summarize:
- Change name and location
- List of artifacts created with brief descriptions
- What's ready: "All artifacts created! Ready for implementation."
- Prompt: "Run `/opsx:apply` or ask me to implement to start working on the tasks."
**Artifact Creation Guidelines**
- Follow the `instruction` field from `openspec instructions` for each artifact type
- The schema defines what each artifact should contain - follow it
- Read dependency artifacts for context before creating new ones
- Use `template` as the structure for your output file - fill in its sections
- **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
- Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
- These guide what you write, but should never appear in the output
**Guardrails**
- Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`)
- Always read dependency artifacts before creating a new one
- If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
- If a change with that name already exists, ask if user wants to continue it or create a new one
- Verify each artifact file exists after writing before proceeding to next
This diff is collapsed.
This diff is collapsed.
...@@ -106,17 +106,17 @@ ...@@ -106,17 +106,17 @@
<!--jackson--> <!--jackson-->
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId> <artifactId>jackson-databind</artifactId>
<version>2.18.3</version> <version>2.18.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-annotations</artifactId>
<version>2.18.3</version> <version>2.18.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.datatype</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-datatype-jsr310</artifactId> <artifactId>jackson-core</artifactId>
<version>2.18.3</version> <version>2.18.3</version>
</dependency> </dependency>
<dependency> <dependency>
......
package com.infoepoch.pms.agent.common.utils;
import org.apache.commons.lang3.StringUtils;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import java.nio.charset.StandardCharsets;
import java.security.Key;
import java.security.SecureRandom;
import java.util.Base64;
/**
* AES加密
*/
public class AESTool {
private static Key key;
private static String KEY_STR = "supermarket-xjy-2022-09-23";
private static String KEY_ALGORITHM = "AES";
private static String CIPHER_ALGORITHM = "AES/ECB/PKCS5Padding";
static {
try {
KeyGenerator kgen = KeyGenerator.getInstance(KEY_ALGORITHM);
SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
random.setSeed(KEY_STR.getBytes(StandardCharsets.UTF_8));
kgen.init(128, random);
key = kgen.generateKey();
kgen = null;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* 获取加密后的字符串
*
* @param str
* @return
*/
public static String getEncryptString(String str) {
try {
if (judgeEncryptFlag(str))
return str; // 如果字符串已经加密,不会进行二次加密
byte[] bytes = str.getBytes(StandardCharsets.UTF_8);
Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
cipher.init(Cipher.ENCRYPT_MODE, key);
byte[] doFinal = cipher.doFinal(bytes);
return Base64.getEncoder().encodeToString(doFinal);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* 获取解密后的字符串
*
* @param str
* @return
*/
public static String getDecryptString(String str) {
try {
if (judgeEncryptFlagReverse(str))
return str;// 如果字符串未加密,返回原字符串
byte[] bytes = Base64.getDecoder().decode(str);
Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] doFinal = cipher.doFinal(bytes);
return new String(doFinal, StandardCharsets.UTF_8);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* 判断是否已加密
* 原理:加密后的字符串使用Base64编码了,如果进行了编码则是加密后的字符串,否则就是未加密的
*
* @param str
* @return true-已加密 false-未加密
*/
public static boolean judgeEncryptFlag(String str) {
if (StringUtils.isBlank(str))
return true;
try {
byte[] bytes = Base64.getDecoder().decode(str);
Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] doFinal = cipher.doFinal(bytes);
return doFinal != null;
} catch (Exception e) {
return false;
}
}
/**
* 判断字符串是否加密(反向标识)
*
* @param str
* @return true-未加密 false-已加密
*/
public static boolean judgeEncryptFlagReverse(String str) {
return !judgeEncryptFlag(str);
}
public static String encryptWithKey(String keyStr, String str) {
try {
if (judgeEncryptWithKey(keyStr, str))
return str; // 如果字符串已经加密,不会进行二次加密
Key key = getKey(keyStr);
byte[] bytes = str.getBytes(StandardCharsets.UTF_8);
Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
cipher.init(Cipher.ENCRYPT_MODE, key);
byte[] doFinal = cipher.doFinal(bytes);
return Base64.getEncoder().encodeToString(doFinal);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public static String decryptWithKey(String keyStr, String str) {
try {
// if (judgeEncryptWithKeyReverse(keyStr, str))
// return str;// 如果字符串未加密,返回原字符串
Key key = getKey(keyStr);
// byte[] bytes = Base64.getDecoder().decode(str);
byte[] bytes = str.getBytes(StandardCharsets.UTF_8);
Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] doFinal = cipher.doFinal(bytes);
return new String(doFinal, StandardCharsets.UTF_8);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private static boolean judgeEncryptWithKey(String keyStr, String str) {
if (StringUtils.isBlank(str))
return true;
try {
Key key = getKey(keyStr);
byte[] bytes = Base64.getDecoder().decode(str);
Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] doFinal = cipher.doFinal(bytes);
return doFinal != null;
} catch (Exception e) {
return false;
}
}
private static boolean judgeEncryptWithKeyReverse(String keyStr, String str) {
return !judgeEncryptWithKey(keyStr, str);
}
private static Key getKey(String keyStr) {
Key key;
try {
KeyGenerator kgen = KeyGenerator.getInstance(KEY_ALGORITHM);
SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
random.setSeed(keyStr.getBytes(StandardCharsets.UTF_8));
kgen.init(128, random);
key = kgen.generateKey();
kgen = null;
return key;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
package com.infoepoch.pms.agent.common.utils;
import java.util.Base64;
public class Base64Utils {
/**
* 加密
*
* @param str
* @return
*/
public static String encode(String str) {
return AESTool.getEncryptString(str);
}
/**
* 解密
*
* @param str
* @return
*/
public static String decode(String str) {
return new String(Base64.getDecoder().decode(str));
}
}
...@@ -2,6 +2,7 @@ package com.infoepoch.pms.agent.config; ...@@ -2,6 +2,7 @@ package com.infoepoch.pms.agent.config;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.jsontype.BasicPolymorphicTypeValidator;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
...@@ -14,7 +15,7 @@ import org.springframework.data.redis.serializer.StringRedisSerializer; ...@@ -14,7 +15,7 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
public class RedisConfiguration { public class RedisConfiguration {
@Bean @Bean
RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory connectionFactory) { public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory connectionFactory) {
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>(); RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
redisTemplate.setConnectionFactory(connectionFactory); redisTemplate.setConnectionFactory(connectionFactory);
...@@ -34,6 +35,15 @@ public class RedisConfiguration { ...@@ -34,6 +35,15 @@ public class RedisConfiguration {
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new JavaTimeModule()); objectMapper.registerModule(new JavaTimeModule());
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
// 开启默认类型,使序列化时写入 @class 信息,反序列化时才能还原成原对象
objectMapper.activateDefaultTyping(
BasicPolymorphicTypeValidator.builder()
.allowIfBaseType(Object.class) // 允许所有 Object 子类
.build(),
ObjectMapper.DefaultTyping.NON_FINAL, // 对非 final 类都写入类型
com.fasterxml.jackson.annotation.JsonTypeInfo.As.PROPERTY
);
return objectMapper; return objectMapper;
} }
} }
\ No newline at end of file
package com.infoepoch.pms.agent.config;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
class SpaForwardController {
@GetMapping({
"/",
"/{path:^(?!api$|auth$|assets$|favicon\\.ico$)[^\\.]*$}",
"/{path:^(?!api$|auth$|assets$|favicon\\.ico$)[^\\.]*$}/{*subPath}"
})
String forwardFrontendRoute() {
return "forward:/index.html";
}
}
package com.infoepoch.pms.agent.controller;
import com.infoepoch.pms.agent.common.utils.Base64Utils;
import com.infoepoch.pms.agent.common.utils.SnowFlake;
import com.infoepoch.pms.agent.config.JsonUtils;
import com.infoepoch.pms.agent.domain.baisc.user.UserLoginType;
import com.infoepoch.pms.agent.platform.shared.exception.BusinessException;
import com.infoepoch.pms.agent.platform.shared.exception.ValidationException;
import com.infoepoch.pms.agent.platform.shared.response.Result;
import com.infoepoch.pms.agent.platform.shared.response.ResultCode;
import com.infoepoch.pms.agent.properties.SsoProperties;
import com.infoepoch.pms.agent.service.auth.ExternalSsoTokenVerifier;
import com.infoepoch.pms.agent.service.auth.LoginSessionService;
import com.infoepoch.pms.agent.service.auth.TargetUserService;
import com.infoepoch.pms.agent.service.auth.dto.ExternalSsoUser;
import com.infoepoch.pms.agent.service.auth.dto.LoginSessionUser;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
import java.net.URI;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
/**
* 外部系统单点登录控制器。
* <p>
* 负责处理 SSO Token 验证、登录会话创建及当前用户查询。
* </p>
*/
@RestController
@RequestMapping("/auth")
@RequiredArgsConstructor
public class ExternalSsoController {
private static final String DEFAULT_REDIRECT = "/pms-agent/";
private final ExternalSsoTokenVerifier tokenVerifier;
private final TargetUserService targetUserService;
private final LoginSessionService loginSessionService;
private final SsoProperties ssoProperties;
/**
* 外部系统单点登录入口。
* <p>
* 从 Cookie 中提取 SSO Token 进行验证,匹配目标系统用户后创建登录会话,
* 清除 SSO Cookie 并重定向到指定页面。
* </p>
*
* @param redirect 登录后重定向路径,为空时使用默认路径
* @param request HTTP 请求
* @param response HTTP 响应
* @throws IOException 重定向失败时
*/
@GetMapping("/external-sso")
public void externalSso(@RequestParam(required = false) String redirect,
HttpServletRequest request,
HttpServletResponse response) throws IOException {
String token = loginSessionService.getCookieValue(request, ssoProperties.getCookieName());
if (StringUtils.isBlank(token)) {
throw new BusinessException(ResultCode.PARAM_ERROR,
"单点登录失败,缺少 " + ssoProperties.getCookieName());
}
ExternalSsoUser ssoUser = tokenVerifier.verify(token);
LoginSessionUser loginUser = targetUserService.findLoginSessionUser(ssoUser.getUsername());
loginSessionService.createLoginSession(loginUser, response);
loginSessionService.clearSsoCookie(response);
response.sendRedirect(normalizeRedirect(redirect));
}
/**
* 获取当前登录用户信息。
*
* @param request HTTP 请求
* @return 当前登录用户
*/
@GetMapping("/current-user")
public Result<LoginSessionUser> currentUser(HttpServletRequest request) {
return Result.success(loginSessionService.getCurrentUser(request));
}
/**
* 退出当前系统登录会话。
*
* @param request HTTP 请求
* @param response HTTP 响应
* @return 退出结果
*/
@PostMapping("/logout")
public Result<Void> logout(HttpServletRequest request, HttpServletResponse response) {
loginSessionService.clearLoginSession(request, response);
return Result.success(null);
}
/**
* 校验并规范化重定向地址,防止开放重定向攻击。不安全的地址回退到默认路径。
*
* @param redirect 原始重定向地址
* @return 安全的规范化路径
*/
private String normalizeRedirect(String redirect) {
if (StringUtils.isBlank(redirect)) {
return DEFAULT_REDIRECT;
}
try {
if (redirect.contains("\\") || redirect.startsWith("//")) {
return DEFAULT_REDIRECT;
}
String decoded = URLDecoder.decode(redirect, StandardCharsets.UTF_8);
if (decoded.contains("\\") || decoded.startsWith("//")) {
return DEFAULT_REDIRECT;
}
URI uri = URI.create(decoded).normalize();
if (uri.isAbsolute() || uri.getRawAuthority() != null) {
return DEFAULT_REDIRECT;
}
String path = uri.getPath();
if ("/pms-agent".equals(path) || path.startsWith("/pms-agent/")) {
return uri.getRawQuery() == null ? path : path + "?" + uri.getRawQuery();
}
return DEFAULT_REDIRECT;
} catch (Exception ex) {
return DEFAULT_REDIRECT;
}
}
}
...@@ -15,6 +15,7 @@ public enum ResultCode { ...@@ -15,6 +15,7 @@ public enum ResultCode {
RESOURCE_NOT_FOUND(1001, "资源不存在"), RESOURCE_NOT_FOUND(1001, "资源不存在"),
RESOURCE_ALREADY_EXISTS(1002, "资源已存在"), RESOURCE_ALREADY_EXISTS(1002, "资源已存在"),
RESOURCE_IN_USE(1003, "资源仍被引用,无法删除"), RESOURCE_IN_USE(1003, "资源仍被引用,无法删除"),
UNAUTHORIZED(401001, "未登录或登录已过期"),
// 智能体管理 1100-1199 // 智能体管理 1100-1199
AGENT_NOT_FOUND(1100, "智能体不存在"), AGENT_NOT_FOUND(1100, "智能体不存在"),
......
package com.infoepoch.pms.agent.properties;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 单点登录配置属性。
* <p>
* 绑定 application.yml 中 pms.sso 前缀的配置。
* </p>
*/
@Getter
@Setter
@ConfigurationProperties(prefix = "pms.sso")
public class SsoProperties {
/** SSO Token Cookie 名称 */
private String cookieName = "pms_agent_sso_token";
/** 登录会话 Cookie 名称 */
private String sessionCookieName = "pms_agent_session";
/** Token 接收方标识 */
private String audience = "pms-agent";
/** Token 最大有效期(秒) */
private long tokenExpireSeconds = 120;
/** 时钟偏差容忍(秒) */
private long clockSkewSeconds = 60;
/** 登录会话有效期(秒) */
private long sessionTtlSeconds = 7200;
/** 是否使用 Secure Cookie */
private boolean secureCookie = false;
/** 信任的来源系统及其密钥 */
private Map<String, TrustedIssuer> trustedIssuers = new LinkedHashMap<>();
/**
* 根据来源系统和密钥版本获取 AES 解密密钥。
*
* @param issuer 来源系统标识
* @param kid 密钥版本标识
* @return Base64 编码的 AES 密钥,不存在时返回 null
*/
public String getAesKey(String issuer, String kid) {
TrustedIssuer trustedIssuer = trustedIssuers.get(issuer);
if (trustedIssuer == null) {
return null;
}
return trustedIssuer.getKeys().get(kid);
}
/**
* 信任的来源系统及其密钥配置。
*/
@Getter
@Setter
public static class TrustedIssuer {
/** 当前使用的密钥版本标识 */
private String activeKid;
/** 密钥版本到 Base64 编码的 AES 密钥的映射 */
private Map<String, String> keys = new LinkedHashMap<>();
}
}
package com.infoepoch.pms.agent.service.auth;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.infoepoch.pms.agent.platform.shared.exception.BusinessException;
import com.infoepoch.pms.agent.platform.shared.response.ResultCode;
import com.infoepoch.pms.agent.properties.SsoProperties;
import com.infoepoch.pms.agent.service.auth.dto.ExternalSsoUser;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.crypto.AEADBadTagException;
import javax.crypto.Cipher;
import javax.crypto.spec.GCMParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.util.Map;
/**
* 外部系统 SSO Token 验证服务。
* <p>
* 负责解析、解密、校验 Token 的完整流程,包括时效校验和防重放保护。
* </p>
*/
@Service
@RequiredArgsConstructor
public class ExternalSsoTokenVerifier {
private static final int GCM_TAG_LENGTH = 128;
private final SsoProperties ssoProperties;
private final UsedSsoTokenService usedSsoTokenService;
private final ObjectMapper objectMapper = new ObjectMapper();
/**
* 验证 SSO Token 的完整流程:解析结构、获取密钥、解密 payload、校验字段、防重放。
*
* @param token 原始 Token 字符串
* @return 验证通过后的用户信息
* @throws BusinessException Token 不合法、已过期或已被使用时
*/
public ExternalSsoUser verify(String token) {
String[] parts = parseTokenParts(token);
String issuer = parts[1];
String kid = parts[2];
String aesKey = ssoProperties.getAesKey(issuer, kid);
if (StringUtils.isBlank(aesKey)) {
throw fail("单点登录失败,未信任的来源系统或密钥版本:" + issuer + "/" + kid);
}
Map<String, Object> payload = decryptPayload(parts, issuer, kid, aesKey);
verifyPayload(payload, issuer, kid);
return new ExternalSsoUser(issuer, stringPayload(payload, "username"), stringPayload(payload, "jti"));
}
/**
* 解析 Token 各组成部分(版本、颁发者、密钥版本、IV、密文)。
*
* @param token 原始 Token 字符串
* @return 以 "." 分割的 Token 片段数组
* @throws BusinessException Token 格式不正确时
*/
private String[] parseTokenParts(String token) {
if (StringUtils.isBlank(token)) {
throw fail("单点登录失败,Token 格式错误");
}
String[] parts = token.split("\\.");
if (parts.length != 5 || !"v1".equals(parts[0])) {
throw fail("单点登录失败,Token 格式错误");
}
return parts;
}
/**
* 使用 AES-GCM 解密 Token payload。
*
* @param parts Token 片段数组
* @param issuer 来源系统标识
* @param kid 密钥版本标识
* @param aesKey Base64 编码的 AES 密钥
* @return 解密后的 payload JSON 对象
* @throws BusinessException 解密或校验失败时
*/
private Map<String, Object> decryptPayload(String[] parts, String issuer, String kid, String aesKey) {
try {
Base64.Decoder decoder = Base64.getUrlDecoder();
byte[] iv = decoder.decode(parts[3]);
byte[] encrypted = decoder.decode(parts[4]);
Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
SecretKeySpec keySpec = new SecretKeySpec(decodeKey(aesKey), "AES");
cipher.init(Cipher.DECRYPT_MODE, keySpec, new GCMParameterSpec(GCM_TAG_LENGTH, iv));
cipher.updateAAD(buildAad(issuer, kid));
byte[] plaintext = cipher.doFinal(encrypted);
return objectMapper.readValue(plaintext, new TypeReference<>() {
});
} catch (AEADBadTagException ex) {
throw fail("单点登录失败,Token 解密或校验失败");
} catch (BusinessException ex) {
throw ex;
} catch (Exception ex) {
throw fail("单点登录失败,Token 解密或校验失败");
}
}
/**
* 校验 Token payload 各字段的合法性:颁发者、接收方、时间窗口和防重放。
*
* @param payload 解密后的 payload
* @param issuer 来源系统标识
* @param kid 密钥版本标识
* @throws BusinessException 任一校验不通过时
*/
private void verifyPayload(Map<String, Object> payload, String issuer, String kid) {
if (!issuer.equals(payload.get("iss"))) {
throw fail("单点登录失败,Token 来源系统不匹配");
}
if (!kid.equals(payload.get("kid"))) {
throw fail("单点登录失败,Token 密钥版本不匹配");
}
if (!ssoProperties.getAudience().equals(payload.get("aud"))) {
throw fail("单点登录失败,Token 接收方错误");
}
String username = stringPayload(payload, "username");
if (StringUtils.isBlank(username)) {
throw fail("单点登录失败,Token 缺少用户名");
}
String tokenId = stringPayload(payload, "jti");
if (StringUtils.isBlank(tokenId)) {
throw fail("单点登录失败,Token 缺少一次性标识");
}
long now = System.currentTimeMillis();
long iat = longPayload(payload, "iat");
long exp = longPayload(payload, "exp");
long clockSkewMillis = TimeUnitSupport.secondsToMillis(ssoProperties.getClockSkewSeconds());
long maxLifetimeMillis = TimeUnitSupport.secondsToMillis(ssoProperties.getTokenExpireSeconds());
if (iat > now + clockSkewMillis) {
throw fail("单点登录失败,Token 签发时间异常");
}
if (exp <= iat || exp - iat > maxLifetimeMillis + clockSkewMillis) {
throw fail("单点登录失败,Token 有效期异常");
}
if (exp < now) {
throw fail("单点登录失败,Token 已过期");
}
if (!usedSsoTokenService.markUsed(issuer, tokenId, exp)) {
throw fail("单点登录失败,Token 已被使用");
}
}
/**
* 解码 Base64 编码的 AES 密钥并校验长度(必须为 32 字节)。
*
* @param value Base64 编码的密钥字符串
* @return 解码后的密钥字节数组
* @throws BusinessException 密钥格式或长度不正确时
*/
private byte[] decodeKey(String value) {
try {
byte[] key = Base64.getDecoder().decode(value);
if (key.length != 32) {
throw fail("单点登录失败,AES 密钥必须是 Base64 编码的 32 字节随机值");
}
return key;
} catch (IllegalArgumentException ex) {
throw fail("单点登录失败,AES 密钥必须是 Base64 编码的 32 字节随机值");
}
}
/**
* 构造 AES-GCM 的附加认证数据(AAD),格式为 v1.{issuer}.{kid}.{audience}。
*
* @param issuer 来源系统标识
* @param kid 密钥版本标识
* @return AAD 字节数组
*/
private byte[] buildAad(String issuer, String kid) {
return ("v1." + issuer + "." + kid + "." + ssoProperties.getAudience())
.getBytes(StandardCharsets.UTF_8);
}
/** 从 payload 中获取字符串字段值,字段不存在时返回 null。 */
private String stringPayload(Map<String, Object> payload, String name) {
Object value = payload.get(name);
return value == null ? null : String.valueOf(value);
}
/** 从 payload 中获取长整型字段值,字段不存在或非数字时抛出异常。 */
private long longPayload(Map<String, Object> payload, String name) {
Object value = payload.get(name);
if (value instanceof Number number) {
return number.longValue();
}
throw fail("单点登录失败,Token 缺少时间字段");
}
/** 构造参数校验失败的业务异常。 */
private BusinessException fail(String message) {
return new BusinessException(ResultCode.PARAM_ERROR, message);
}
private static class TimeUnitSupport {
private static long secondsToMillis(long seconds) {
return seconds * 1000L;
}
}
}
package com.infoepoch.pms.agent.service.auth;
import com.infoepoch.pms.agent.common.utils.component.RedisTool;
import com.infoepoch.pms.agent.config.JsonUtils;
import com.infoepoch.pms.agent.platform.shared.exception.BusinessException;
import com.infoepoch.pms.agent.platform.shared.response.ResultCode;
import com.infoepoch.pms.agent.properties.SsoProperties;
import com.infoepoch.pms.agent.service.auth.dto.LoginSessionUser;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
/**
* 登录会话管理服务。
* <p>
* 负责会话 Cookie 操作和 Redis 会话存储。
* </p>
*/
@Service
@RequiredArgsConstructor
public class LoginSessionService {
private static final String SESSION_KEY_PREFIX = "pms-agent:session:";
private final RedisTool redisTool;
private final SsoProperties ssoProperties;
/**
* 创建登录会话,生成 Session ID 写入 Redis 并设置 Cookie。
*
* @param user 登录用户信息
* @param response HTTP 响应
*/
public void createLoginSession(LoginSessionUser user, HttpServletResponse response) {
String sessionId = UUID.randomUUID().toString().replace("-", "");
redisTool.put(SESSION_KEY_PREFIX + sessionId, user, ssoProperties.getSessionTtlSeconds(), TimeUnit.SECONDS);
addCookie(response, ssoProperties.getSessionCookieName(), sessionId, ssoProperties.getSessionTtlSeconds());
}
/**
* 从请求的 Session Cookie 中获取当前登录用户。
*
* @param request HTTP 请求
* @return 登录用户信息
* @throws BusinessException 会话不存在或已过期时
*/
public LoginSessionUser getCurrentUser(HttpServletRequest request) {
String sessionId = getCookieValue(request, ssoProperties.getSessionCookieName());
if (StringUtils.isBlank(sessionId)) {
throw new BusinessException(ResultCode.UNAUTHORIZED, "当前登录会话不存在或已过期");
}
LoginSessionUser user = redisTool.get(SESSION_KEY_PREFIX + sessionId);
if (user == null) {
throw new BusinessException(ResultCode.UNAUTHORIZED, "当前登录会话不存在或已过期");
}
return user;
}
/**
* 清除客户端 SSO Token Cookie。
*
* @param response HTTP 响应
*/
public void clearSsoCookie(HttpServletResponse response) {
addCookie(response, ssoProperties.getCookieName(), "", 0);
}
/**
* 清除当前登录会话和客户端 Session Cookie。
*
* @param request HTTP 请求
* @param response HTTP 响应
*/
public void clearLoginSession(HttpServletRequest request, HttpServletResponse response) {
String sessionId = getCookieValue(request, ssoProperties.getSessionCookieName());
if (StringUtils.isNotBlank(sessionId)) {
redisTool.remove(SESSION_KEY_PREFIX + sessionId);
}
addCookie(response, ssoProperties.getSessionCookieName(), "", 0);
}
/**
* 从请求中获取指定名称的 Cookie 值。优先从 Cookie 数组获取,若为空则回退到解析 Header。
*
* @param request HTTP 请求
* @param name Cookie 名称
* @return Cookie 值,不存在时返回 null
*/
public String getCookieValue(HttpServletRequest request, String name) {
Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (Cookie cookie : cookies) {
if (name.equals(cookie.getName())) {
return cookie.getValue();
}
}
}
String cookieHeader = request.getHeader("Cookie");
if (StringUtils.isBlank(cookieHeader)) {
return null;
}
String[] pairs = cookieHeader.split(";");
for (String pair : pairs) {
String[] parts = pair.trim().split("=", 2);
if (parts.length == 2 && name.equals(parts[0])) {
return parts[1];
}
}
return null;
}
/**
* 构造并设置 Cookie 响应头。
*
* @param response HTTP 响应
* @param name Cookie 名称
* @param value Cookie 值
* @param maxAgeSeconds Cookie 最大有效秒数
*/
private void addCookie(HttpServletResponse response, String name, String value, long maxAgeSeconds) {
StringBuilder cookie = new StringBuilder();
cookie.append(name).append("=").append(value == null ? "" : value)
.append("; Path=/")
.append("; Max-Age=").append(maxAgeSeconds)
.append("; HttpOnly")
.append("; SameSite=Lax");
if (ssoProperties.isSecureCookie()) {
cookie.append("; Secure");
}
response.addHeader("Set-Cookie", cookie.toString());
}
}
package com.infoepoch.pms.agent.service.auth;
import com.infoepoch.pms.agent.domain.baisc.user.User;
import com.infoepoch.pms.agent.domain.baisc.user.UserCriteria;
import com.infoepoch.pms.agent.domain.baisc.user.UserQueryService;
import com.infoepoch.pms.agent.platform.shared.exception.BusinessException;
import com.infoepoch.pms.agent.platform.shared.response.ResultCode;
import com.infoepoch.pms.agent.service.auth.dto.LoginSessionUser;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 目标系统用户匹配服务。
* <p>
* 根据 SSO 用户名查找本系统对应的可用用户。
* </p>
*/
@Service
@RequiredArgsConstructor
public class TargetUserService {
private final UserQueryService userQueryService;
/**
* 根据 SSO 用户名查找本系统对应的可用用户。需精确匹配且唯一、未被禁用。
*
* @param username SSO 用户名
* @return 登录会话用户信息
* @throws BusinessException 用户不存在、不唯一或已禁用时
*/
public LoginSessionUser findLoginSessionUser(String username) {
if (StringUtils.isBlank(username)) {
throw new BusinessException(ResultCode.PARAM_ERROR, "单点登录失败,Token 缺少用户名");
}
UserCriteria criteria = new UserCriteria();
criteria.setUsernameList(List.of(username));
criteria.setDisabled(false);
List<User> users = userQueryService.popupListNotRela(criteria).stream()
.filter(user -> username.equals(user.getUsername()))
.toList();
if (users.isEmpty()) {
throw new BusinessException(ResultCode.PARAM_ERROR, "单点登录失败,目标系统不存在该用户");
}
if (users.size() > 1) {
throw new BusinessException(ResultCode.PARAM_ERROR, "单点登录失败,目标系统用户匹配不唯一");
}
User user = users.get(0);
if (user.isDisabled()) {
throw new BusinessException(ResultCode.PARAM_ERROR, "单点登录失败,目标系统用户已禁用");
}
return new LoginSessionUser(
user.getId(),
user.getUsername(),
user.getFullname(),
user.getOrganizationId(),
user.getOrganizationName()
);
}
}
package com.infoepoch.pms.agent.service.auth;
import com.infoepoch.pms.agent.common.utils.component.RedisTool;
import com.infoepoch.pms.agent.properties.SsoProperties;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.concurrent.TimeUnit;
/**
* Token 防重放服务。
* <p>
* 在 Redis 中记录已使用的 Token,确保一次性使用。
* </p>
*/
@Service
@RequiredArgsConstructor
public class UsedSsoTokenService {
private static final String KEY_PREFIX = "pms-agent:sso:used:";
private final RedisTool redisTool;
private final SsoProperties ssoProperties;
/**
* 标记 Token 已被使用。使用 Redis SETNX 保证原子性和幂等性。
*
* @param issuer 来源系统标识
* @param tokenId Token 唯一标识(jti)
* @param expireAtMillis Token 过期时间戳(毫秒)
* @return true 标记成功(首次使用),false 已被使用过
*/
public boolean markUsed(String issuer, String tokenId, long expireAtMillis) {
long now = System.currentTimeMillis();
long ttlMillis = Math.max(1_000L,
expireAtMillis - now + TimeUnit.SECONDS.toMillis(ssoProperties.getClockSkewSeconds()));
return redisTool.putIfAbsent(KEY_PREFIX + issuer + ":" + tokenId, "1", ttlMillis, TimeUnit.MILLISECONDS);
}
}
package com.infoepoch.pms.agent.service.auth.dto;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* 外部系统单点登录解析后的用户信息。
*/
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class ExternalSsoUser {
private String issuer;
private String username;
private String tokenId;
}
package com.infoepoch.pms.agent.service.auth.dto;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.io.Serializable;
/**
* 登录会话用户信息,存入 Redis 和 Session Cookie。
*/
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
public class LoginSessionUser implements Serializable {
private static final long serialVersionUID = 1L;
private String userId;
private String username;
private String fullname;
private String organizationId;
private String organizationName;
}
...@@ -40,6 +40,9 @@ app: ...@@ -40,6 +40,9 @@ app:
aes-key: ${AES_SECRET_KEY:AgentLabDefaultKey123456789012} # 生产环境必须通过环境变量覆盖,32字节 aes-key: ${AES_SECRET_KEY:AgentLabDefaultKey123456789012} # 生产环境必须通过环境变量覆盖,32字节
pms: pms:
care:
business:
base-url: http://localhost:8401
ai: ai:
zhiyu: zhiyu:
base-url: http://10.32.41.228:39080 base-url: http://10.32.41.228:39080
......
...@@ -43,6 +43,9 @@ app: ...@@ -43,6 +43,9 @@ app:
aes-key: ${AES_SECRET_KEY:AgentLabDefaultKey123456789012} # 生产环境必须通过环境变量覆盖,32字节 aes-key: ${AES_SECRET_KEY:AgentLabDefaultKey123456789012} # 生产环境必须通过环境变量覆盖,32字节
pms: pms:
care:
business:
base-url: http://${environment-ip}:8401
ai: ai:
zhiyu: zhiyu:
base-url: http://10.32.41.228:39080 base-url: http://10.32.41.228:39080
...@@ -58,7 +61,7 @@ pms: ...@@ -58,7 +61,7 @@ pms:
temperature: 0.5 temperature: 0.5
max-tokens: 50000 max-tokens: 50000
max-iterations: 5 max-iterations: 5
siliconFlow: siliconflow:
base-url: https://api.siliconflow.cn base-url: https://api.siliconflow.cn
api-key: sk-necxquynovkphnulbbfbsopeosgogrsuqgxxctzhbcbpntyh api-key: sk-necxquynovkphnulbbfbsopeosgogrsuqgxxctzhbcbpntyh
model: Qwen/Qwen3.5-27B model: Qwen/Qwen3.5-27B
......
...@@ -35,6 +35,9 @@ app: ...@@ -35,6 +35,9 @@ app:
pms: pms:
care:
business:
base-url: http://${environment-ip}:8401
ai: ai:
zhiyu: zhiyu:
base-url: http://10.32.41.228:39080 base-url: http://10.32.41.228:39080
...@@ -50,7 +53,7 @@ pms: ...@@ -50,7 +53,7 @@ pms:
temperature: 0.5 temperature: 0.5
max-tokens: 50000 max-tokens: 50000
max-iterations: 5 max-iterations: 5
siliconFlow: siliconflow:
base-url: https://api.siliconflow.cn base-url: https://api.siliconflow.cn
api-key: sk-necxquynovkphnulbbfbsopeosgogrsuqgxxctzhbcbpntyh api-key: sk-necxquynovkphnulbbfbsopeosgogrsuqgxxctzhbcbpntyh
model: Qwen/Qwen3.5-27B model: Qwen/Qwen3.5-27B
......
...@@ -51,7 +51,6 @@ pms: ...@@ -51,7 +51,6 @@ pms:
user-stream-item-delay-millis: 250 user-stream-item-delay-millis: 250
conversation-ttl-minutes: 120 conversation-ttl-minutes: 120
business: business:
base-url: http://localhost:8401
current-user-path: /union-js/api/functionCallTools/getCurrentUserInfo current-user-path: /union-js/api/functionCallTools/getCurrentUserInfo
eligible-activities-path: /union-js/api/functionCallTools/getActivityInfoList eligible-activities-path: /union-js/api/functionCallTools/getActivityInfoList
user-search-path: /union-js/api/functionCallTools/getUserInfoList user-search-path: /union-js/api/functionCallTools/getUserInfoList
...@@ -63,3 +62,24 @@ pms: ...@@ -63,3 +62,24 @@ pms:
kpi-path: /it-workbench/api/functionCallTools/queryKpiList kpi-path: /it-workbench/api/functionCallTools/queryKpiList
work-path: /it-workbench/api/functionCallTools/queryWorkList work-path: /it-workbench/api/functionCallTools/queryWorkList
minutes-path: /it-workbench/api/functionCallTools/queryMinutesList minutes-path: /it-workbench/api/functionCallTools/queryMinutesList
sso:
cookie-name: pms_agent_sso_token
session-cookie-name: pms_agent_session
audience: pms-agent
token-expire-seconds: 120
clock-skew-seconds: 60
session-ttl-seconds: 7200
secure-cookie: false
trusted-issuers:
union-js:
active-kid: 2026-04
keys:
2026-04: ${PMS_AGENT_SSO_UNION_JS_AES_KEY_2026_04:QWdlbnRMYWJEZWZhdWx0S2V5MTIzNDU2Nzg5MDEyMTE=}
portal:
active-kid: 2026-04
keys:
2026-04: ${PMS_AGENT_SSO_PORTAL_AES_KEY_2026_04:}
oa:
active-kid: 2026-04
keys:
2026-04: ${PMS_AGENT_SSO_OA_AES_KEY_2026_04:}
import{bV as F,c6 as M,c7 as u,c8 as v,y as I,D as i,C as T,al as N,x as V,d as D,E as l,bl as G,c9 as J,aO as K,aE as U,ap as Y,F as q,H as R,G as Q,J as X,f as H,U as Z,au as oo,ca as eo,a_ as ro,cb as no,cc as so,b_ as lo,aY as c}from"./index-DSCno0m2.js";function to(r){const{lineHeight:o,borderRadius:d,fontWeightStrong:b,baseColor:t,dividerColor:C,actionColor:P,textColor1:g,textColor2:s,closeColorHover:h,closeColorPressed:f,closeIconColor:m,closeIconColorHover:p,closeIconColorPressed:n,infoColor:e,successColor:x,warningColor:z,errorColor:y,fontSize:S}=r;return Object.assign(Object.assign({},M),{fontSize:S,lineHeight:o,titleFontWeight:b,borderRadius:d,border:`1px solid ${C}`,color:P,titleTextColor:g,iconColor:s,contentTextColor:s,closeBorderRadius:d,closeColorHover:h,closeColorPressed:f,closeIconColor:m,closeIconColorHover:p,closeIconColorPressed:n,borderInfo:`1px solid ${u(t,v(e,{alpha:.25}))}`,colorInfo:u(t,v(e,{alpha:.08})),titleTextColorInfo:g,iconColorInfo:e,contentTextColorInfo:s,closeColorHoverInfo:h,closeColorPressedInfo:f,closeIconColorInfo:m,closeIconColorHoverInfo:p,closeIconColorPressedInfo:n,borderSuccess:`1px solid ${u(t,v(x,{alpha:.25}))}`,colorSuccess:u(t,v(x,{alpha:.08})),titleTextColorSuccess:g,iconColorSuccess:x,contentTextColorSuccess:s,closeColorHoverSuccess:h,closeColorPressedSuccess:f,closeIconColorSuccess:m,closeIconColorHoverSuccess:p,closeIconColorPressedSuccess:n,borderWarning:`1px solid ${u(t,v(z,{alpha:.33}))}`,colorWarning:u(t,v(z,{alpha:.08})),titleTextColorWarning:g,iconColorWarning:z,contentTextColorWarning:s,closeColorHoverWarning:h,closeColorPressedWarning:f,closeIconColorWarning:m,closeIconColorHoverWarning:p,closeIconColorPressedWarning:n,borderError:`1px solid ${u(t,v(y,{alpha:.25}))}`,colorError:u(t,v(y,{alpha:.08})),titleTextColorError:g,iconColorError:y,contentTextColorError:s,closeColorHoverError:h,closeColorPressedError:f,closeIconColorError:m,closeIconColorHoverError:p,closeIconColorPressedError:n})}const io={common:F,self:to},ao=I("alert",`
line-height: var(--n-line-height);
border-radius: var(--n-border-radius);
position: relative;
transition: background-color .3s var(--n-bezier);
background-color: var(--n-color);
text-align: start;
word-break: break-word;
`,[i("border",`
border-radius: inherit;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
transition: border-color .3s var(--n-bezier);
border: var(--n-border);
pointer-events: none;
`),T("closable",[I("alert-body",[i("title",`
padding-right: 24px;
`)])]),i("icon",{color:"var(--n-icon-color)"}),I("alert-body",{padding:"var(--n-padding)"},[i("title",{color:"var(--n-title-text-color)"}),i("content",{color:"var(--n-content-text-color)"})]),N({originalTransition:"transform .3s var(--n-bezier)",enterToProps:{transform:"scale(1)"},leaveToProps:{transform:"scale(0.9)"}}),i("icon",`
position: absolute;
left: 0;
top: 0;
align-items: center;
justify-content: center;
display: flex;
width: var(--n-icon-size);
height: var(--n-icon-size);
font-size: var(--n-icon-size);
margin: var(--n-icon-margin);
`),i("close",`
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier);
position: absolute;
right: 0;
top: 0;
margin: var(--n-close-margin);
`),T("show-icon",[I("alert-body",{paddingLeft:"calc(var(--n-icon-margin-left) + var(--n-icon-size) + var(--n-icon-margin-right))"})]),T("right-adjust",[I("alert-body",{paddingRight:"calc(var(--n-close-size) + var(--n-padding) + 2px)"})]),I("alert-body",`
border-radius: var(--n-border-radius);
transition: border-color .3s var(--n-bezier);
`,[i("title",`
transition: color .3s var(--n-bezier);
font-size: 16px;
line-height: 19px;
font-weight: var(--n-title-font-weight);
`,[V("& +",[i("content",{marginTop:"9px"})])]),i("content",{transition:"color .3s var(--n-bezier)",fontSize:"var(--n-font-size)"})]),i("icon",{transition:"color .3s var(--n-bezier)"})]),co=Object.assign(Object.assign({},R.props),{title:String,showIcon:{type:Boolean,default:!0},type:{type:String,default:"default"},bordered:{type:Boolean,default:!0},closable:Boolean,onClose:Function,onAfterLeave:Function,onAfterHide:Function}),ho=D({name:"Alert",inheritAttrs:!1,props:co,slots:Object,setup(r){const{mergedClsPrefixRef:o,mergedBorderedRef:d,inlineThemeDisabled:b,mergedRtlRef:t}=q(r),C=R("Alert","-alert",ao,io,r,o),P=Q("Alert",t,o),g=H(()=>{const{common:{cubicBezierEaseInOut:n},self:e}=C.value,{fontSize:x,borderRadius:z,titleFontWeight:y,lineHeight:S,iconSize:$,iconMargin:E,iconMarginRtl:W,closeIconSize:w,closeBorderRadius:A,closeSize:_,closeMargin:B,closeMarginRtl:j,padding:k}=e,{type:a}=r,{left:L,right:O}=lo(E);return{"--n-bezier":n,"--n-color":e[c("color",a)],"--n-close-icon-size":w,"--n-close-border-radius":A,"--n-close-color-hover":e[c("closeColorHover",a)],"--n-close-color-pressed":e[c("closeColorPressed",a)],"--n-close-icon-color":e[c("closeIconColor",a)],"--n-close-icon-color-hover":e[c("closeIconColorHover",a)],"--n-close-icon-color-pressed":e[c("closeIconColorPressed",a)],"--n-icon-color":e[c("iconColor",a)],"--n-border":e[c("border",a)],"--n-title-text-color":e[c("titleTextColor",a)],"--n-content-text-color":e[c("contentTextColor",a)],"--n-line-height":S,"--n-border-radius":z,"--n-font-size":x,"--n-title-font-weight":y,"--n-icon-size":$,"--n-icon-margin":E,"--n-icon-margin-rtl":W,"--n-close-size":_,"--n-close-margin":B,"--n-close-margin-rtl":j,"--n-padding":k,"--n-icon-margin-left":L,"--n-icon-margin-right":O}}),s=b?X("alert",H(()=>r.type[0]),g,r):void 0,h=Z(!0),f=()=>{const{onAfterLeave:n,onAfterHide:e}=r;n&&n(),e&&e()};return{rtlEnabled:P,mergedClsPrefix:o,mergedBordered:d,visible:h,handleCloseClick:()=>{var n;Promise.resolve((n=r.onClose)===null||n===void 0?void 0:n.call(r)).then(e=>{e!==!1&&(h.value=!1)})},handleAfterLeave:()=>{f()},mergedTheme:C,cssVars:b?void 0:g,themeClass:s?.themeClass,onRender:s?.onRender}},render(){var r;return(r=this.onRender)===null||r===void 0||r.call(this),l(Y,{onAfterLeave:this.handleAfterLeave},{default:()=>{const{mergedClsPrefix:o,$slots:d}=this,b={class:[`${o}-alert`,this.themeClass,this.closable&&`${o}-alert--closable`,this.showIcon&&`${o}-alert--show-icon`,!this.title&&this.closable&&`${o}-alert--right-adjust`,this.rtlEnabled&&`${o}-alert--rtl`],style:this.cssVars,role:"alert"};return this.visible?l("div",Object.assign({},G(this.$attrs,b)),this.closable&&l(J,{clsPrefix:o,class:`${o}-alert__close`,onClick:this.handleCloseClick}),this.bordered&&l("div",{class:`${o}-alert__border`}),this.showIcon&&l("div",{class:`${o}-alert__icon`,"aria-hidden":"true"},K(d.icon,()=>[l(oo,{clsPrefix:o},{default:()=>{switch(this.type){case"success":return l(so,null);case"info":return l(no,null);case"warning":return l(ro,null);case"error":return l(eo,null);default:return null}}})])),l("div",{class:[`${o}-alert-body`,this.mergedBordered&&`${o}-alert-body--bordered`]},U(d.header,t=>{const C=t||this.title;return C?l("div",{class:`${o}-alert-body__title`},C):null}),d.default&&l("div",{class:`${o}-alert-body__content`},d))):null}})}});export{ho as N};
This diff is collapsed.
import{bG as m,d as p,bH as g,E as d,F as x,H as c,G as y,f as b,aY as h,bI as v,bJ as u}from"./index-DSCno0m2.js";import{g as w}from"./get-slot-Bk_rJcZu.js";function R(){return m}const z={self:R},C=Object.assign(Object.assign({},c.props),{align:String,justify:{type:String,default:"start"},inline:Boolean,vertical:Boolean,reverse:Boolean,size:{type:[String,Number,Array],default:"medium"},wrap:{type:Boolean,default:!0}}),F=p({name:"Flex",props:C,setup(r){const{mergedClsPrefixRef:t,mergedRtlRef:l}=x(r),a=c("Flex","-flex",void 0,z,r,t);return{rtlEnabled:y("Flex",l,t),mergedClsPrefix:t,margin:b(()=>{const{size:e}=r;if(Array.isArray(e))return{horizontal:e[0],vertical:e[1]};if(typeof e=="number")return{horizontal:e,vertical:e};const{self:{[h("gap",e)]:s}}=a.value,{row:n,col:i}=v(s);return{horizontal:u(i),vertical:u(n)}})}},render(){const{vertical:r,reverse:t,align:l,inline:a,justify:o,margin:e,wrap:s,mergedClsPrefix:n,rtlEnabled:i}=this,f=g(w(this),!1);return f.length?d("div",{role:"none",class:[`${n}-flex`,i&&`${n}-flex--rtl`],style:{display:a?"inline-flex":"flex",flexDirection:r&&!t?"column":r&&t?"column-reverse":!r&&t?"row-reverse":"row",justifyContent:o,flexWrap:!s||r?"nowrap":"wrap",alignItems:l,gap:`${e.vertical}px ${e.horizontal}px`}},f):null}});export{F as N};
This diff is collapsed.
import{bL as F,f as S,bk as U,U as C,ar as L,K as z,d as V,E,O as H,bM as W,b8 as x,aZ as Y,bl as A,bN as Z,F as J,ay as B,W as K,bO as ee,bH as te,bP as O,bQ as se,L as ne,M as P}from"./index-DSCno0m2.js";import{g as re}from"./get-slot-Bk_rJcZu.js";function ie(e){if(typeof e=="number")return{"":e.toString()};const t={};return e.split(/ +/).forEach(r=>{if(r==="")return;const[n,s]=r.split(":");s===void 0?t[""]=n:t[n]=s}),t}function _(e,t){var r;if(e==null)return;const n=ie(e);if(t===void 0)return n[""];if(typeof t=="string")return(r=n[t])!==null&&r!==void 0?r:n[""];if(Array.isArray(t)){for(let s=t.length-1;s>=0;--s){const i=t[s];if(i in n)return n[i]}return n[""]}else{let s,i=-1;return Object.keys(n).forEach(a=>{const l=Number(a);!Number.isNaN(l)&&t>=l&&l>=i&&(i=l,s=n[a])}),s}}const oe={xs:0,s:640,m:1024,l:1280,xl:1536,"2xl":1920};function ae(e){return`(min-width: ${e}px)`}const N={};function le(e=oe){if(!F)return S(()=>[]);if(typeof window.matchMedia!="function")return S(()=>[]);const t=C({}),r=Object.keys(e),n=(s,i)=>{s.matches?t.value[i]=!0:t.value[i]=!1};return r.forEach(s=>{const i=e[s];let a,l;N[i]===void 0?(a=window.matchMedia(ae(i)),a.addEventListener?a.addEventListener("change",d=>{l.forEach(f=>{f(d,s)})}):a.addListener&&a.addListener(d=>{l.forEach(f=>{f(d,s)})}),l=new Set,N[i]={mql:a,cbs:l}):(a=N[i].mql,l=N[i].cbs),l.add(n),a.matches&&l.forEach(d=>{d(a,s)})}),U(()=>{r.forEach(s=>{const{cbs:i}=N[e[s]];i.has(n)&&i.delete(n)})}),S(()=>{const{value:s}=t;return r.filter(i=>s[i])})}function fe(e){var t;const r=(t=e.dirs)===null||t===void 0?void 0:t.find(({dir:n})=>n===L);return!!(r&&r.value===!1)}const j=1,T=z("n-grid"),Q=1,X={span:{type:[Number,String],default:Q},offset:{type:[Number,String],default:0},suffix:Boolean,privateOffset:Number,privateSpan:Number,privateColStart:Number,privateShow:{type:Boolean,default:!0}},ve=Y(X),he=V({__GRID_ITEM__:!0,name:"GridItem",alias:["Gi"],props:X,setup(){const{isSsrRef:e,xGapRef:t,itemStyleRef:r,overflowRef:n,layoutShiftDisabledRef:s}=H(T),i=W();return{overflow:n,itemStyle:r,layoutShiftDisabled:s,mergedXGap:S(()=>x(t.value||0)),deriveStyle:()=>{e.value;const{privateSpan:a=Q,privateShow:l=!0,privateColStart:d=void 0,privateOffset:f=0}=i.vnode.props,{value:$}=t,b=x($||0);return{display:l?"":"none",gridColumn:`${d??`span ${a}`} / span ${a}`,marginLeft:f?`calc((100% - (${a} - 1) * ${b}) / ${a} * ${f} + ${b} * ${f})`:""}}}},render(){var e,t;if(this.layoutShiftDisabled){const{span:r,offset:n,mergedXGap:s}=this;return E("div",{style:{gridColumn:`span ${r} / span ${r}`,marginLeft:n?`calc((100% - (${r} - 1) * ${s}) / ${r} * ${n} + ${s} * ${n})`:""}},this.$slots)}return E("div",{style:[this.itemStyle,this.deriveStyle()]},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e,{overflow:this.overflow}))}}),ue={xs:0,s:640,m:1024,l:1280,xl:1536,xxl:1920},q=24,D="__ssr__",de={layoutShiftDisabled:Boolean,responsive:{type:[String,Boolean],default:"self"},cols:{type:[Number,String],default:q},itemResponsive:Boolean,collapsed:Boolean,collapsedRows:{type:Number,default:1},itemStyle:[Object,String],xGap:{type:[Number,String],default:0},yGap:{type:[Number,String],default:0}},me=V({name:"Grid",inheritAttrs:!1,props:de,setup(e){const{mergedClsPrefixRef:t,mergedBreakpointsRef:r}=J(e),n=/^\d+$/,s=C(void 0),i=le(r?.value||ue),a=B(()=>!!(e.itemResponsive||!n.test(e.cols.toString())||!n.test(e.xGap.toString())||!n.test(e.yGap.toString()))),l=S(()=>{if(a.value)return e.responsive==="self"?s.value:i.value}),d=B(()=>{var u;return(u=Number(_(e.cols.toString(),l.value)))!==null&&u!==void 0?u:q}),f=B(()=>_(e.xGap.toString(),l.value)),$=B(()=>_(e.yGap.toString(),l.value)),b=u=>{s.value=u.contentRect.width},v=u=>{se(b,u)},g=C(!1),y=S(()=>{if(e.responsive==="self")return v}),p=C(!1),h=C();return K(()=>{const{value:u}=h;u&&u.hasAttribute(D)&&(u.removeAttribute(D),p.value=!0)}),ne(T,{layoutShiftDisabledRef:P(e,"layoutShiftDisabled"),isSsrRef:p,itemStyleRef:P(e,"itemStyle"),xGapRef:f,overflowRef:g}),{isSsr:!ee,contentEl:h,mergedClsPrefix:t,style:S(()=>e.layoutShiftDisabled?{width:"100%",display:"grid",gridTemplateColumns:`repeat(${e.cols}, minmax(0, 1fr))`,columnGap:x(e.xGap),rowGap:x(e.yGap)}:{width:"100%",display:"grid",gridTemplateColumns:`repeat(${d.value}, minmax(0, 1fr))`,columnGap:x(f.value),rowGap:x($.value)}),isResponsive:a,responsiveQuery:l,responsiveCols:d,handleResize:y,overflow:g}},render(){if(this.layoutShiftDisabled)return E("div",A({ref:"contentEl",class:`${this.mergedClsPrefix}-grid`,style:this.style},this.$attrs),this.$slots);const e=()=>{var t,r,n,s,i,a,l;this.overflow=!1;const d=te(re(this)),f=[],{collapsed:$,collapsedRows:b,responsiveCols:v,responsiveQuery:g}=this;d.forEach(o=>{var G,m,c,R,M;if(((G=o?.type)===null||G===void 0?void 0:G.__GRID_ITEM__)!==!0)return;if(fe(o)){const w=O(o);w.props?w.props.privateShow=!1:w.props={privateShow:!1},f.push({child:w,rawChildSpan:0});return}o.dirs=((m=o.dirs)===null||m===void 0?void 0:m.filter(({dir:w})=>w!==L))||null,((c=o.dirs)===null||c===void 0?void 0:c.length)===0&&(o.dirs=null);const k=O(o),I=Number((M=_((R=k.props)===null||R===void 0?void 0:R.span,g))!==null&&M!==void 0?M:j);I!==0&&f.push({child:k,rawChildSpan:I})});let y=0;const p=(t=f[f.length-1])===null||t===void 0?void 0:t.child;if(p?.props){const o=(r=p.props)===null||r===void 0?void 0:r.suffix;o!==void 0&&o!==!1&&(y=Number((s=_((n=p.props)===null||n===void 0?void 0:n.span,g))!==null&&s!==void 0?s:j),p.props.privateSpan=y,p.props.privateColStart=v+1-y,p.props.privateShow=(i=p.props.privateShow)!==null&&i!==void 0?i:!0)}let h=0,u=!1;for(const{child:o,rawChildSpan:G}of f){if(u&&(this.overflow=!0),!u){const m=Number((l=_((a=o.props)===null||a===void 0?void 0:a.offset,g))!==null&&l!==void 0?l:0),c=Math.min(G+m,v);if(o.props?(o.props.privateSpan=c,o.props.privateOffset=m):o.props={privateSpan:c,privateOffset:m},$){const R=h%v;c+R>v&&(h+=v-R),c+h+y>b*v?u=!0:h+=c}}u&&(o.props?o.props.privateShow!==!0&&(o.props.privateShow=!1):o.props={privateShow:!1})}return E("div",A({ref:"contentEl",class:`${this.mergedClsPrefix}-grid`,style:this.style,[D]:this.isSsr||void 0},this.$attrs),f.map(({child:o})=>o))};return this.isResponsive&&this.responsive==="self"?E(Z,{onResize:this.handleResize},{default:e}):e()}});export{me as N,he as _,X as a,ve as g};
import{cx as G,bO as R,d as E,bH as j,E as w,cy as I,F as H,H as C,G as M,f as O,aY as P,bI as T,bJ as S}from"./index-DSCno0m2.js";import{g as A}from"./get-slot-Bk_rJcZu.js";function F(){return G}const L={self:F};let h;function N(){if(!R)return!0;if(h===void 0){const e=document.createElement("div");e.style.display="flex",e.style.flexDirection="column",e.style.rowGap="1px",e.appendChild(document.createElement("div")),e.appendChild(document.createElement("div")),document.body.appendChild(e);const n=e.scrollHeight===1;return document.body.removeChild(e),h=n}return h}const W=Object.assign(Object.assign({},C.props),{align:String,justify:{type:String,default:"start"},inline:Boolean,vertical:Boolean,reverse:Boolean,size:{type:[String,Number,Array],default:"medium"},wrapItem:{type:Boolean,default:!0},itemClass:String,itemStyle:[String,Object],wrap:{type:Boolean,default:!0},internalUseGap:{type:Boolean,default:void 0}}),U=E({name:"Space",props:W,setup(e){const{mergedClsPrefixRef:n,mergedRtlRef:u}=H(e),d=C("Space","-space",void 0,L,e,n),t=M("Space",u,n);return{useGap:N(),rtlEnabled:t,mergedClsPrefix:n,margin:O(()=>{const{size:r}=e;if(Array.isArray(r))return{horizontal:r[0],vertical:r[1]};if(typeof r=="number")return{horizontal:r,vertical:r};const{self:{[P("gap",r)]:f}}=d.value,{row:a,col:g}=T(f);return{horizontal:S(g),vertical:S(a)}})}},render(){const{vertical:e,reverse:n,align:u,inline:d,justify:t,itemClass:r,itemStyle:f,margin:a,wrap:g,mergedClsPrefix:v,rtlEnabled:x,useGap:o,wrapItem:B,internalUseGap:$}=this,p=j(A(this),!1);if(!p.length)return null;const b=`${a.horizontal}px`,c=`${a.horizontal/2}px`,z=`${a.vertical}px`,i=`${a.vertical/2}px`,l=p.length-1,m=t.startsWith("space-");return w("div",{role:"none",class:[`${v}-space`,x&&`${v}-space--rtl`],style:{display:d?"inline-flex":"flex",flexDirection:e&&!n?"column":e&&n?"column-reverse":!e&&n?"row-reverse":"row",justifyContent:["start","end"].includes(t)?`flex-${t}`:t,flexWrap:!g||e?"nowrap":"wrap",marginTop:o||e?"":`-${i}`,marginBottom:o||e?"":`-${i}`,alignItems:u,gap:o?`${a.vertical}px ${a.horizontal}px`:""}},!B&&(o||$)?p:p.map((y,s)=>y.type===I?y:w("div",{role:"none",class:r,style:[f,{maxWidth:"100%"},o?"":e?{marginBottom:s!==l?z:""}:x?{marginLeft:m?t==="space-between"&&s===l?"":c:s!==l?b:"",marginRight:m?t==="space-between"&&s===0?"":c:"",paddingTop:i,paddingBottom:i}:{marginRight:m?t==="space-between"&&s===l?"":c:s!==l?b:"",marginLeft:m?t==="space-between"&&s===0?"":c:"",paddingTop:i,paddingBottom:i}]},y)))}});export{U as N};
const e={};throw new Error('Could not resolve "katex" imported by "markstream-vue".');export{e as default};
const e={};throw new Error('Could not resolve "mermaid" imported by "markstream-vue".');export{e as default};
const e={};throw new Error('Could not resolve "stream-markdown" imported by "markstream-vue".');export{e as default};
const e={};throw new Error('Could not resolve "stream-monaco" imported by "markstream-vue".');export{e as default};
import{d as a,a as s,o as r,b as o}from"./index-DSCno0m2.js";const t={class:"h-full"},c=["src"],m=a({name:"iframe-page",__name:"[url]",props:{url:{}},setup(e){return(l,n)=>(r(),s("div",t,[o("iframe",{id:"iframePage",class:"size-full",src:e.url},null,8,c)]))}});export{m as default};
This source diff could not be displayed because it is too large. You can view the blob instead.
import{bK as t}from"./index-DSCno0m2.js";function r(){return t({url:"/api/admin/agents",method:"get"})}function d(e){return t({url:"/api/admin/agents",method:"post",data:e})}function u(e,n){return t({url:`/api/admin/agents/${e}`,method:"put",data:n})}function s(e){return t({url:`/api/admin/agents/${e}`,method:"delete"})}function g(e){return t({url:`/api/admin/agents/${e}/toggle`,method:"patch"})}function o(e){return t({url:`/api/admin/agents/${e}/fields`,method:"get"})}function f(e,n){return t({url:`/api/admin/agents/${e}/fields`,method:"post",data:n})}function l(e,n,a){return t({url:`/api/admin/agents/${e}/fields/${n}`,method:"put",data:a})}function c(e,n){return t({url:`/api/admin/agents/${e}/fields/${n}`,method:"delete"})}export{r as a,u as b,d as c,g as d,s as e,o as f,l as g,f as h,c as i};
import{bK as a}from"./index-DSCno0m2.js";function h(){return a({url:"/api/admin/chatbots",method:"get"})}function n(t){return a({url:`/api/admin/chatbots/${t}`,method:"get"})}function r(){return a({url:"/api/admin/chatbots/tools",method:"get"})}function i(t){return a({url:"/api/admin/chatbots",method:"post",data:t})}function c(t,e){return a({url:`/api/admin/chatbots/${t}`,method:"put",data:e})}function u(t){return a({url:`/api/admin/chatbots/${t}`,method:"delete"})}function s(t){return a({url:`/api/admin/chatbots/${t}/toggle`,method:"patch"})}export{n as a,c as b,i as c,s as d,u as e,h as f,r as g};
const r={};throw new Error('Could not resolve "@terrastruct/d2" imported by "markstream-vue".');export{r as default};
import{d as l,u as m,a as u,o as _,b as d,e as o,f as x,_ as f,w as y,g as B,t as h,h as t,$ as v,B as g}from"./index-DSCno0m2.js";const k={class:"size-full min-h-520px flex-col-center gap-24px overflow-hidden"},N={class:"flex text-400px text-primary"},C=l({name:"ExceptionBase",__name:"exception-base",props:{type:{}},setup(n){const s=n,{routerPushByKey:a}=m(),c={403:"no-permission",404:"not-found",500:"service-error"},r=x(()=>c[s.type]);return($,e)=>{const i=f,p=g;return _(),u("div",k,[d("div",N,[o(i,{"local-icon":r.value},null,8,["local-icon"])]),o(p,{type:"primary",onClick:e[0]||(e[0]=b=>t(a)("root"))},{default:y(()=>[B(h(t(v)("common.backToHome")),1)]),_:1})])}}});export{C as _};
function l(s,o="default",n=[]){const t=s.$slots[o];return t===void 0?n:t()}export{l as g};
.ai-model-provider-management[data-v-efe36f4b]{padding:16px;height:100%;overflow:auto}.ai-model-provider-management[data-v-efe36f4b] .row-selected td{background:#18a05814}.header-editor[data-v-efe36f4b]{width:100%}.header-row[data-v-efe36f4b]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:8px;margin-bottom:8px}.ai-model-config-management[data-v-07ac88bf],.ai-model-management[data-v-9ca9a0d9]{padding:16px;height:100%;overflow:auto}.default-model-card[data-v-9ca9a0d9]{margin-bottom:16px}.default-model-summary-panel[data-v-9ca9a0d9]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.default-model-summary-item[data-v-9ca9a0d9]{padding:12px 14px;border:1px solid var(--n-border-color);border-radius:10px;background:var(--n-color-embedded)}.default-model-summary-label[data-v-9ca9a0d9]{font-size:14px;color:var(--n-text-color-2);margin-bottom:6px}.default-model-summary-value[data-v-9ca9a0d9]{font-size:14px;color:var(--n-text-color);line-height:1.5;word-break:break-word}.default-model-summary-value--muted[data-v-9ca9a0d9]{color:var(--n-text-color-3)}.default-model-modal[data-v-9ca9a0d9]{width:min(640px,100vw - 32px)}.columns[data-v-9ca9a0d9]{display:grid;grid-template-columns:minmax(360px,1fr) minmax(360px,1.2fr);gap:16px;align-items:start}.ai-model-management[data-v-9ca9a0d9] .ai-model-provider-management,.ai-model-management[data-v-9ca9a0d9] .ai-model-config-management{padding:0;height:auto}@media(max-width:1080px){.default-model-summary-panel[data-v-9ca9a0d9],.columns[data-v-9ca9a0d9]{grid-template-columns:1fr}}
This diff is collapsed.
This diff is collapsed.
import{_ as o}from"./exception-base.vue_vue_type_script_setup_true_lang-CTNn5GuR.js";import{d as n,c as t,o as a}from"./index-DSCno0m2.js";const m=n({name:"500",__name:"index",setup(c){return(_,s)=>{const e=o;return a(),t(e,{type:"500"})}}});export{m as default};
.agent-management[data-v-0e3c4321]{padding:16px;height:100%;overflow:auto}.columns[data-v-0e3c4321]{display:grid;grid-template-columns:minmax(420px,1.15fr) minmax(360px,1fr);gap:16px;align-items:start}.panel-card[data-v-0e3c4321]{min-height:100%}.selected-agent-meta[data-v-0e3c4321]{padding:12px;border-radius:8px;background:#18a05814;color:var(--n-text-color);line-height:1.8}.agent-management[data-v-0e3c4321] .agent-row--selected td{background:#18a0581f}@media(max-width:1080px){.columns[data-v-0e3c4321]{grid-template-columns:1fr}}
import{N as B,_ as R}from"./add-BQ5j9vop.js";import{_ as S,f as V,a as F,b as L,c as j}from"./search-CYpszvI_.js";import{d as O,S as Q,W,a as Y,o as Z,e as l,w as n,h as o,U as i,f as b,Y as N,V as P,B as d,g as f,N as G,Z as H,a0 as J,E as p,Q as K,R as X}from"./index-DSCno0m2.js";import{N as h}from"./Space-Dex4J4Il.js";import{N as ee,a as C}from"./FormItem-CHgZe7qM.js";import"./get-slot-Bk_rJcZu.js";const ae={class:"permission-management"},te=O({name:"system_permission",__name:"index",setup(le){const m=Q(),v=P({keyword:""}),y=i(!1),g=i(!1),r=i(!1),u=i(!1),_=i(null),w=i([]),U=b(()=>u.value?"编辑权限":"新增权限"),I=b(()=>{const e=v.keyword.trim().toLowerCase();return e?w.value.filter(a=>`${a.code} ${a.name}`.toLowerCase().includes(e)):w.value}),E=[{label:"接口权限(API)",value:"API"},{label:"菜单权限(MENU)",value:"MENU"}],t=P({id:null,code:"",name:"",type:"API"}),D={code:[{required:!0,message:"请输入权限编码",trigger:"blur"}],name:[{required:!0,message:"请输入权限名称",trigger:"blur"}],type:[{required:!0,message:"请选择权限类型",trigger:"change"}]},M=b(()=>[{title:"ID",key:"id",width:90},{title:"权限编码",key:"code",width:240},{title:"权限名称",key:"name",width:220},{title:"权限类型",key:"type",width:120,render:e=>p(K,{size:"small",bordered:!1,type:e.type==="MENU"?"warning":"info"},{default:()=>e.type})},{title:"操作",key:"actions",width:180,render:e=>p(h,{size:8},{default:()=>[p(d,{size:"small",onClick:()=>z(e)},{default:()=>"编辑"}),p(d,{size:"small",type:"error",onClick:()=>$(e)},{default:()=>"删除"})]})}]);async function c(){y.value=!0;try{const e=await V();w.value=e.data||[]}catch(e){m.error("加载权限失败"),console.error(e)}finally{y.value=!1}}function x(){t.id=null,t.code="",t.name="",t.type="API"}function T(){x(),u.value=!1,r.value=!0}function z(e){x(),u.value=!0,t.id=e.id,t.code=e.code,t.name=e.name,t.type=e.type,r.value=!0}async function A(){if(_.value)try{await _.value.validate(),g.value=!0;const e={code:t.code.trim(),name:t.name.trim(),type:t.type};u.value&&t.id?await F(t.id,e):await L(e),m.success(u.value?"权限已更新":"权限已创建"),r.value=!1,await c()}catch(e){console.error(e)}finally{g.value=!1}}async function $(e){const a=window.$dialog;a&&a.warning({title:"删除确认",content:`确定删除权限“${e.name}”吗?`,positiveText:"删除",negativeText:"取消",async onPositiveClick(){try{await j(e.id),m.success("权限已删除"),await c()}catch(k){m.error("删除权限失败"),console.error(k)}}})}return W(()=>{c()}),(e,a)=>{const k=S,q=R;return Z(),Y("div",ae,[l(o(G),{title:"权限管理",bordered:!1,size:"small"},{"header-extra":n(()=>[l(o(h),null,{default:n(()=>[l(o(N),{value:v.keyword,"onUpdate:value":a[0]||(a[0]=s=>v.keyword=s),placeholder:"搜索权限编码或名称",clearable:"",style:{width:"240px"}},null,8,["value"]),l(o(d),{onClick:c},{icon:n(()=>[l(k)]),default:n(()=>[a[6]||(a[6]=f(" 搜索 ",-1))]),_:1}),l(o(d),{type:"primary",onClick:T},{icon:n(()=>[l(q)]),default:n(()=>[a[7]||(a[7]=f(" 新增权限 ",-1))]),_:1})]),_:1})]),default:n(()=>[l(o(B),{columns:M.value,data:I.value,loading:y.value,pagination:!1},null,8,["columns","data","loading"])]),_:1}),l(o(J),{show:r.value,"onUpdate:show":a[5]||(a[5]=s=>r.value=s),preset:"card",title:U.value,style:{width:"520px"}},{footer:n(()=>[l(o(h),{justify:"end"},{default:n(()=>[l(o(d),{onClick:a[4]||(a[4]=s=>r.value=!1)},{default:n(()=>[...a[8]||(a[8]=[f("取消",-1)])]),_:1}),l(o(d),{type:"primary",loading:g.value,onClick:A},{default:n(()=>[...a[9]||(a[9]=[f("保存",-1)])]),_:1},8,["loading"])]),_:1})]),default:n(()=>[l(o(ee),{ref_key:"formRef",ref:_,model:t,rules:D,"label-placement":"left","label-width":90},{default:n(()=>[l(o(C),{label:"权限编码",path:"code"},{default:n(()=>[l(o(N),{value:t.code,"onUpdate:value":a[1]||(a[1]=s=>t.code=s),placeholder:"例如 sys:user:read"},null,8,["value"])]),_:1}),l(o(C),{label:"权限名称",path:"name"},{default:n(()=>[l(o(N),{value:t.name,"onUpdate:value":a[2]||(a[2]=s=>t.name=s),placeholder:"请输入权限名称"},null,8,["value"])]),_:1}),l(o(C),{label:"权限类型",path:"type"},{default:n(()=>[l(o(H),{value:t.type,"onUpdate:value":a[3]||(a[3]=s=>t.type=s),options:E,placeholder:"请选择类型"},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1},8,["show","title"])])}}}),ue=X(te,[["__scopeId","data-v-30999ee4"]]);export{ue as default};
This diff is collapsed.
.permission-management[data-v-30999ee4]{padding:16px;height:100%;overflow:auto}
.role-management[data-v-d8259721]{padding:16px;height:100%;overflow:auto}
import{d as f,a as d,o as r,b as t,f as m,i as h,j as k,k as B,l as $,m as N,e as i,w as _,n as z,t as L,h as l,$ as T,c as G,p as M,q as V,r as q,B as E,g as O,N as W,s as j,v as A}from"./index-DSCno0m2.js";const R={class:"absolute-lt z-1 size-full overflow-hidden"},Z={class:"absolute -right-300px -top-900px lt-sm:-right-100px lt-sm:-top-1170px"},D={height:"1337",width:"1337"},H={id:"linearGradient-2",x1:"0.79",y1:"0.62",x2:"0.21",y2:"0.86"},I=["stop-color"],P=["stop-color"],F={class:"absolute -bottom-400px -left-200px lt-sm:-bottom-760px lt-sm:-left-100px"},J={height:"896",width:"967.8852157128662"},K={id:"linearGradient-3",x1:"0.5",y1:"0",x2:"0.5",y2:"1"},Q=["stop-color"],U=["stop-color"],X=f({name:"WaveBg",__name:"wave-bg",props:{themeColor:{}},setup(u){const a=u,n=m(()=>h(a.themeColor,200)),p=m(()=>h(a.themeColor,500));return(o,e)=>(r(),d("div",R,[t("div",Z,[(r(),d("svg",D,[t("defs",null,[e[0]||(e[0]=t("path",{id:"path-1",opacity:"1","fill-rule":"evenodd",d:"M1337,668.5 C1337,1037.455193874239 1037.455193874239,1337 668.5,1337 C523.6725684305388,1337 337,1236 370.50000000000006,1094 C434.03835568300906,824.6732385973953 6.906089672974592e-14,892.6277623047779 0,668.5000000000001 C0,299.5448061257611 299.5448061257609,1.1368683772161603e-13 668.4999999999999,0 C1037.455193874239,0 1337,299.544806125761 1337,668.5Z"},null,-1)),t("linearGradient",H,[t("stop",{offset:"0","stop-color":n.value,"stop-opacity":"1"},null,8,I),t("stop",{offset:"1","stop-color":p.value,"stop-opacity":"1"},null,8,P)])]),e[1]||(e[1]=t("g",{opacity:"1"},[t("use",{"xlink:href":"#path-1",fill:"url(#linearGradient-2)","fill-opacity":"1"})],-1))]))]),t("div",F,[(r(),d("svg",J,[t("defs",null,[e[2]||(e[2]=t("path",{id:"path-2",opacity:"1","fill-rule":"evenodd",d:"M896,448 C1142.6325445712241,465.5747656464056 695.2579309733121,896 448,896 C200.74206902668806,896 5.684341886080802e-14,695.2579309733121 0,448.0000000000001 C0,200.74206902668806 200.74206902668791,5.684341886080802e-14 447.99999999999994,0 C695.2579309733121,0 475,418 896,448Z"},null,-1)),t("linearGradient",K,[t("stop",{offset:"0","stop-color":p.value,"stop-opacity":"1"},null,8,Q),t("stop",{offset:"1","stop-color":n.value,"stop-opacity":"1"},null,8,U)])]),e[3]||(e[3]=t("g",{opacity:"1"},[t("use",{"xlink:href":"#path-2",fill:"url(#linearGradient-3)","fill-opacity":"1"})],-1))]))])]))}}),Y={class:"flex-y-center justify-between"},tt={class:"text-28px text-primary font-500 lt-sm:text-22px"},et={class:"i-flex-col"},ot={class:"pt-28px"},st={class:"flex-col gap-16px"},nt=f({name:"login",__name:"index",setup(u){const a=k(),n=B(),p=$(),o=N(),e=m(()=>o.darkMode?h(o.themeColor,600):o.themeColor),x=m(()=>{const c="#ffffff",s=o.darkMode?.5:.2;return A(c,o.themeColor,s)});function g(){const c=typeof a.query.redirect=="string"?a.query.redirect:"/";p.redirectToExternalSso(c)}return(c,s)=>{const C=X,y=z,v=V,S=q,w=E,b=W;return r(),d("div",{class:"relative size-full flex-center overflow-hidden",style:j({backgroundColor:x.value})},[i(C,{"theme-color":e.value},null,8,["theme-color"]),i(b,{bordered:!1,class:"relative z-4 w-420px rd-8px lt-sm:w-320px"},{default:_(()=>[t("header",Y,[i(y,{class:"size-64px lt-sm:size-48px"}),t("h3",tt,L(l(T)("system.title")),1),t("div",et,[i(v,{"theme-schema":l(o).themeScheme,"show-tooltip":!1,class:"text-20px lt-sm:text-18px",onSwitch:l(o).toggleThemeScheme},null,8,["theme-schema","onSwitch"]),l(o).header.multilingual.visible?(r(),G(S,{key:0,lang:l(n).locale,"lang-options":l(n).localeOptions,"show-tooltip":!1,onChangeLang:l(n).changeLocale},null,8,["lang","lang-options","onChangeLang"])):M("",!0)])]),t("main",ot,[t("div",st,[s[1]||(s[1]=t("h3",{class:"text-20px text-primary font-medium"},"未登录或登录已过期",-1)),s[2]||(s[2]=t("p",{class:"text-14px text-#666 leading-24px dark:text-#aaa"}," 请回到原系统重新单点登录,完成后将自动返回当前系统。 ",-1)),i(w,{type:"primary",size:"large",block:"",onClick:g},{default:_(()=>[...s[0]||(s[0]=[O("返回原系统单点登录",-1)])]),_:1})])])]),_:1})],4)}}});export{nt as default};
.banner[data-v-bb512bff]{padding:8px 4px}
import{N as Z,_ as ee}from"./add-BQ5j9vop.js";import{_ as ae,f as te}from"./search-CYpszvI_.js";import{bK as k,d as le,S as oe,W as ne,a as M,o as D,e as t,w as l,h as o,U as r,f as h,Y as I,V as T,B as d,g as f,N as se,a0 as S,t as P,c5 as re,a4 as ie,a5 as ue,c as de,a2 as fe,E as m,Q as me,R as ce}from"./index-DSCno0m2.js";import{N as c}from"./Space-Dex4J4Il.js";import{N as pe,a as L}from"./FormItem-CHgZe7qM.js";import{N as ve}from"./Alert-Cm6VlYYh.js";import"./get-slot-Bk_rJcZu.js";function ye(u){return k({url:"/api/roles",method:"get",params:u})}function ge(u){return k({url:"/api/roles",method:"post",data:u})}function we(u,i){return k({url:`/api/roles/${u}`,method:"put",data:i})}function he(u){return k({url:`/api/roles/${u}`,method:"delete"})}function ke(u,i){return k({url:`/api/roles/${u}/permissions`,method:"put",data:{permissionIds:i}})}const _e={class:"role-management"},Ce=le({name:"system_role",__name:"index",setup(u){const i=oe(),C=T({keyword:""}),b=r(!1),N=r(!1),x=r(!1),p=r(!1),v=r(!1),y=r(!1),R=r(null),$=r([]),_=r([]),g=r([]),z=r(null),U=r(""),V=h(()=>y.value?"编辑角色":"新增角色"),q=h(()=>{const a=C.keyword.trim().toLowerCase();return a?$.value.filter(e=>`${e.code} ${e.name}`.toLowerCase().includes(a)):$.value}),A=h(()=>{const a=new Map;return _.value.forEach(e=>{a.set(e.code,e.id)}),a}),F=h(()=>{const a=new Map;return _.value.forEach(e=>{a.set(e.code,e.name)}),a}),s=T({id:null,code:"",name:""}),j={code:[{required:!0,message:"请输入角色编码",trigger:"blur"}],name:[{required:!0,message:"请输入角色名称",trigger:"blur"}]},W=h(()=>[{title:"ID",key:"id",width:90},{title:"角色编码",key:"code",width:180},{title:"角色名称",key:"name",width:180},{title:"权限",key:"permissionCodes",minWidth:280,render:a=>a.permissionCodes?.length?m(c,{size:6,wrap:!0},{default:()=>a.permissionCodes.map(e=>m(me,{size:"small",bordered:!1,type:"info"},{default:()=>F.value.get(e)||e}))}):m("span",{class:"text-gray-400"},"未分配")},{title:"操作",key:"actions",width:220,render:a=>m(c,{size:8},{default:()=>[m(d,{size:"small",onClick:()=>Y(a)},{default:()=>"权限配置"}),m(d,{size:"small",onClick:()=>O(a)},{default:()=>"编辑"}),m(d,{size:"small",type:"error",onClick:()=>J(a)},{default:()=>"删除"})]})}]);async function G(){const a=await te();_.value=a.data||[]}async function w(){b.value=!0;try{const a=await ye();$.value=a.data||[]}catch(a){i.error("加载角色失败"),console.error(a)}finally{b.value=!1}}function E(){s.id=null,s.code="",s.name=""}function K(){E(),y.value=!1,p.value=!0}function O(a){E(),y.value=!0,s.id=a.id,s.code=a.code,s.name=a.name,p.value=!0}async function Q(){if(R.value)try{await R.value.validate(),N.value=!0,y.value&&s.id?await we(s.id,{code:s.code.trim(),name:s.name.trim()}):await ge({code:s.code.trim(),name:s.name.trim()}),i.success(y.value?"角色已更新":"角色已创建"),p.value=!1,await w()}catch(a){console.error(a)}finally{N.value=!1}}function Y(a){z.value=a.id,U.value=`${a.name} (${a.code})`,g.value=(a.permissionCodes||[]).map(e=>A.value.get(e)).filter(e=>!!e),v.value=!0}async function H(){if(z.value){if(g.value.length===0){i.warning("当前后端要求至少保留一个权限");return}x.value=!0;try{await ke(z.value,g.value),i.success("角色权限已更新"),v.value=!1,await w()}catch(a){i.error("更新角色权限失败"),console.error(a)}finally{x.value=!1}}}async function J(a){const e=window.$dialog;e&&e.warning({title:"删除确认",content:`确定删除角色“${a.name}”吗?`,positiveText:"删除",negativeText:"取消",async onPositiveClick(){try{await he(a.id),i.success("角色已删除"),await w()}catch(B){i.error("删除角色失败"),console.error(B)}}})}return ne(async()=>{await Promise.all([G(),w()])}),(a,e)=>{const B=ae,X=ee;return D(),M("div",_e,[t(o(se),{title:"角色管理",bordered:!1,size:"small"},{"header-extra":l(()=>[t(o(c),null,{default:l(()=>[t(o(I),{value:C.keyword,"onUpdate:value":e[0]||(e[0]=n=>C.keyword=n),placeholder:"搜索角色编码或名称",clearable:"",style:{width:"240px"}},null,8,["value"]),t(o(d),{onClick:w},{icon:l(()=>[t(B)]),default:l(()=>[e[8]||(e[8]=f(" 搜索 ",-1))]),_:1}),t(o(d),{type:"primary",onClick:K},{icon:l(()=>[t(X)]),default:l(()=>[e[9]||(e[9]=f(" 新增角色 ",-1))]),_:1})]),_:1})]),default:l(()=>[t(o(Z),{columns:W.value,data:q.value,loading:b.value,pagination:!1},null,8,["columns","data","loading"])]),_:1}),t(o(S),{show:p.value,"onUpdate:show":e[4]||(e[4]=n=>p.value=n),preset:"card",title:V.value,style:{width:"520px"}},{footer:l(()=>[t(o(c),{justify:"end"},{default:l(()=>[t(o(d),{onClick:e[3]||(e[3]=n=>p.value=!1)},{default:l(()=>[...e[10]||(e[10]=[f("取消",-1)])]),_:1}),t(o(d),{type:"primary",loading:N.value,onClick:Q},{default:l(()=>[...e[11]||(e[11]=[f("保存",-1)])]),_:1},8,["loading"])]),_:1})]),default:l(()=>[t(o(pe),{ref_key:"formRef",ref:R,model:s,rules:j,"label-placement":"left","label-width":90},{default:l(()=>[t(o(L),{label:"角色编码",path:"code"},{default:l(()=>[t(o(I),{value:s.code,"onUpdate:value":e[1]||(e[1]=n=>s.code=n),placeholder:"例如 ROLE_ADMIN"},null,8,["value"])]),_:1}),t(o(L),{label:"角色名称",path:"name"},{default:l(()=>[t(o(I),{value:s.name,"onUpdate:value":e[2]||(e[2]=n=>s.name=n),placeholder:"请输入角色名称"},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1},8,["show","title"]),t(o(S),{show:v.value,"onUpdate:show":e[7]||(e[7]=n=>v.value=n),preset:"card",title:"配置角色权限",style:{width:"720px"}},{footer:l(()=>[t(o(c),{justify:"end"},{default:l(()=>[t(o(d),{onClick:e[6]||(e[6]=n=>v.value=!1)},{default:l(()=>[...e[12]||(e[12]=[f("取消",-1)])]),_:1}),t(o(d),{type:"primary",loading:x.value,onClick:H},{default:l(()=>[...e[13]||(e[13]=[f("保存",-1)])]),_:1},8,["loading"])]),_:1})]),default:l(()=>[t(o(c),{vertical:"",size:16},{default:l(()=>[t(o(ve),{type:"info","show-icon":!1},{default:l(()=>[f("当前角色:"+P(U.value),1)]),_:1}),t(o(re),{value:g.value,"onUpdate:value":e[5]||(e[5]=n=>g.value=n)},{default:l(()=>[t(o(c),{vertical:"",size:8},{default:l(()=>[(D(!0),M(ie,null,ue(_.value,n=>(D(),de(o(fe),{key:n.id,value:n.id},{default:l(()=>[f(P(n.name)+"("+P(n.code)+") ",1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["value"])]),_:1})]),_:1},8,["show"])])}}}),De=ce(Ce,[["__scopeId","data-v-d8259721"]]);export{De as default};
This diff is collapsed.
.selected-mix-menu[data-v-584d328b]{background-color:var(--e3ed5c1e)}
import{_ as o}from"./exception-base.vue_vue_type_script_setup_true_lang-CTNn5GuR.js";import{d as n,c as t,o as a}from"./index-DSCno0m2.js";const m=n({name:"403",__name:"index",setup(c){return(_,s)=>{const e=o;return a(),t(e,{type:"403"})}}});export{m as default};
import{_ as o}from"./exception-base.vue_vue_type_script_setup_true_lang-CTNn5GuR.js";import{d as n,c as t,o as a}from"./index-DSCno0m2.js";const m=n({name:"404",__name:"index",setup(c){return(_,s)=>{const e=o;return a(),t(e,{type:"404"})}}});export{m as default};
import{N as ce,_ as me}from"./add-BQ5j9vop.js";import{_ as pe,N as T,f as fe,a as ve}from"./renew-BKDjLGO9.js";import{a as ge}from"./assistant-Vu8dw-ko.js";import{a as be,b as ye,c as we,d as he,e as _e,g as Te,f as xe}from"./chatbot-Dfd2mpvB.js";import{d as Ce,S as Ne,W as Ie,a as L,o as B,e as n,w as l,h as o,U as d,f as u,B as g,g as x,N as ke,p as Se,V as ze,Y as z,Z as A,a1 as Ae,t as We,a0 as Ee,E as C,a3 as Pe,R as Me}from"./index-DSCno0m2.js";import{N as W}from"./Space-Dex4J4Il.js";import{N as Ue,a as E}from"./FormItem-CHgZe7qM.js";import{N as K}from"./Grid-DJ-rVKld.js";import"./get-slot-Bk_rJcZu.js";const $e={class:"chatbot-management"},Oe={key:0,class:"chatbot-management__warning"},Re=Ce({name:"system_chatbot",__name:"index",setup(De){const i=Ne(),y=d(!1),m=d(!1),N=d(!1),p=d(!1),b=d(!1),I=d(null),P=d([]),k=d([]),M=d([]),w=d([]),V=u(()=>k.value.map(e=>({label:e.label,value:e.id}))),j=u(()=>M.value.map(e=>({label:e.name,value:e.id}))),q=u(()=>{const e=new Map;return k.value.forEach(t=>{e.set(t.id,t.label)}),e}),G=u(()=>{const e=new Map;return w.value.forEach(t=>{e.set(t.key,t.name)}),e}),Y=u(()=>b.value?"编辑聊天机器人":"新增聊天机器人"),a=ze({id:null,name:"",description:"",systemPrompt:"",modelConfigId:null,enabledTools:[],contextWindowSize:20,subAgentIds:[]}),Z=u(()=>w.value.map(e=>({label:e.name,value:e.key}))),S=u(()=>new Set(w.value.map(e=>e.key))),h=u(()=>a.enabledTools.filter(e=>!S.value.has(e))),H=u(()=>{const e=h.value.map(t=>({label:`${t}(已下线)`,value:t,disabled:!0}));return[...Z.value,...e]}),J=u(()=>a.enabledTools.filter(e=>S.value.has(e))),Q={name:[{required:!0,validator:(e,t)=>t?.trim()?t.trim().length>100?new Error("聊天机器人名称不能超过 100 个字符"):!0:new Error("请输入聊天机器人名称"),trigger:["input","blur"]}],description:[{validator:(e,t)=>t&&t.trim().length>500?new Error("描述不能超过 500 个字符"):!0,trigger:["input","blur"]}],enabledTools:[{type:"array",validator:(e,t)=>Array.isArray(t)?!0:new Error("工具配置不合法"),trigger:"change"}],contextWindowSize:[{required:!0,validator:(e,t)=>t==null||Number.isNaN(t)?new Error("请输入上下文窗口大小"):t<0?new Error("上下文窗口大小不能为负数"):!0,trigger:["input","blur","change"]}],subAgentIds:[{type:"array",validator:(e,t)=>Array.isArray(t)?!0:new Error("子智能体配置不合法"),trigger:"change"}]},X=u(()=>[{title:"名称",key:"name",minWidth:160},{title:"描述",key:"description",minWidth:220,ellipsis:{tooltip:!0},render:e=>e.description||"-"},{title:"模型",key:"modelConfigId",minWidth:220,render:e=>te(e.modelConfigId)},{title:"工具",key:"enabledTools",minWidth:150,render:e=>ae(e.enabledTools)},{title:"子智能体数量",key:"subAgents",width:120,render:e=>e.subAgents.length},{title:"上下文窗口",key:"contextWindowSize",width:110,render:e=>e.contextWindowSize===0?"不限制":e.contextWindowSize},{title:"启用状态",key:"enabled",width:100,render:e=>C(Pe,{value:e.enabled,onUpdateValue:()=>ue(e)})},{title:"操作",key:"actions",width:160,render:e=>C(W,{size:8},{default:()=>[C(g,{size:"small",onClick:()=>se(e)},{default:()=>"编辑"}),C(g,{size:"small",type:"error",onClick:()=>de(e)},{default:()=>"删除"})]})}]);function U(){a.id=null,a.name="",a.description="",a.systemPrompt="",a.modelConfigId=null,a.enabledTools=[],a.contextWindowSize=20,a.subAgentIds=[]}function $(e){return e.trim()||null}function ee(e=!1){return{name:a.name.trim(),description:$(a.description),systemPrompt:$(a.systemPrompt),modelConfigId:a.modelConfigId,enabledTools:e?[...J.value]:[...a.enabledTools],contextWindowSize:a.contextWindowSize,subAgentIds:[...a.subAgentIds]}}function f(e,t){const r=e;return r.response?.data?.message||r.message||t}function te(e){return e==null?"默认模型":q.value.get(e)||`模型 #${e}`}function ae(e){return e.length?e.map(t=>G.value.get(t)||t).join("、"):"-"}async function O(){const e=await Te();w.value=e.data||[]}function R(e){i.error(f(e,b.value?"保存聊天机器人失败":"创建聊天机器人失败"))}async function ne(){const e=[...h.value];if(!e.length)return[];try{await O()}catch(t){return i.warning(f(t,"刷新工具列表失败,将按当前识别结果提示清理已下线工具")),e}return a.enabledTools.filter(t=>!S.value.has(t))}async function oe(){const t=((await fe()).data||[]).filter(c=>c.active),r=await Promise.all(t.map(async c=>((await ve(c.id)).data||[]).filter(v=>v.active&&v.modelType==="LLM").map(v=>({id:v.id,label:`${c.name} / ${v.displayName||v.modelName}`}))));k.value=r.flat()}async function le(){const e=await ge();M.value=(e.data||[]).filter(t=>t.enabled)}async function _(){const e=await xe();P.value=e.data||[]}async function D(){y.value=!0,m.value=!0;try{await Promise.all([_(),oe(),le(),O()])}catch(e){i.error(f(e,"加载聊天机器人管理数据失败"))}finally{y.value=!1,m.value=!1}}function re(){U(),b.value=!1,p.value=!0}async function se(e){b.value=!0,U();try{m.value=!0;const r=(await be(e.id)).data;if(!r){i.error("加载聊天机器人详情失败");return}a.id=r.id,a.name=r.name,a.description=r.description||"",a.systemPrompt=r.systemPrompt||"",a.modelConfigId=r.modelConfigId??null,a.enabledTools=[...r.enabledTools],a.contextWindowSize=r.contextWindowSize,a.subAgentIds=r.subAgents.map(c=>c.id),p.value=!0}catch(t){i.error(f(t,"加载聊天机器人详情失败"))}finally{m.value=!1}}async function ie(){if(I.value)try{await I.value.validate();const e=await ne();if(e.length){const t=window.$dialog;if(!t){i.warning(`当前配置包含已下线工具,保存前请确认是否移除:${e.join("、")}`);return}t.warning({title:"工具清理提醒",content:`当前配置包含已下线工具,保存后将移除:${e.join("、")}`,positiveText:"继续保存",negativeText:"取消",async onPositiveClick(){try{return await F(!0),!0}catch(r){return R(r),!1}}});return}await F()}catch(e){R(e)}}async function F(e=!1){N.value=!0;try{const t=ee(e);b.value&&a.id?(await ye(a.id,t),i.success("聊天机器人已更新")):(await we(t),i.success("聊天机器人已创建")),p.value=!1,await _()}finally{N.value=!1}}async function ue(e){try{await he(e.id),i.success(e.enabled?"聊天机器人已停用":"聊天机器人已启用"),await _()}catch(t){i.error(f(t,"切换聊天机器人状态失败"))}}async function de(e){const t=window.$dialog;t&&t.warning({title:"删除确认",content:`确定删除聊天机器人“${e.name}”吗?`,positiveText:"删除",negativeText:"取消",async onPositiveClick(){try{await _e(e.id),i.success("聊天机器人已删除"),await _()}catch(r){i.error(f(r,"删除聊天机器人失败"))}}})}return Ie(()=>{D()}),(e,t)=>{const r=pe,c=me;return B(),L("div",$e,[n(o(ke),{title:"聊天机器人管理",bordered:!1,size:"small"},{"header-extra":l(()=>[n(o(W),null,{default:l(()=>[n(o(g),{loading:y.value,onClick:t[0]||(t[0]=s=>D())},{icon:l(()=>[n(r)]),default:l(()=>[t[10]||(t[10]=x(" 刷新 ",-1))]),_:1},8,["loading"]),n(o(g),{type:"primary",onClick:re},{icon:l(()=>[n(c)]),default:l(()=>[t[11]||(t[11]=x(" 新增聊天机器人 ",-1))]),_:1})]),_:1})]),default:l(()=>[n(o(ce),{columns:X.value,data:P.value,loading:y.value,pagination:!1,size:"small"},null,8,["columns","data","loading"])]),_:1}),n(o(Ee),{show:p.value,"onUpdate:show":t[9]||(t[9]=s=>p.value=s),preset:"card",title:Y.value,class:"chatbot-management__modal"},{footer:l(()=>[n(o(W),{justify:"end"},{default:l(()=>[n(o(g),{onClick:t[8]||(t[8]=s=>p.value=!1)},{default:l(()=>[...t[12]||(t[12]=[x("取消",-1)])]),_:1}),n(o(g),{type:"primary",loading:N.value,onClick:ie},{default:l(()=>[...t[13]||(t[13]=[x("保存",-1)])]),_:1},8,["loading"])]),_:1})]),default:l(()=>[n(o(Ue),{ref_key:"formRef",ref:I,model:a,rules:Q,"label-placement":"left","label-width":110},{default:l(()=>[n(o(K),{cols:2,"x-gap":12},{default:l(()=>[n(o(T),{label:"名称",path:"name"},{default:l(()=>[n(o(z),{value:a.name,"onUpdate:value":t[1]||(t[1]=s=>a.name=s),placeholder:"请输入聊天机器人名称"},null,8,["value"])]),_:1}),n(o(T),{label:"模型配置",path:"modelConfigId"},{default:l(()=>[n(o(A),{value:a.modelConfigId,"onUpdate:value":t[2]||(t[2]=s=>a.modelConfigId=s),options:V.value,loading:m.value,clearable:"",filterable:"",placeholder:"为空时使用默认模型"},null,8,["value","options","loading"])]),_:1})]),_:1}),n(o(E),{label:"描述",path:"description"},{default:l(()=>[n(o(z),{value:a.description,"onUpdate:value":t[3]||(t[3]=s=>a.description=s),type:"textarea",rows:3,placeholder:"请输入描述"},null,8,["value"])]),_:1}),n(o(E),{label:"系统提示词",path:"systemPrompt"},{default:l(()=>[n(o(z),{value:a.systemPrompt,"onUpdate:value":t[4]||(t[4]=s=>a.systemPrompt=s),type:"textarea",rows:6,placeholder:"可选"},null,8,["value"])]),_:1}),n(o(K),{cols:2,"x-gap":12},{default:l(()=>[n(o(T),{label:"启用工具",path:"enabledTools"},{default:l(()=>[n(o(A),{value:a.enabledTools,"onUpdate:value":t[5]||(t[5]=s=>a.enabledTools=s),options:H.value,loading:m.value,multiple:"",clearable:"",placeholder:"请选择启用工具"},null,8,["value","options","loading"])]),_:1}),n(o(T),{label:"上下文窗口",path:"contextWindowSize"},{default:l(()=>[n(o(Ae),{value:a.contextWindowSize,"onUpdate:value":t[6]||(t[6]=s=>a.contextWindowSize=s),min:0,class:"chatbot-management__number-input"},null,8,["value"])]),_:1})]),_:1}),n(o(E),{label:"子智能体",path:"subAgentIds"},{default:l(()=>[n(o(A),{value:a.subAgentIds,"onUpdate:value":t[7]||(t[7]=s=>a.subAgentIds=s),options:j.value,loading:m.value,multiple:"",clearable:"",filterable:"",placeholder:"请选择启用的子智能体"},null,8,["value","options","loading"])]),_:1})]),_:1},8,["model"]),h.value.length?(B(),L("div",Oe," 当前配置包含未识别工具,保存前会提示确认是否移除:"+We(h.value.join("、")),1)):Se("",!0)]),_:1},8,["show","title"])])}}}),He=Me(Re,[["__scopeId","data-v-66ee0e43"]]);export{He as default};
.chatbot-management[data-v-66ee0e43]{padding:16px;height:100%;overflow:auto}.chatbot-management[data-v-66ee0e43] .n-data-table-td{vertical-align:middle}.chatbot-management__modal[data-v-66ee0e43]{width:min(880px,100vw - 32px)}.chatbot-management__number-input[data-v-66ee0e43]{width:100%}.chatbot-management__warning[data-v-66ee0e43]{margin-top:12px;color:#d03050;font-size:13px}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
.department-management[data-v-78561873]{padding:16px;height:100%;overflow:auto}
This diff is collapsed.
import{x as _,y as c,z as H,A as O,C as g,D as p,d as x,E as u,F as V,G as A,H as $,I as G,J as F,f as K,K as U,L as J,M as Q,O as q,P as W,l as X,c as C,o as N,N as z,w as r,b as v,e as s,t as n,h as m,$ as h,Q as Y,g as l,R as Z}from"./index-DSCno0m2.js";import{N as ee}from"./Flex-CK9o7tXW.js";import{N as oe,_ as re}from"./Grid-DJ-rVKld.js";import{N as se}from"./Space-Dex4J4Il.js";import"./get-slot-Bk_rJcZu.js";const te=_([c("list",`
--n-merged-border-color: var(--n-border-color);
--n-merged-color: var(--n-color);
--n-merged-color-hover: var(--n-color-hover);
margin: 0;
font-size: var(--n-font-size);
transition:
background-color .3s var(--n-bezier),
color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
padding: 0;
list-style-type: none;
color: var(--n-text-color);
background-color: var(--n-merged-color);
`,[g("show-divider",[c("list-item",[_("&:not(:last-child)",[p("divider",`
background-color: var(--n-merged-border-color);
`)])])]),g("clickable",[c("list-item",`
cursor: pointer;
`)]),g("bordered",`
border: 1px solid var(--n-merged-border-color);
border-radius: var(--n-border-radius);
`),g("hoverable",[c("list-item",`
border-radius: var(--n-border-radius);
`,[_("&:hover",`
background-color: var(--n-merged-color-hover);
`,[p("divider",`
background-color: transparent;
`)])])]),g("bordered, hoverable",[c("list-item",`
padding: 12px 20px;
`),p("header, footer",`
padding: 12px 20px;
`)]),p("header, footer",`
padding: 12px 0;
box-sizing: border-box;
transition: border-color .3s var(--n-bezier);
`,[_("&:not(:last-child)",`
border-bottom: 1px solid var(--n-merged-border-color);
`)]),c("list-item",`
position: relative;
padding: 12px 0;
box-sizing: border-box;
display: flex;
flex-wrap: nowrap;
align-items: center;
transition:
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`,[p("prefix",`
margin-right: 20px;
flex: 0;
`),p("suffix",`
margin-left: 20px;
flex: 0;
`),p("main",`
flex: 1;
`),p("divider",`
height: 1px;
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: transparent;
transition: background-color .3s var(--n-bezier);
pointer-events: none;
`)])]),H(c("list",`
--n-merged-color-hover: var(--n-color-hover-modal);
--n-merged-color: var(--n-color-modal);
--n-merged-border-color: var(--n-border-color-modal);
`)),O(c("list",`
--n-merged-color-hover: var(--n-color-hover-popover);
--n-merged-color: var(--n-color-popover);
--n-merged-border-color: var(--n-border-color-popover);
`))]),ae=Object.assign(Object.assign({},$.props),{size:{type:String,default:"medium"},bordered:Boolean,clickable:Boolean,hoverable:Boolean,showDivider:{type:Boolean,default:!0}}),w=U("n-list"),ne=x({name:"List",props:ae,slots:Object,setup(o){const{mergedClsPrefixRef:e,inlineThemeDisabled:a,mergedRtlRef:t}=V(o),i=A("List",t,e),b=$("List","-list",te,G,o,e);J(w,{showDividerRef:Q(o,"showDivider"),mergedClsPrefixRef:e});const f=K(()=>{const{common:{cubicBezierEaseInOut:y},self:{fontSize:k,textColor:R,color:P,colorModal:B,colorPopover:D,borderColor:I,borderColorModal:j,borderColorPopover:L,borderRadius:S,colorHover:M,colorHoverModal:T,colorHoverPopover:E}}=b.value;return{"--n-font-size":k,"--n-bezier":y,"--n-text-color":R,"--n-color":P,"--n-border-radius":S,"--n-border-color":I,"--n-border-color-modal":j,"--n-border-color-popover":L,"--n-color-modal":B,"--n-color-popover":D,"--n-color-hover":M,"--n-color-hover-modal":T,"--n-color-hover-popover":E}}),d=a?F("list",void 0,f,o):void 0;return{mergedClsPrefix:e,rtlEnabled:i,cssVars:a?void 0:f,themeClass:d?.themeClass,onRender:d?.onRender}},render(){var o;const{$slots:e,mergedClsPrefix:a,onRender:t}=this;return t?.(),u("ul",{class:[`${a}-list`,this.rtlEnabled&&`${a}-list--rtl`,this.bordered&&`${a}-list--bordered`,this.showDivider&&`${a}-list--show-divider`,this.hoverable&&`${a}-list--hoverable`,this.clickable&&`${a}-list--clickable`,this.themeClass],style:this.cssVars},e.header?u("div",{class:`${a}-list__header`},e.header()):null,(o=e.default)===null||o===void 0?void 0:o.call(e),e.footer?u("div",{class:`${a}-list__footer`},e.footer()):null)}}),le=x({name:"ListItem",slots:Object,setup(){const o=q(w,null);return o||W("list-item","`n-list-item` must be placed in `n-list`."),{showDivider:o.showDividerRef,mergedClsPrefix:o.mergedClsPrefixRef}},render(){const{$slots:o,mergedClsPrefix:e}=this;return u("li",{class:`${e}-list-item`},o.prefix?u("div",{class:`${e}-list-item__prefix`},o.prefix()):null,o.default?u("div",{class:`${e}-list-item__main`},o):null,o.suffix?u("div",{class:`${e}-list-item__suffix`},o.suffix()):null,this.showDivider&&u("div",{class:`${e}-list-item__divider`}))}}),ie="/pms-agent/assets/soybean-JC38yUrs.jpg",de={class:"banner"},ce={class:"flex-y-center gap-12px"},pe={class:"text-18px font-semibold"},me={class:"text-#666 leading-28px"},ue=x({name:"HeaderBanner",__name:"header-banner",setup(o){const e=X();return(a,t)=>{const i=Y,b=ee,f=z;return N(),C(f,{bordered:!1,class:"card-wrapper"},{default:r(()=>[v("div",de,[v("div",ce,[t[0]||(t[0]=v("div",{class:"size-72px shrink-0 overflow-hidden rd-1/2"},[v("img",{src:ie,class:"size-full"})],-1)),v("div",null,[v("h3",pe,n(m(h)("page.home.greeting",{userName:m(e).userInfo.nickname||m(e).userInfo.username})),1),v("p",me,n(m(h)("page.home.intro")),1)])]),s(b,{class:"pt-16px",size:12},{default:r(()=>[s(i,{type:"info",round:""},{default:r(()=>[l(n(m(h)("page.home.tagUserAccess")),1)]),_:1}),s(i,{type:"success",round:""},{default:r(()=>[l(n(m(h)("page.home.tagProvider")),1)]),_:1}),s(i,{type:"warning",round:""},{default:r(()=>[l(n(m(h)("page.home.tagModel")),1)]),_:1}),s(i,{type:"primary",round:""},{default:r(()=>[l(n(m(h)("page.home.tagAssistant")),1)]),_:1})]),_:1})])]),_:1})}}}),fe=Z(ue,[["__scopeId","data-v-bb512bff"]]),xe=x({name:"home",__name:"index",setup(o){return(e,a)=>{const t=le,i=ne,b=z,f=re,d=oe,y=se;return N(),C(y,{vertical:"",size:16},{default:r(()=>[s(fe),s(d,{"x-gap":16,"y-gap":16,responsive:"screen","item-responsive":""},{default:r(()=>[s(f,{span:"24 s:24 m:12"},{default:r(()=>[s(b,{bordered:!1,class:"h-full card-wrapper"},{header:r(()=>[l(n(e.$t("page.home.capabilityTitle")),1)]),default:r(()=>[s(i,{bordered:!1},{default:r(()=>[s(t,null,{default:r(()=>[l(n(e.$t("page.home.capabilityUserAccess")),1)]),_:1}),s(t,null,{default:r(()=>[l(n(e.$t("page.home.capabilityModel")),1)]),_:1})]),_:1})]),_:1})]),_:1}),s(f,{span:"24 s:24 m:12"},{default:r(()=>[s(b,{bordered:!1,class:"h-full card-wrapper"},{header:r(()=>[l(n(e.$t("page.home.cleanupTitle")),1)]),default:r(()=>[s(i,{bordered:!1},{default:r(()=>[s(t,null,{default:r(()=>[l(n(e.$t("page.home.cleanupScope")),1)]),_:1}),s(t,null,{default:r(()=>[l(n(e.$t("page.home.cleanupLegacy")),1)]),_:1}),s(t,null,{default:r(()=>[l(n(e.$t("page.home.cleanupStrategy")),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}}});export{xe as default};
import{d as L,f as O,U as g,a as x,T as B,W as S,bk as N,o as y,c as A,p as C,t as D,w as K,b,bn as W,aL as $}from"./index-DSCno0m2.js";import{d as H,E as P,x as U,i as V,e as J,I as j,J as X}from"./index-3OlSoxmB.js";import"./chatbot-Dfd2mpvB.js";import"./FormItem-CHgZe7qM.js";import"./Alert-Cm6VlYYh.js";import"./Flex-CK9o7tXW.js";import"./get-slot-Bk_rJcZu.js";import"./assistant-Vu8dw-ko.js";var R=(f,e,r)=>new Promise((p,d)=>{var c=n=>{try{a(r.next(n))}catch(m){d(m)}},t=n=>{try{a(r.throw(n))}catch(m){d(m)}},a=n=>n.done?p(n.value):Promise.resolve(n.value).then(c,t);a((r=r.apply(f,e)).next())});const q=["data-markstream-mode"],z=["innerHTML"],F={key:1,class:"math-inline math-inline--fallback"},G={class:"math-inline__loading",role:"status","aria-live":"polite"},E=H(L({__name:"MathInlineNode",props:{node:{}},setup(f){const e=f,r=g(null),p=typeof window>"u",d=O(()=>e.node.markup==="$$"),c=(function(){if(!e.node.content)return{html:"",text:e.node.raw,loading:!1};if(!p)return{html:"",text:e.node.raw,loading:!1};const l=P();if(!l)return{html:"",text:e.node.raw,loading:!1};try{return{html:l.renderToString(e.node.content,{throwOnError:e.node.loading,displayMode:d.value}),text:"",loading:!1}}catch{return{html:"",text:e.node.raw,loading:!1}}})(),t=g(c.html),a=g(c.text);let n=!1,m=0,h=!1,v=null;const i=g(c.loading),M=U();let s=null;function T(){return R(this,null,function*(){if(h)return;if(!e.node.content)return i.value=!1,t.value="",a.value=e.node.raw,void(n=!0);v&&(v.abort(),v=null);const l=++m,u=new AbortController;if(v=u,!n)try{!s&&r.value&&(s=M(r.value)),yield s?.whenVisible}catch{}V(e.node.content,d.value,{timeout:1500,waitTimeout:0,maxRetries:0,signal:u.signal}).then(o=>{h||l!==m||(t.value=o,a.value="",i.value=!1,n=!0)}).catch(o=>R(null,null,function*(){if(h||l!==m)return;const w=o?.code||o?.name,k=w==="KATEX_DISABLED";if(w==="WORKER_INIT_ERROR"||o?.fallbackToRenderer||w===J||w==="WORKER_TIMEOUT"){const I=yield j();if(I){try{const _=I.renderToString(e.node.content,{throwOnError:e.node.loading,displayMode:d.value});t.value=_,a.value="",i.value=!1,n=!0,X(e.node.content,d.value,_)}catch{}return}}if(k)return i.value=!1,t.value="",void(a.value=e.node.raw);n||(i.value=!k),e.node.loading?k&&(t.value="",a.value=e.node.raw):(i.value=!1,t.value="",a.value=e.node.raw)}))})}return(c.html||c.text)&&(n=!0),B(()=>e.node.content,()=>{T()}),S(()=>{p||t.value||T()}),N(()=>{var l;h=!0,v&&(v.abort(),v=null),(l=s?.destroy)==null||l.call(s),s=null}),(l,u)=>(y(),x("span",{ref_key:"containerEl",ref:r,class:"math-inline-wrapper","data-markstream-math":"inline","data-markstream-mode":t.value?"katex":a.value?"fallback":"loading"},[t.value?(y(),x("span",{key:0,class:"math-inline",innerHTML:t.value},null,8,z)):a.value?(y(),x("span",F,D(a.value),1)):i.value?(y(),A($,{key:2,name:"table-node-fade"},{default:K(()=>[b("span",G,[W(l.$slots,"loading",{isLoading:i.value},()=>[u[0]||(u[0]=b("span",{class:"math-inline__spinner animate-spin","aria-hidden":"true"},null,-1)),u[1]||(u[1]=b("span",{class:"sr-only"},"Loading",-1))],!0)])]),_:3})):C("",!0)],8,q))}}),[["__scopeId","data-v-d4b863b7"]]);E.install=f=>{f.component(E.__name,E)};export{E as default};
import{d as I,U as x,a as h,T as M,W as B,bk as O,o as p,e as C,w as L,p as N,b as S,aL as A,a6 as b,t as D}from"./index-DSCno0m2.js";import{d as K,E as V,x as W,i as H,e as U,I as J,J as P}from"./index-3OlSoxmB.js";import"./chatbot-Dfd2mpvB.js";import"./FormItem-CHgZe7qM.js";import"./Alert-Cm6VlYYh.js";import"./Flex-CK9o7tXW.js";import"./get-slot-Bk_rJcZu.js";import"./assistant-Vu8dw-ko.js";var E=(f,e,u)=>new Promise((c,a)=>{var t=n=>{try{v(u.next(n))}catch(l){a(l)}},s=n=>{try{v(u.throw(n))}catch(l){a(l)}},v=n=>n.done?c(n.value):Promise.resolve(n.value).then(t,s);v((u=u.apply(f,e)).next())});const z=["data-markstream-mode"],X={key:0,class:"math-loading-overlay"},j=["innerHTML"],q={key:1,class:"math-block__fallback text-left"},w=K(I({__name:"MathBlockNode",props:{node:{}},setup(f){const e=f,u=x(null),c=(function(){if(!e.node.content)return{html:"",text:e.node.raw,loading:!1};const r=V();if(!r)return{html:"",text:e.node.raw,loading:!1};try{return{html:r.renderToString(e.node.content,{throwOnError:e.node.loading,displayMode:!0}),text:"",loading:!1}}catch{return{html:"",text:e.node.raw,loading:!1}}})(),a=x(c.html),t=x(c.text);let s=!1,v=0,n=!1,l=null;const T=W();let d=null;const o=x(c.loading);function y(){return E(this,null,function*(){if(n)return;if(!e.node.content)return o.value=!1,a.value="",t.value=e.node.raw,void(s=!0);if(!s)try{!d&&u.value&&(d=T(u.value)),yield d?.whenVisible}catch{}l&&(l.abort(),l=null);const r=++v,m=new AbortController;l=m,H(e.node.content,!0,{timeout:3e3,waitTimeout:2e3,maxRetries:1,signal:m.signal}).then(i=>{n||r!==v||(a.value=i,t.value="",s=!0,o.value=!1)}).catch(i=>E(null,null,function*(){if(n||r!==v)return;const k=i?.code||i?.name,R=k==="KATEX_DISABLED";if(k==="WORKER_INIT_ERROR"||i?.fallbackToRenderer||k===U||k==="WORKER_TIMEOUT"){const _=yield J();if(_){try{const g=_.renderToString(e.node.content,{throwOnError:e.node.loading,displayMode:!0});a.value=g,t.value="",s=!0,o.value=!1,P(e.node.content,!0,g)}catch{}return}}if(R)return o.value=!1,a.value="",void(t.value=e.node.raw);s||(o.value=!0),e.node.loading||(o.value=!1,a.value="",t.value=e.node.raw)}))})}return(c.html||c.text)&&(s=!0),M(()=>e.node.content,()=>{y()}),B(()=>{a.value||y()}),O(()=>{var r;n=!0,l&&(l.abort(),l=null),(r=d?.destroy)==null||r.call(d),d=null}),(r,m)=>(p(),h("div",{ref_key:"containerEl",ref:u,class:"math-block text-center overflow-x-auto relative min-h-[40px]","data-markstream-math":"block","data-markstream-mode":a.value?"katex":t.value?"fallback":"loading"},[C(A,{name:"math-fade"},{default:L(()=>[!o.value||a.value||t.value?N("",!0):(p(),h("div",X,[...m[0]||(m[0]=[S("div",{class:"math-loading-spinner"},null,-1)])]))]),_:1}),a.value?(p(),h("div",{key:0,class:b(["math-block__content",{"math-rendering":o.value}]),innerHTML:a.value},null,10,j)):t.value?(p(),h("pre",q,D(t.value),1)):(p(),h("div",{key:2,class:b(["math-block__content",{"math-rendering":o.value}])},null,2))],8,z))}}),[["__scopeId","data-v-5d203bbc"]]);w.install=f=>{f.component(w.__name,w)};export{w as default};
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
const r={};throw new Error('Could not resolve "@antv/infographic" imported by "markstream-vue".');export{r as default};
const e={};throw new Error('Could not resolve "katex/dist/contrib/mhchem" imported by "markstream-vue".');export{e as default};
import{_ as d,g as m,a as l}from"./Grid-DJ-rVKld.js";import{a as u,f as p,d as f}from"./FormItem-CHgZe7qM.js";import{d as c,E as s,a$ as a,U as h,bK as r,ba as g,a as v,o as _,b as I}from"./index-DSCno0m2.js";const $=Object.assign(Object.assign({},l),f),V=c({__GRID_ITEM__:!0,name:"FormItemGridItem",alias:["FormItemGi"],props:$,setup(){const e=h(null);return{formItemInstRef:e,validate:(...o)=>{const{value:i}=e;if(i)return i.validate(...o)},restoreValidation:()=>{const{value:o}=e;o&&o.restoreValidation()}}},render(){return s(d,a(this.$.vnode.props||{},m),{default:()=>{const e=a(this.$props,p);return s(u,Object.assign({ref:"formItemInstRef"},e),this.$slots)}})}});function D(){return r({url:"/api/admin/providers/types",method:"get"})}function G(){return r({url:"/api/admin/providers",method:"get"})}function j(e){return r({url:"/api/admin/providers",method:"post",data:e})}function w(e,t){return r({url:`/api/admin/providers/${e}`,method:"put",data:t})}function y(e){return r({url:`/api/admin/providers/${e}`,method:"delete"})}function B(e){return r({url:`/api/admin/providers/${e}/toggle`,method:"patch"})}function F(e){return r({url:`/api/admin/providers/${e}/models`,method:"get"})}function N(e,t){return r({url:`/api/admin/providers/${e}/models`,method:"post",data:t})}function R(e,t,n){return r({url:`/api/admin/providers/${e}/models/${t}`,method:"put",data:n})}function T(e,t){return r({url:`/api/admin/providers/${e}/models/${t}`,method:"delete"})}function U(e,t){return r({url:`/api/admin/providers/${e}/models/${t}/toggle`,method:"patch"})}function x(){return r({url:"/api/admin/settings/default-models",method:"get"})}function A(e){return r({url:"/api/admin/settings/default-models",method:"put",data:e})}const M={class:"inline-block",viewBox:"0 0 32 32",width:"1em",height:"1em"};function P(e,t){return _(),v("svg",M,[...t[0]||(t[0]=[I("path",{fill:"currentColor",d:"M12 10H6.78A11 11 0 0 1 27 16h2A13 13 0 0 0 6 7.68V4H4v8h8Zm8 12h5.22A11 11 0 0 1 5 16H3a13 13 0 0 0 23 8.32V28h2v-8h-8Z"},null,-1)])])}const E=g({name:"carbon-renew",render:P});export{V as N,E as _,F as a,D as b,w as c,j as d,B as e,G as f,y as g,R as h,N as i,U as j,T as k,x as l,A as m};
import{bK as t,ba as n,a as r,o,b as i}from"./index-DSCno0m2.js";function u(e){return t({url:"/api/permissions",method:"get",params:e})}function l(e){return t({url:"/api/permissions",method:"post",data:e})}function p(e,s){return t({url:`/api/permissions/${e}`,method:"put",data:s})}function h(e){return t({url:`/api/permissions/${e}`,method:"delete"})}const a={class:"inline-block",viewBox:"0 0 32 32",width:"1em",height:"1em"};function c(e,s){return o(),r("svg",a,[...s[0]||(s[0]=[i("path",{fill:"currentColor",d:"m29 27.586l-7.552-7.552a11.018 11.018 0 1 0-1.414 1.414L27.586 29ZM4 13a9 9 0 1 1 9 9a9.01 9.01 0 0 1-9-9"},null,-1)])])}const f=n({name:"carbon-search",render:c});export{f as _,p as a,l as b,h as c,u as f};
This diff is collapsed.
<!doctype html>
<html lang="zh-cmn-Hans">
<head>
<meta name="buildTime" content="2026-04-29 15:53:24">
<meta charset="UTF-8" />
<link rel="icon" href="/pms-agent/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="color-scheme" content="light dark" />
<title>EpochAgent</title>
<script type="module" crossorigin src="/pms-agent/assets/index-DSCno0m2.js"></script>
<link rel="stylesheet" crossorigin href="/pms-agent/assets/index-DloS-pmm.css">
</head>
<body>
<div id="app"></div>
</body>
</html>
...@@ -122,7 +122,6 @@ class GraphCheckPointRepositoryTest { ...@@ -122,7 +122,6 @@ class GraphCheckPointRepositoryTest {
assertTrue(sqlRef.get().contains("AI_GRAPHCHECKPOINT")); assertTrue(sqlRef.get().contains("AI_GRAPHCHECKPOINT"));
assertFalse(sqlRef.get().contains("platform_agent_checkpoint")); assertFalse(sqlRef.get().contains("platform_agent_checkpoint"));
assertEquals(1, result.size()); assertEquals(1, result.size());
// assertEquals(Base64.getEncoder().encodeToString(payload), result.getFirst().getStateData());
} }
@Test @Test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment