Agent lifecycle pipeline setup
Set up agent-component development CI/CD
Section titled “Set up agent-component development CI/CD”The plugin is the app package you ship; a declarative agent is an optional
component. This page documents the shipped agent-ci-cd workflow. Its org-catalog command
body is agent-project-specific and must not be applied unchanged to an unrelated
wiqd plugin project. The commercial Marketplace lifecycle instead uses the selected
project, reviewed publisher binding, and exact approved package. For general
plugin commands and their validation and environment requirements, see
Build a Plugin.
The installed wiqd skill helps prepare WIQD’s part of your pipeline: authentication, project/environment inputs, lifecycle commands and result handling. It includes focused GitHub Actions and Azure Pipelines snippets for those WIQD steps. Use a related platform skill for broader pipeline setup, runners, secret-store administration and release controls, not for WIQD’s auth contract.
For example, ask:
Prepare WIQD CI/CD for
agents/helpdeskin environmentdev. Explain the supported authentication choices and commands to validate, provision, package and submit to our org catalog. Include GitHub Actions step snippets using username/password authentication.
The workflow adapts the WIQD snippets to your selected platform and auth mode. Use the platform’s related skill for the surrounding pipeline. Setup does not create remote pipelines, store secrets, grant permissions, deploy or publish on your behalf.
The agent-ci-cd workflow ships in the marketplace plugin. CLI installation or
extension activation does not refresh an installed host plugin; use your host’s
marketplace installation flow.
Prepare WIQD and the project
Section titled “Prepare WIQD and the project”Use an existing agent project with its lifecycle files and non-secret environment
configuration. Choose an exact approved WIQD release, Node.js 24.15.0 or later,
the project path, lifecycle environment and intended operations. Check the
installed version with wiqd --version.
On a fresh runner, use the direct-npm-first bootstrap.
After reviewing the current terms, the job owner may explicitly configure
wiqd eula accept wiqd --yes --json. This host-only opt-in is not installation
consent, authentication, or downstream Work IQ/Eval acceptance. Do not start
with the web installer’s fresh unattended consent prompt.
Retain real project build/tests. Declarative projects have no universal compile
command; wiqd plugin package produces their distributable ZIP.
Work IQ explicit acceptance
Section titled “Work IQ explicit acceptance”Work IQ opts in to wiqd eula accept workiq --yes --json through its extension manifest.
The requester confirmed scoped product/legal approval, including CI use, on
2026-11-18. That accepted decision is separate from WIQD’s host-only approval
and does not establish release readiness or authorize an individual acceptance
operation. The job owner must review the
Work IQ terms and explicitly authorize
the exact acceptance step before queuing. Installation permission, host EULA
acceptance and CI detection do not grant that authorization.
Use the same verified WIQD launcher and environment for these ordered steps:
wiqd eula accept workiq --yes --jsonwiqd eula status --jsonDo not run the second step or dependent product work unconditionally. Acceptance
must return exit 0 and a success envelope whose data contains the exact
tool: "workiq", current eulaUrl, method: "explicit-yes" and
acceptanceCommandCompleted: true. This confirms native command completion,
not independently verified acceptance. Then require an accepted Work IQ status
row. Other tools need not be accepted: inspect rows only from a success envelope
or the documented EULA_STATUS_BINARY_UNRESOLVED error’s error.data with matching
process/envelope exit 2 and a genuinely unresolved downstream row.
Unaccepted/unresolved Work IQ, a missing probe or any other invalid observation
stops dependent work.
The Work IQ manifest opts in; Eval does not. WIQD reuses the tool’s managed binary
and native accept-eula, mandatory invocation audit and one-shot guard. Stdin is
closed and execution is bounded to 60 seconds. Failure, timeout, cancellation or
uncertainty stops without automatic acceptance retries. This does not accept
WIQD’s own terms, authenticate, change shared preflight or enable mock acceptance.
The existing TTY/verbatim-consent flow without --yes is unchanged and still
refuses CI.
Deploy WIQD’s own plugin from this repository
Section titled “Deploy WIQD’s own plugin from this repository”The manually queued repository pipeline
.azuredevops/pipelines/wiqd-plugin-m365.yml builds the checked-out CLI and
uses scripts/build-plugins.ps1 -Platform m365 to produce the canonical
advisory DA plus the complete 3p/public-stable WIQD skill. It prepares that
final ZIP locally, publishes the inspected build artifact, then personally deploys
it through wiqd plugin provision package.
There is no plugin import, source-project provision or second packaging step.
Before consent, its separate prewarm step runs wiqd doctor --json to
install or repair active managed CLIs, including Work IQ and Eval. It requires
a healthy report and exactly one successful workiq --json readiness check.
This does not accept either agreement or sign in; pending EULA warnings are
allowed. Prewarm failure stops the job before the consent step.
For a valid unhealthy doctor report, the failure includes a bounded, redacted
summary of failed check names, diagnostic codes and messages. Use those checks to
repair the runner before a new run; a diagnostic summary never authorizes consent.
Malformed reports and raw child output remain withheld, and the original failure
exit code is preserved.
Its existing consent step runs the public wiqd eula accept wiqd --yes --json
command, followed by wiqd eula accept workiq --yes --json and an independent
wiqd eula status --json check through the same CLI. The step requires valid
host acceptance, Work IQ command completion, and exactly one Work IQ status row
reporting accepted for the same terms URL before continuing. Failure or
uncertain evidence stops without retrying acceptance or calling Work IQ directly.
It does not provide a separate EULA implementation or pass delegated credentials
to acceptance or status checks. The job owner must review both agreements and
explicitly authorize each acceptance and the deployment before queuing; host
acceptance does not imply Work IQ consent. Mock acceptance remains prohibited.
The consent log shows Before and After WIQD/Work IQ states as indented JSON
using the status report’s wiqd and tools structure with only validated
tool, state and eulaUrl fields, the explicit
acceptance commands and their validated outcomes, and each state transition.
Already-accepted agreements may remain accepted -> accepted; Work IQ command
completion alone is not state verification. The initial status must be readable:
binary-unresolved (status exit 2) means a binary is unavailable, not that its
agreement is unaccepted, and now stops consent rather than triggering installation
during acceptance. Other precheck failures also stop the phase; final status must succeed with
both agreements accepted. Logs omit raw child output, credentials and consent
records; progress goes to stderr and stdout retains the final JSON result.
The repository pipeline buffers this step’s output until the consent script
exits, then prints progress followed by the final result through one channel.
This keeps the final JSON from appearing inside a status snapshot when Azure
combines stdout and stderr. Failures retain their original exit code and
diagnostic output, and temporary log storage is removed.
This repository pipeline supports refresh-token authentication only; there is
no authMode selector or password fallback. Configure M365_REFRESH_TOKEN as a
protected secret pipeline variable and M365_TENANT_ID as the target tenant GUID.
Follow the refresh-token setup guidance below, including using a token issued
for the supported public client. Do not configure M365_ACCOUNT_NAME or
M365_ACCOUNT_PASSWORD for this pipeline. Missing, blank or unresolved required
inputs, a non-GUID tenant or any password input stop deployment.
Set the pipeline’s only application parameter, appVersion. Increment it
when updating an existing app; the pipeline does not increment it automatically.
The source manifest in packages/plugins/wiqd-m365/appPackage/ owns the
Work IQ Dev Tools name, app ID ffb2ba94-4d6c-46ab-9dc1-117688fad733,
branding, developer links and advisory DA. These are not pipeline overrides.
The same app ID updates that app, not an isolated app found by name.
No name lookup or separate Teams identity-creation step runs.
The builder uses one clean committed HEAD, not local preview. The pipeline
checks the build revision and app metadata, then runs
wiqd plugin provision package --dry-run without delegated credentials.
This inspects and prepares the ZIP; it is not full app-schema/store validation
or evidence that M365 can load the skill. Co-packaging the skill does not give
the advisory DA local-project access or backend actions.
Only actual ZIP provision and a read-only version-conflict diagnostic receive
delegated credentials. Deployment uses personal scope in the authenticated
tenant and binds the inspected preparation hash and expected tenant.
If provisioning reports that the new title needs a higher version, or the ZIP
upload is rejected with HTTP 400/409, the error
includes the submitted appVersion and attempts one read-only M365 lookup for the
current deployed version. It reports unavailable if the version cannot be
verified; it does not substitute the Developer Portal draft version or expose
the raw response. Inspect the target, then queue a new run with a version higher
than the deployed version. The pipeline neither increments the version nor
retries provision automatically.
An HTTP rejection alone does not establish a version conflict; the original
upload error remains authoritative.
After successful local preparation, the pipeline publishes
wiqd-m365-apppackage before attempting provision. It contains the original
wiqd-m365.zip and build-info.json with the source commit, CLI version, app
identity/version and ZIP SHA-256. If provision fails, you can still download this
artifact to inspect the package. Build provenance is not evidence of deployment
or runtime readiness; check the target before manually uploading it after an
uncertain attempt.
Only after successful provision, the pipeline publishes a separate
wiqd-m365-deployment-receipt artifact containing receipt.json, bound to the
same ZIP name and SHA-256. It does not copy or build another ZIP. The receipt
records package provenance with deploymentStatus: not-verified, not independent
runtime or exact HTTP-upload verification. Neither artifact includes project or
preparation state, environment files, credentials or acceptance records. This flow
does not submit the app to the organization catalog.
Changed build evidence, preparation state or identity stop the applicable phase; missing, empty or changed ZIP bytes prevent retention. Build artifact publication must succeed before provision. Failed provision prevents a deployment receipt, but does not remove the previously published build artifact. If receipt retention or publication fails afterward, deployment may already have succeeded; that failure does not roll it back. Inspect the target before starting another run after any uncertain mutation; the pipeline does not replay it automatically.
Configure lifecycle authentication
Section titled “Configure lifecycle authentication”Core-backed provision, publish and share operations, including corresponding plugin lifecycle commands, support both username/password and refresh-token authentication. Choose one with your tenant owner.
| Mode | Process-environment inputs |
|---|---|
| Both | CI_ENABLED=true exactly; generic CI=true is insufficient |
| Username/password | Nonempty protected M365_ACCOUNT_NAME and M365_ACCOUNT_PASSWORD; M365_REFRESH_TOKEN entirely absent. Optional M365_TENANT_ID accepts a tenant ID/domain; omission uses organizations, and common/consumers are rejected. |
| Refresh token | Nonempty protected M365_REFRESH_TOKEN and a required tenant GUID in M365_TENANT_ID; both password inputs entirely absent, including empty definitions. |
Password mode requires no refresh-token bootstrap. For refresh-token mode only, obtain the token once on a persistent workstation in a private terminal and store it directly in your approved secret store. This is not runner setup: every clean, randomly assigned runner receives the token through its process environment. Follow Pipeline authentication for bootstrap, renewal, policy limits and troubleshooting.
Use the snippets below to inject the selected credential names into the
authenticated process environment. Never commit or paste secret values, pass
them in command arguments, publish them as artifacts or expose them to untrusted
code. Run lifecycle commands directly, not wiqd auth login in CI. Missing,
mixed or rejected credentials must stop, not trigger another identity.
These delegated credentials do not bypass MFA, Conditional Access, consent or permissions. They do not authenticate Work IQ, eval, other extensions or arbitrary Azure/SPFx drivers. Qualify the intended release, runner and a non-production operation before production; successful bootstrap alone is not proof of downstream access.
Choose the WIQD operations
Section titled “Choose the WIQD operations”The generic org-catalog sequence is:
| Order | WIQD operation |
|---|---|
| Validate | Static manifest validation, without deployment credentials for untrusted checks |
| Provision | Deploy using the explicit project path and lifecycle environment |
| Revalidate and package | Check the provisioned workspace and produce the app ZIP |
| Publish | Submit to the org admin catalog, subject to administrator approval |
Use explicit --path, --env and --json flags. The installed workflow includes
a WIQD-only command-body example with native-exit, JSON and package-output
checks, plus provider-specific steps that invoke it. Select only the
operations needed. Sharing requires explicit audience authorization; destructive
cleanup is not an automatic stage.
Offline source validation is not final-package validation, eval, certification or permission to publish. Org-catalog submission is not public Marketplace publication.
Commercial Marketplace lifecycle authentication
Section titled “Commercial Marketplace lifecycle authentication”wiqd publish pc uses the Marketplace provider, which creates a separate
memory-only Graph/Marketplace session from the same caller-managed
M365_REFRESH_TOKEN used by core refresh-token mode. It requires exact
CI_ENABLED=true, a tenant GUID in M365_TENANT_ID, and a selected project’s
partner-center.json with the same tenant. It does not support the core
username/password mode, a service principal, workload identity, or a copied
protected developer session.
--authorize-submit is invocation-scoped submission consent, not authentication.
An approved release step can publish without interactive input when it includes
that flag; credentials, prior Draft preparation, or pipeline setup do not imply
authorization. The human establishes the publisher binding and bootstraps the
refresh token on a persistent workstation outside CI. The minimal nonsecret
binding may be committed, but the complete publishing configuration contains the
secret hideKey; keep it out of version control and supply it at the selected
project’s partner-center.json path through an approved protected-file mechanism.
The runner needs no prior sign-in, affinity, or persisted authentication cache. See
Marketplace authentication in automation
for the exact package-validation, command and recovery flow.
Wire authentication and commands into the pipeline
Section titled “Wire authentication and commands into the pipeline”Run WIQD commands directly in GitHub Actions run: or Azure Pipelines pwsh:
steps, or use optional project-owned scripts for reuse. Neither creating a
separate script nor asking the installed skill to generate one is required.
The snippets below illustrate the optional-script approach with
.ci/wiqd-agent.ps1. Its example command body validates, provisions, revalidates,
packages and publishes, stopping on native/JSON errors or missing package output.
To inline it instead, replace the script invocation with that command body,
retaining the env bindings, Azure macro checks and final exit $LASTEXITCODE.
The file is a project-owned example, not a script installed by the CLI.
Insert one of these step snippets into an existing trusted release job after
checkout, approved WIQD installation and required project build/tests. Use
PowerShell 7 from the checkout root. Set the project path and lifecycle environment
directly in the commands using existing --path and --env options, for example
--path ./agents/helpdesk --env dev. No additional pipeline variables are
needed for these values. Store credentials as secrets. Do not inherit
the other auth mode’s keys at job/pipeline scope, even as empty values.
GitHub Actions: username/password
Section titled “GitHub Actions: username/password”- name: Run WIQD agent lifecycle shell: pwsh run: | & ./.ci/wiqd-agent.ps1 exit $LASTEXITCODE env: CI_ENABLED: 'true' M365_ACCOUNT_NAME: ${{ secrets.M365_ACCOUNT_NAME }} M365_ACCOUNT_PASSWORD: ${{ secrets.M365_ACCOUNT_PASSWORD }}Azure Pipelines: username/password
Section titled “Azure Pipelines: username/password”Azure secret variables require explicit env mapping. The check refuses
unresolved variable macros before executing the WIQD script.
- pwsh: | foreach ($name in @('M365_ACCOUNT_NAME', 'M365_ACCOUNT_PASSWORD')) { if ([Environment]::GetEnvironmentVariable($name) -match '^\$\([^)]+\)$') { throw "Define Azure pipeline variable $name before running WIQD." } } & ./.ci/wiqd-agent.ps1 exit $LASTEXITCODE displayName: Run WIQD agent lifecycle env: CI_ENABLED: 'true' M365_ACCOUNT_NAME: $(M365_ACCOUNT_NAME) M365_ACCOUNT_PASSWORD: $(M365_ACCOUNT_PASSWORD)Refresh-token alternative
Section titled “Refresh-token alternative”Use the same lifecycle command body, inline or scripted, but remove both password keys and add these
bindings instead. In the Azure step, replace the two password names in the
macro-check list with M365_TENANT_ID and M365_REFRESH_TOKEN too.
The installed workflow supplies complete step snippets for both modes/providers.
| Process input | GitHub Actions env value |
Azure Pipelines env value |
|---|---|---|
M365_TENANT_ID |
${{ vars.M365_TENANT_ID }} |
$(M365_TENANT_ID) |
M365_REFRESH_TOKEN |
${{ secrets.M365_REFRESH_TOKEN }} |
$(M365_REFRESH_TOKEN) |
Keep CI_ENABLED: 'true' and the script’s project/environment values. Use a tenant GUID
and a locally obtained refresh token. Missing GitHub secrets become empty inputs;
the WIQD script refuses them. Secrets belong in env, not interpolated into
run/pwsh text. These examples do not create platform release controls or
authorize a deployment.
Preserve state and handle failures
Section titled “Preserve state and handle failures”Keep related commands on the same project/environment state and securely retain stable resource IDs between runs. A fresh checkout does not make provisioning idempotent. Never preserve state by publishing env/user-secret files, auth caches or the entire project.
Continue only after native exit success, a valid JSON success envelope and
expected package output. Configure WIQD host --yes only with explicit job-owner
authorization; downstream EULA consent remains outside CI except for the
manifest-opted-in, separately authorized Work IQ acceptance above. Inspect existing
resources after timeout or uncertainty before any manually approved rerun;
do not automatically retry mutations. WIQD does not rotate your secret store.
The platform integration handoff contains the WIQD release/extensions, commands, working directory, credential names/scope, state ownership, expected package/ receipt outputs and remaining qualification. Your platform skill owns the broader setup surrounding these WIQD steps. Local example checks are not evidence that a live pipeline succeeded.