Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions docs/public/editor/autocomplete-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,59 +37,6 @@
"type": "array",
"desc": "Array of shared agentic workflow specifications to import.",
"array": true
},
"apm-packages": {
"type": "array|object",
"desc": "APM package references to install.",
"children": {
"packages": {
"type": "array",
"desc": "List of APM package references to install.",
"array": true
},
"isolated": {
"type": "boolean",
"desc": "If true, agent restore step clears primitive dirs before unpacking.",
"enum": [true, false],
"leaf": true
},
"github-app": {
"type": "object",
"desc": "GitHub App credentials for minting installation access tokens used by APM to access cross-org private repositories.",
"children": {
"app-id": {
"type": "string",
"desc": "GitHub App ID (e.g., '${{ vars.APP_ID }}').",
"leaf": true
},
"private-key": {
"type": "string",
"desc": "GitHub App private key (e.g., '${{ secrets.APP_PRIVATE_KEY }}').",
"leaf": true
},
"owner": {
"type": "string",
"desc": "Optional owner of the GitHub App installation (defaults to current repository owner if not specified)",
"leaf": true
},
"repositories": {
"type": "array",
"desc": "Optional list of repositories to grant access to (defaults to current repository if not specified)",
"array": true
}
}
},
"env": {
"type": "object",
"desc": "Environment variables to set on the APM pack step."
},
"github-token": {
"type": "string",
"desc": "GitHub token expression to authenticate APM with private package repositories.",
"leaf": true
}
},
"array": true
}
},
"array": true
Expand Down
46 changes: 3 additions & 43 deletions docs/src/content/docs/reference/frontmatter-full.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ metadata:
{}

# Workflow specifications to import. Supports array form (list of paths) or object
# form with 'aw' (agentic workflow paths) and 'apm-packages' (APM packages)
# subfields. Path resolution: (1) relative paths (e.g., 'shared/file.md') are
# form with 'aw' (agentic workflow paths) subfield. Path resolution: (1) relative
# paths (e.g., 'shared/file.md') are
# resolved relative to the workflow's directory; (2) paths starting with
# '.github/' or '/' are resolved from the repository root (repo-root-relative);
# (3) paths matching 'owner/repo/path@ref' are fetched from GitHub at compile time
Expand All @@ -81,53 +81,13 @@ imports: []
# Array items: undefined

# Option 2: Object form of imports with 'aw' subfield for shared agentic workflow
# paths and 'apm-packages' subfield for APM packages.
# paths.
imports:
# Array of shared agentic workflow specifications to import. Format:
# owner/repo/path@ref or relative paths.
# (optional)
aw: []

# APM package references to install. Supports array format (list of package slugs)
# or object format with packages and configuration fields. Replaces the top-level
# 'dependencies' field.
# (optional)
# This field supports multiple formats (oneOf):

# Option 1: Simple array of APM package references.
apm-packages: []
# Array items: APM package reference in the format 'org/repo' or
# 'org/repo/path/to/skill'

# Option 2: Object format with packages and optional configuration.
apm-packages:
# List of APM package references to install.
packages: []
# Array of APM package reference in the format 'org/repo' or
# 'org/repo/path/to/skill'

# If true, agent restore step clears primitive dirs before unpacking.
# (optional)
isolated: true

# GitHub App credentials for minting installation access tokens used by APM to
# access cross-org private repositories.
# (optional)
# This field supports multiple formats (anyOf):

# Option 1: undefined

# Option 2: undefined

# Environment variables to set on the APM pack step.
# (optional)
env:
{}

# GitHub token expression to authenticate APM with private package repositories.
# (optional)
github-token: "${{ secrets.GITHUB_TOKEN }}"

