@ingram-cloud/pulumi 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -121,6 +121,29 @@ const bookkeeper = new ic.IcAgent("bookkeeper", {
121
121
  > keep it as the app's migration script. New smiths attach at birth in app code.
122
122
  > Pulumi does not own per-smith runtime state.
123
123
 
124
+ ### IcWebPage (declare in the APP repo)
125
+
126
+ A **hosted page** — a private, shareable web page that runs an agent (a `web`
127
+ deployment). Each visitor gets their own smith; the 128-bit `dep_` id in the URL is
128
+ the privacy boundary, with an optional shared `password` on top. Point it at an
129
+ `IcAgent` and read back `pageUrl` — the link to hand out.
130
+
131
+ ```ts
132
+ const page = new ic.IcWebPage("docs-page", {
133
+ ...conn,
134
+ agentId: curator.agentId,
135
+ title: "Ingram Cloud docs assistant",
136
+ greeting: "Ask me anything about Ingram Cloud.",
137
+ // password: "optional-shared-secret",
138
+ });
139
+
140
+ export const pageUrl = page.pageUrl; // https://cloud.ingram.tech/hosted/dep_…
141
+ ```
142
+
143
+ > The API has no update path for a web deployment's title/greeting/password, so a
144
+ > change to any of those (or to `agentId`) **replaces** the page and mints a fresh
145
+ > `pageUrl`. The agent's instructions change on the `IcAgent`, not here.
146
+
124
147
  ### IcMcpServer, IcOauthProvider, IcTelegramBot, IcWhatsAppConfig, IcEmail, IcWebhook, IcModelKey (declare in INFRA)
125
148
 
126
149
  ```ts
@@ -248,3 +248,20 @@ export declare class IcProjectToken extends pulumi.dynamic.Resource {
248
248
  readonly tokenId: pulumi.Output<string>;
249
249
  constructor(name: string, args: IcProjectTokenArgs, opts?: pulumi.CustomResourceOptions);
250
250
  }
251
+ export interface IcWebPageArgs {
252
+ baseUrl: pulumi.Input<string>;
253
+ token: pulumi.Input<string>;
254
+ /** The `agt_…` id this page runs. Typically an `IcAgent().agentId`. */
255
+ agentId: pulumi.Input<string>;
256
+ title?: pulumi.Input<string>;
257
+ greeting?: pulumi.Input<string>;
258
+ /** Optional shared password gating the page. */
259
+ password?: pulumi.Input<string>;
260
+ }
261
+ export declare class IcWebPage extends pulumi.dynamic.Resource {
262
+ /** The `dep_…` deployment id (same as `.id`, exposed for convenience). */
263
+ readonly deploymentId: pulumi.Output<string>;
264
+ /** The shareable page URL (e.g. `https://cloud.ingram.tech/hosted/dep_…`). */
265
+ readonly pageUrl: pulumi.Output<string>;
266
+ constructor(name: string, args: IcWebPageArgs, opts?: pulumi.CustomResourceOptions);
267
+ }
package/dist/resources.js CHANGED
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.IcProjectToken = exports.IcProject = exports.IcModelKey = exports.IcWebhook = exports.IcEmail = exports.IcWhatsAppConfig = exports.IcOauthProvider = exports.IcTelegramBot = exports.IcMcpServer = exports.IcAgent = exports.IC_API_VERSION = void 0;
36
+ exports.IcWebPage = exports.IcProjectToken = exports.IcProject = exports.IcModelKey = exports.IcWebhook = exports.IcEmail = exports.IcWhatsAppConfig = exports.IcOauthProvider = exports.IcTelegramBot = exports.IcMcpServer = exports.IcAgent = exports.IC_API_VERSION = void 0;
37
37
  /**
38
38
  * Ingram Cloud /v1 tenant configuration as Pulumi dynamic resources.
39
39
  *
@@ -799,3 +799,53 @@ class IcProjectToken extends pulumi.dynamic.Resource {
799
799
  }
800
800
  }
801
801
  exports.IcProjectToken = IcProjectToken;
802
+ const webPageProvider = {
803
+ async create(i) {
804
+ const body = {
805
+ target: { type: "agent", id: i.agentId },
806
+ kind: "web",
807
+ provider_metadata: {
808
+ ...(i.title ? { title: i.title } : {}),
809
+ ...(i.greeting ? { greeting: i.greeting } : {}),
810
+ },
811
+ };
812
+ if (i.password)
813
+ body.secrets = { password: i.password };
814
+ const res = await icRequest(i.baseUrl, i.token, "POST", "/v1/deployments", body);
815
+ return {
816
+ id: res.id,
817
+ outs: { ...i, deploymentId: res.id, pageUrl: res.page_url },
818
+ };
819
+ },
820
+ async update(_id, olds, news) {
821
+ // No web-metadata PATCH on the API — diff marks every field as a replace, so
822
+ // this path is only reached for a no-op refresh. Carry outputs forward.
823
+ return { outs: { ...news, deploymentId: _id, pageUrl: olds.pageUrl } };
824
+ },
825
+ async delete(id, props) {
826
+ await icRequest(props.baseUrl, props.token, "DELETE", `/v1/deployments/${id}`);
827
+ },
828
+ async diff(_id, olds, news) {
829
+ return simpleDiff(olds, news, {
830
+ replaceKeys: ["agentId", "title", "greeting", "password"],
831
+ });
832
+ },
833
+ async read(id, props) {
834
+ return read404(() => icRequest(props.baseUrl, props.token, "GET", `/v1/deployments/${id}`), (dep) => ({
835
+ id,
836
+ props: {
837
+ ...props,
838
+ title: dep.provider_metadata?.title,
839
+ greeting: dep.provider_metadata?.greeting,
840
+ deploymentId: id,
841
+ pageUrl: dep.page_url,
842
+ },
843
+ }));
844
+ },
845
+ };
846
+ class IcWebPage extends pulumi.dynamic.Resource {
847
+ constructor(name, args, opts) {
848
+ super(webPageProvider, name, { deploymentId: undefined, pageUrl: undefined, ...args }, { ...opts, additionalSecretOutputs: ["token", "password"] });
849
+ }
850
+ }
851
+ exports.IcWebPage = IcWebPage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ingram-cloud/pulumi",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Pulumi dynamic resources for the Ingram Cloud /v1 API — projects, project tokens, agents, MCP servers, channels, webhooks, model keys.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://cloud.ingram.tech",