# Optional list of additional workflow or action files that should be fetched
# alongside this workflow when running 'gh aw add'. Entries are relative paths
# (from the same directory as this workflow in the source repository) to agentic
Expand Down
7 changes: 3 additions & 4 deletions pkg/parser/import_bfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func processImportsFromFrontmatterWithManifestAndSource(frontmatter map[string]a
log.Print("Processing imports from frontmatter with recursive BFS")

// Parse imports field - can be array of strings or objects with path and inputs,
// or an object with 'aw' (agentic workflow paths) and 'apm-packages' subfields.
// or an object with an 'aw' (agentic workflow paths) subfield.
var importSpecs []ImportSpec
switch v := importsField.(type) {
case []any:
Expand All @@ -41,9 +41,8 @@ func processImportsFromFrontmatterWithManifestAndSource(frontmatter map[string]a
importSpecs = append(importSpecs, ImportSpec{Path: s})
}
case map[string]any:
// Object form: {aw: [...], apm-packages: [...]}
// Object form: {aw: [...]}
// Extract 'aw' subfield for agentic workflow imports.
// The 'apm-packages' subfield is handled separately by extractAPMDependenciesFromFrontmatter.
if awAny, hasAW := v["aw"]; hasAW {
switch awVal := awAny.(type) {
case []any:
Expand All @@ -61,7 +60,7 @@ func processImportsFromFrontmatterWithManifestAndSource(frontmatter map[string]a
}
}
default:
return nil, errors.New("imports field must be an array or an object with 'aw'/'apm-packages' subfields")
return nil, errors.New("imports field must be an array or an object with an 'aw' subfield")
}

if len(importSpecs) == 0 {
Expand Down
67 changes: 3 additions & 64 deletions pkg/parser/schemas/main_workflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
]
},
"imports": {
"description": "Workflow specifications to import. Supports array form (list of paths) or object form with 'aw' (agentic workflow paths) and 'apm-packages' (APM packages) subfields. Path resolution: (1) relative paths (e.g., 'shared/file.md') are resolved relative to the workflow's directory; (2) paths starting with '.github/' or '/' are resolved from the repository root (repo-root-relative); (3) paths matching 'owner/repo/path@ref' are fetched from GitHub at compile time (cross-repo).",
"description": "Workflow specifications to import. Supports array form (list of paths) or object form with 'aw' (agentic workflow paths) subfield. Path resolution: (1) relative paths (e.g., 'shared/file.md') are resolved relative to the workflow's directory; (2) paths starting with '.github/' or '/' are resolved from the repository root (repo-root-relative); (3) paths matching 'owner/repo/path@ref' are fetched from GitHub at compile time (cross-repo).",
"oneOf": [
{
"type": "array",
Expand Down Expand Up @@ -201,7 +201,7 @@
},
{
"type": "object",
"description": "Object form of imports with 'aw' subfield for shared agentic workflow paths and 'apm-packages' subfield for APM packages.",
"description": "Object form of imports with 'aw' subfield for shared agentic workflow paths.",
"additionalProperties": false,
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The object-form imports schema allows an empty object (imports: {}) because aw is not required. Now that the only supported object-form key is aw, consider requiring it (and/or setting minProperties: 1) to prevent no-op configurations and better catch typos in CI/schema validation.

Suggested change
"additionalProperties": false,
"additionalProperties": false,
"minProperties": 1,
"required": ["aw"],

Copilot uses AI. Check for mistakes.
"properties": {
"aw": {
Expand Down Expand Up @@ -329,57 +329,6 @@
}
]
}
},
"apm-packages": {
"description": "APM package references to install. Supports array format (list of package slugs) or object format with packages and configuration fields. Replaces the top-level 'dependencies' field.",
"oneOf": [
{
"type": "array",
"description": "Simple array of APM package references.",
"items": {
"type": "string",
"pattern": "^[a-zA-Z0-9_-]+/[a-zA-Z0-9_./-]+$",
"description": "APM package reference in the format 'org/repo' or 'org/repo/path/to/skill'"
}
},
{
"type": "object",
"description": "Object format with packages and optional configuration.",
"properties": {
"packages": {
"type": "array",
"description": "List of APM package references to install.",
"items": {
"type": "string",
"pattern": "^[a-zA-Z0-9_-]+/[a-zA-Z0-9_./-]+$",
"description": "APM package reference in the format 'org/repo' or 'org/repo/path/to/skill'"
}
},
"isolated": {
"type": "boolean",
"description": "If true, agent restore step clears primitive dirs before unpacking."
},
"github-app": {
"$ref": "#/$defs/github_app",
"description": "GitHub App credentials for minting installation access tokens used by APM to access cross-org private repositories."
},
"env": {
"type": "object",
"description": "Environment variables to set on the APM pack step.",
"additionalProperties": {
"type": "string"
}
},
"github-token": {
"type": "string",
"description": "GitHub token expression to authenticate APM with private package repositories.",
"examples": ["${{ secrets.MY_TOKEN }}", "${{ secrets.GH_AW_GITHUB_TOKEN }}"]
}
},
"required": ["packages"],
"additionalProperties": false
}
]
}
}
}
Expand All @@ -398,17 +347,7 @@
}
],
{
"aw": ["shared/common-tools.md", "shared/mcp/tavily.md"],
"apm-packages": ["microsoft/apm-sample-package"]
},
{
"apm-packages": {
"packages": ["microsoft/apm-sample-package"],
"github-app": {
"client-id": "${{ vars.APP_ID }}",
"private-key": "${{ secrets.APP_PRIVATE_KEY }}"
}
}
"aw": ["shared/common-tools.md", "shared/mcp/tavily.md"]
}
]
},
Expand Down
Loading